directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r669433 - in /directory/daemon/trunk/plugin/src/main: java/org/apache/directory/daemon/installers/bin/ resources/org/apache/directory/daemon/installers/bin/
Date Thu, 19 Jun 2008 09:14:46 GMT
Author: pamarcelot
Date: Thu Jun 19 02:14:46 2008
New Revision: 669433

URL: http://svn.apache.org/viewvc?rev=669433&view=rev
Log:
Fix for DIRSERVER-1175 (Binary installer removes '/root' partition under certains circumstances).

Modified:
    directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java
    directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/bootstrap.sh
    directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh

Modified: directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java?rev=669433&r1=669432&r2=669433&view=diff
==============================================================================
--- directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java
(original)
+++ directory/daemon/trunk/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java
Thu Jun 19 02:14:46 2008
@@ -109,24 +109,24 @@
 
         log.info( "Copying Bin installer files" );
 
-        // Copying the apacheds files in the root directory
-        File binRootDirectory = new File( binDirectory, "root" );
-        binRootDirectory.mkdirs();
-        File binRootServerDirectory = new File( binRootDirectory, "server" );
+        // Copying the apacheds files in the rootFolder directory
+        File binRootFolderDirectory = new File( binDirectory, "rootFolder" );
+        binRootFolderDirectory.mkdirs();
+        File binRootFolderServerDirectory = new File( binRootFolderDirectory, "server" );
         try
         {
-            copyFiles( baseDirectory, binRootServerDirectory );
+            copyFiles( baseDirectory, binRootFolderServerDirectory );
         }
         catch ( IOException e )
         {
             log.error( e.getMessage() );
             throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getBaseDirectory()
-                + ") to the Bin directory (" + binRootDirectory + ")" );
+                + ") to the Bin directory (" + binRootFolderDirectory + ")" );
         }
 
         // Create instance and sh directory
-        File binRootInstanceDirectory = new File( binRootDirectory, "instance" );
-        binRootInstanceDirectory.mkdirs();
+        File binRootFolderInstanceDirectory = new File( binRootFolderDirectory, "instance"
);
+        binRootFolderInstanceDirectory.mkdirs();
         File binShDirectory = new File( binDirectory, "sh" );
         binShDirectory.mkdirs();
 
@@ -135,23 +135,23 @@
         {
             // Copying the apacheds.conf file to the server installation layout
             MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, getClass().getResourceAsStream(
"apacheds.conf" ),
-                new File( binRootServerDirectory, "conf/apacheds.conf" ), false );
+                new File( binRootFolderServerDirectory, "conf/apacheds.conf" ), false );
 
             // Copying the default instance apacheds.conf file
             MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, getClass().getResourceAsStream(
-                "apacheds-default.conf" ), new File( binRootInstanceDirectory, "apacheds.conf"
), false );
+                "apacheds-default.conf" ), new File( binRootFolderInstanceDirectory, "apacheds.conf"
), false );
 
             // Copying the log4j.properties file for the default instance
-            MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, new File( binRootServerDirectory,
-                "conf/log4j.properties" ), new File( binRootInstanceDirectory, "log4j.properties"
), false );
+            MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, new File( binRootFolderServerDirectory,
+                "conf/log4j.properties" ), new File( binRootFolderInstanceDirectory, "log4j.properties"
), false );
 
             // Copying the server.xml file for the default instance
-            MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, new File( binRootServerDirectory,
-                "conf/server.xml" ), new File( binRootInstanceDirectory, "server.xml" ),
false );
+            MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, new File( binRootFolderServerDirectory,
+                "conf/server.xml" ), new File( binRootFolderInstanceDirectory, "server.xml"
), false );
 
             // Copying the apacheds-init script file for the default instance
             MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, getClass().getResourceAsStream(
"apacheds-init" ),
-                new File( binRootInstanceDirectory, "apacheds-init" ), true );
+                new File( binRootFolderInstanceDirectory, "apacheds-init" ), true );
 
             // Copying shell script utilities for the installer
             MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, getClass().getResourceAsStream(
"bootstrap.sh" ),

Modified: directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/bootstrap.sh
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/bootstrap.sh?rev=669433&r1=669432&r2=669433&view=diff
==============================================================================
--- directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/bootstrap.sh
(original)
+++ directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/bootstrap.sh
Thu Jun 19 02:14:46 2008
@@ -1,5 +1,20 @@
 #!/bin/sh
 
+#------------------------------------------------------------------------------
+# Verifies the exit code of the last command used. If the exit code is 0, the
+# execution continues, if not the execution is halted and we exit the program
+# with a 1 value.
+#------------------------------------------------------------------------------
+verifyExitCode()
+{
+    if [ $? -ne 0 ]
+    then    
+		echo "An error occurred when installing Apache DS."
+		echo "Apache DS installation failed."
+		exit 1
+    fi
+}
+
 # Variables
 export APACHEDS_VERSION=${apacheds.version}
 
@@ -217,20 +232,28 @@
 echo "Unpacking the installer..."
 trap 'rm -f $archiveName; exit 1' HUP INT QUIT TERM
 tail -n +@LINES@ $0 > $archiveName
+verifyExitCode
 
 # Extracting the installer
 echo "Extracting the installer..."
 tar xzf $archiveName
+verifyExitCode
 
 # Launching the installer
 cd sh
+verifyExitCode
 . ./install.sh
+verifyExitCode
 
 # Cleaning
 cd ..
+verifyExitCode
 rm -rf sh
-rm -rd root
+verifyExitCode
+rm -rd rootFolder
+verifyExitCode
 rm -f $archiveName
+verifyExitCode
 
 # Finishing
 echo "Done."

Modified: directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh?rev=669433&r1=669432&r2=669433&view=diff
==============================================================================
--- directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
(original)
+++ directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
Thu Jun 19 02:14:46 2008
@@ -31,7 +31,7 @@
 # Copying the server files
 mkdir -p $APACHEDS_HOME_DIRECTORY
 verifyExitCode
-cp -r ../root/server/* $APACHEDS_HOME_DIRECTORY
+cp -r ../rootFolder/server/* $APACHEDS_HOME_DIRECTORY
 verifyExitCode
 
 # Creating instances home directory
@@ -59,27 +59,27 @@
 verifyExitCode
 
 # Copying the default instance files
-cp ../root/instance/apacheds.conf $DEFAULT_INSTANCE_HOME_DIRECTORY/conf/
+cp ../rootFolder/instance/apacheds.conf $DEFAULT_INSTANCE_HOME_DIRECTORY/conf/
 verifyExitCode
-cp ../root/instance/log4j.properties $DEFAULT_INSTANCE_HOME_DIRECTORY/conf/
+cp ../rootFolder/instance/log4j.properties $DEFAULT_INSTANCE_HOME_DIRECTORY/conf/
 verifyExitCode
-cp ../root/instance/server.xml $DEFAULT_INSTANCE_HOME_DIRECTORY/conf/
+cp ../rootFolder/instance/server.xml $DEFAULT_INSTANCE_HOME_DIRECTORY/conf/
 verifyExitCode
 
 # Filtering and copying the init.d script
-sed -e "s;@APACHEDS.HOME@;${APACHEDS_HOME_DIRECTORY};" ../root/instance/apacheds-init >
../root/instance/apacheds-init.tmp
+sed -e "s;@APACHEDS.HOME@;${APACHEDS_HOME_DIRECTORY};" ../rootFolder/instance/apacheds-init
> ../rootFolder/instance/apacheds-init.tmp
 verifyExitCode
-mv ../root/instance/apacheds-init.tmp ../root/instance/apacheds-init
+mv ../rootFolder/instance/apacheds-init.tmp ../rootFolder/instance/apacheds-init
 verifyExitCode
-sed -e "s;@INSTANCE.HOME@;${INSTANCES_HOME_DIRECTORY};" ../root/instance/apacheds-init >
../root/instance/apacheds-init.tmp
+sed -e "s;@INSTANCE.HOME@;${INSTANCES_HOME_DIRECTORY};" ../rootFolder/instance/apacheds-init
> ../rootFolder/instance/apacheds-init.tmp
 verifyExitCode
-mv ../root/instance/apacheds-init.tmp ../root/instance/apacheds-init
+mv ../rootFolder/instance/apacheds-init.tmp ../rootFolder/instance/apacheds-init
 verifyExitCode
-sed -e "s;@INSTANCE@;${DEFAULT_INSTANCE_NAME};" ../root/instance/apacheds-init > ../root/instance/apacheds-init.tmp
+sed -e "s;@INSTANCE@;${DEFAULT_INSTANCE_NAME};" ../rootFolder/instance/apacheds-init >
../rootFolder/instance/apacheds-init.tmp
 verifyExitCode
-mv ../root/instance/apacheds-init.tmp ../root/instance/apacheds-init
+mv ../rootFolder/instance/apacheds-init.tmp ../rootFolder/instance/apacheds-init
 verifyExitCode
-cp ../root/instance/apacheds-init /etc/init.d/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME
+cp ../rootFolder/instance/apacheds-init /etc/init.d/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME
 verifyExitCode
 
 # Setting the correct permissions on executable files



Mime
View raw message