tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tveron...@apache.org
Subject svn commit: r1591673 - in /tomee/tomee/trunk/tomee/tomee-deb/src/main: groovy/org/apache/tomee/deb/PackageBuilder.groovy resources/control/postinst.sh resources/control/postrm.sh resources/control/prerm.sh
Date Thu, 01 May 2014 14:40:33 GMT
Author: tveronezi
Date: Thu May  1 14:40:33 2014
New Revision: 1591673

URL: http://svn.apache.org/r1591673
Log:
Creating a new directory to hold user data during upgrades. This new directory will only be
removed if the user purges the package.

Modified:
    tomee/tomee/trunk/tomee/tomee-deb/src/main/groovy/org/apache/tomee/deb/PackageBuilder.groovy
    tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postinst.sh
    tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postrm.sh
    tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/prerm.sh

Modified: tomee/tomee/trunk/tomee/tomee-deb/src/main/groovy/org/apache/tomee/deb/PackageBuilder.groovy
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-deb/src/main/groovy/org/apache/tomee/deb/PackageBuilder.groovy?rev=1591673&r1=1591672&r2=1591673&view=diff
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-deb/src/main/groovy/org/apache/tomee/deb/PackageBuilder.groovy
(original)
+++ tomee/tomee/trunk/tomee/tomee-deb/src/main/groovy/org/apache/tomee/deb/PackageBuilder.groovy
Thu May  1 14:40:33 2014
@@ -158,6 +158,9 @@ class PackageBuilder {
             fileset(dir: outputDir.absolutePath, includes: '**/*.original')
             fileset(dir: outputDir.absolutePath, includes: '**/*.tmp')
         }
+        // Moving the default tomee webapp to /usr/share/tomee-${classifier}
+        new File(outputDir, 'webapps/tomee').renameTo(new File(outputDir, 'tomee-webapp'))
+        // Removing all extra webapps, including the webapps directory
         ant.delete(includeemptydirs: true, dir: new File(outputDir, 'webapps').absolutePath)
         outputDir.absolutePath
     }
@@ -317,9 +320,7 @@ class PackageBuilder {
         buildChangelog(docDir, classifier)
         new File(dataDir, "var/log/tomee-${classifier}").mkdirs()
         new File(dataDir, "var/lib/tomee-${classifier}/conf").mkdirs()
-        new File(dataDir, "var/lib/tomee-${classifier}/temp").mkdirs()
         new File(dataDir, "var/lib/tomee-${classifier}/work").mkdirs()
-        new File(dataDir, "var/lib/tomee-${classifier}/webapps").mkdirs()
         new File(dataDir, "var/lib/tomee-${classifier}/apps").mkdirs()
         new File(distributionTomeeDir, 'conf').delete() // add link from "/usr/lib/tomee/conf"
to "/etc/tomee"
         new File(distributionTomeeDir, 'logs').delete() // add link from "/usr/lib/tomee/logs"
to "/var/log/tomee"

Modified: tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postinst.sh
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postinst.sh?rev=1591673&r1=1591672&r2=1591673&view=diff
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postinst.sh (original)
+++ tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postinst.sh Thu May  1 14:40:33
2014
@@ -31,12 +31,22 @@ do
     ln -sf \$tomcatJar /usr/share/tomee-${classifier}/lib/\$(basename "\$tomcatJar")
 done
 
+# Creating user apps directory. We dont want to erase it during an upgrade.
+if [ ! -d /var/lib/tomee-${classifier}-user-data ] ; then
+    mkdir -p /var/lib/tomee-${classifier}-user-data/temp
+	mkdir -p /var/lib/tomee-${classifier}-user-data/webapps
+	ln -sf /usr/share/tomee-${classifier}/tomee-webapp /var/lib/tomee-${classifier}-user-data/webapps/tomee
+fi
+ln -sf /var/lib/tomee-${classifier}-user-data/temp /var/lib/tomee-${classifier}/temp
+ln -sf /var/lib/tomee-${classifier}-user-data/webapps /var/lib/tomee-${classifier}/webapps
+
 groupadd apachetomee || true
 useradd --system apachetomee -g apachetomee || true
 
 chown -R root:apachetomee /var/log/tomee-${classifier}
 chown -R root:apachetomee /var/lib/tomee-${classifier}
 chown -R root:apachetomee /etc/tomee-${classifier}
+chown -R root:apachetomee /var/lib/tomee-${classifier}-user-data
 
 # users from the apachetomee group should be able to change settings.
 # there is no need to be root.
@@ -44,6 +54,7 @@ chmod -R g+w /etc/tomee-${classifier}
 
 chmod -R g+w /var/log/tomee-${classifier}
 chmod -R g+w /var/lib/tomee-${classifier}
+chmod -R g+w /var/lib/tomee-${classifier}-user-data
 
 update-rc.d tomee-${classifier} defaults
 

Modified: tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postrm.sh
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postrm.sh?rev=1591673&r1=1591672&r2=1591673&view=diff
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postrm.sh (original)
+++ tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/postrm.sh Thu May  1 14:40:33
2014
@@ -16,3 +16,7 @@
 # limitations under the License.
 
 update-rc.d -f tomee-${classifier} remove
+
+if [ purge = "\$1" ]; then
+    rm -Rf /var/lib/tomee-${classifier}-user-data
+fi

Modified: tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/prerm.sh
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/prerm.sh?rev=1591673&r1=1591672&r2=1591673&view=diff
==============================================================================
--- tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/prerm.sh (original)
+++ tomee/tomee/trunk/tomee/tomee-deb/src/main/resources/control/prerm.sh Thu May  1 14:40:33
2014
@@ -27,8 +27,8 @@ rm -f /var/lib/tomee-${classifier}/logs
 rm -Rf /var/lib/tomee-${classifier}/apps
 rm -Rf /var/lib/tomee-${classifier}/conf
 rm -Rf /var/lib/tomee-${classifier}/bin
-rm -Rf /var/lib/tomee-${classifier}/temp
-rm -Rf /var/lib/tomee-${classifier}/webapps
+rm /var/lib/tomee-${classifier}/temp
+rm /var/lib/tomee-${classifier}/webapps
 rm -Rf /var/lib/tomee-${classifier}/work
 
 # Unlinking tomcat jars



Mime
View raw message