directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r385002 - in /directory/branches/daemon/1.0/plugin/src/main: java/org/apache/directory/daemon/installers/ java/org/apache/directory/daemon/installers/izpack/ java/org/apache/directory/daemon/installers/rpm/ resources/org/apache/directory/da...
Date Sat, 11 Mar 2006 04:04:14 GMT
Author: akarasulu
Date: Fri Mar 10 20:04:12 2006
New Revision: 385002

URL: http://svn.apache.org/viewcvs?rev=385002&view=rev
Log:
modified installer to use updated init scripts and to override the default init
script if the project supplies one

Modified:
    directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
    directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java
    directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
    directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/server.init
    directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init

Modified: directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
URL: http://svn.apache.org/viewcvs/directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java?rev=385002&r1=385001&r2=385002&view=diff
==============================================================================
--- directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
(original)
+++ directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
Fri Mar 10 20:04:12 2006
@@ -73,6 +73,7 @@
     private File docsDirectory;
     private String sourcesTargetPath;
     private String docsTargetPath;
+    private File scriptFile;
 
     private InstallationLayout layout;
     private List libArtifacts;
@@ -323,5 +324,17 @@
     public PackagedFile[] getPackagedFiles()
     {
         return packagedFiles;
+    }
+
+
+    public void setScriptFile( File scriptFile )
+    {
+        this.scriptFile = scriptFile;
+    }
+
+
+    public File getScriptFile()
+    {
+        return scriptFile;
     }
 }

Modified: directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java
URL: http://svn.apache.org/viewcvs/directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java?rev=385002&r1=385001&r2=385002&view=diff
==============================================================================
--- directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java
(original)
+++ directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java
Fri Mar 10 20:04:12 2006
@@ -305,16 +305,38 @@
                 }
             }
 
-            try
+            if ( target.getScriptFile() != null && target.getScriptFile().exists()
)
             {
-                MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, getClass().getResourceAsStream(
-                    "../template.init" ), layout.getInitScript(), true );
+                try
+                {
+                    MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, target.getScriptFile(),

+                        layout.getInitScript(), true );
+                }
+                catch ( IOException e )
+                {
+                    mymojo.getLog().error( "Failed to copy project supplied init script "
+ target.getScriptFile()
+                        + " into position " + layout.getInitScript(), e );
+                }
+
+                if ( mymojo.getLog().isInfoEnabled() )
+                {
+                    mymojo.getLog().info( "Using project supplied init script file: "
+                            + target.getScriptFile() );
+                }
             }
-            catch ( IOException e )
+            else
             {
-                mymojo.getLog().error(
-                    "Failed to copy init script " + getClass().getResource( "../template.init"
) + " into position "
-                        + layout.getInitScript(), e );
+                try
+                {
+                    MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, getClass().getResourceAsStream(
+                        "server.init" ), layout.getInitScript(), true );
+                }
+                catch ( IOException e )
+                {
+                    mymojo.getLog().error(
+                        "Failed to copy init script " + getClass().getResource( "server.init"
) + " into position "
+                            + layout.getInitScript(), e );
+                }
             }
         }
 

Modified: directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
URL: http://svn.apache.org/viewcvs/directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java?rev=385002&r1=385001&r2=385002&view=diff
==============================================================================
--- directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
(original)
+++ directory/branches/daemon/1.0/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
Fri Mar 10 20:04:12 2006
@@ -133,18 +133,40 @@
 
         String version = target.getApplication().getVersion().replace( '-', '_' );
         
-        try
+        if ( target.getScriptFile() != null && target.getScriptFile().exists() )
         {
-            MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, getClass()
-                .getResourceAsStream( "../template.init" ), target.getLayout().getInitScript(),
true );
+            try
+            {
+                MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, target.getScriptFile(),

+                    target.getLayout().getInitScript(), true );
+            }
+            catch ( IOException e )
+            {
+                mymojo.getLog().error( "Failed to copy project supplied init script " + target.getScriptFile()
+                    + " into position " + target.getLayout().getInitScript(), e );
+            }
+
+            if ( mymojo.getLog().isInfoEnabled() )
+            {
+                mymojo.getLog().info( "Using project supplied init script file: "
+                        + target.getScriptFile() );
+            }
         }
-        catch ( IOException e )
+        else
         {
-            mymojo.getLog().error(
-                "Failed to copy init script " + getClass().getResource( "../template.init"
) + " into position "
-                    + target.getLayout().getInitScript(), e );
+            try
+            {
+                MojoHelperUtils.copyAsciiFile( mymojo, filterProperties, getClass().getResourceAsStream(
+                    "server.init" ), target.getLayout().getInitScript(), true );
+            }
+            catch ( IOException e )
+            {
+                mymojo.getLog().error(
+                    "Failed to copy init script " + getClass().getResource( "server.init"
) + " into position "
+                        + target.getLayout().getInitScript(), e );
+            }
         }
-
+        
         // check first to see if the default spec file is present in src/main/installers
         File projectRpmFile = new File( mymojo.getSourceDirectory(), "spec.template" );
         if ( target.getRpmSpecificationFile() != null && target.getRpmSpecificationFile().exists()
)
@@ -294,7 +316,6 @@
         filterProperties.put( "verify.append.libs", getVerifyLibraryJars() );
         filterProperties.put( "installer.output.directory", target.getLayout().getBaseDirectory().getParent()
);
         filterProperties.put( "server.init", target.getLayout().getInitScript().getName()
);
-
         filterProperties.put( "app.install.base", "/usr/local/" + target.getApplication().getName()
+ "-" + version );
 
         if ( target.getDocsDirectory() != null )

Modified: directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/server.init
URL: http://svn.apache.org/viewcvs/directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/server.init?rev=385002&r1=385001&r2=385002&view=diff
==============================================================================
--- directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/server.init
(original)
+++ directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/izpack/server.init
Fri Mar 10 20:04:12 2006
@@ -34,10 +34,8 @@
 prog=$"${app} server"
 
 if [ -z "$JAVA_HOME" ] ; then
-  # Set the java path if no JAVA_HOME has been specified by the user
-  # for RPM this will be set to some path.  But izpack installers the
-  # plugin will set this to %JAVA_HOME izpack to change at install time
-  JAVA_HOME=${java.home.variable}
+  # Izpack installers set this to the home used for installer at install time
+  JAVA_HOME=%JAVA_HOME
 fi
 
 # OS specific support.  $var _must_ be set to either true or false.

Modified: directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init
URL: http://svn.apache.org/viewcvs/directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init?rev=385002&r1=385001&r2=385002&view=diff
==============================================================================
--- directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init
(original)
+++ directory/branches/daemon/1.0/plugin/src/main/resources/org/apache/directory/daemon/installers/rpm/server.init
Fri Mar 10 20:04:12 2006
@@ -33,13 +33,6 @@
 
 prog=$"${app} server"
 
-if [ -z "$JAVA_HOME" ] ; then
-  # Set the java path if no JAVA_HOME has been specified by the user
-  # for RPM this will be set to some path.  But izpack installers the
-  # plugin will set this to %JAVA_HOME izpack to change at install time
-  JAVA_HOME=${java.home.variable}
-fi
-
 # OS specific support.  $var _must_ be set to either true or false.
 cygwin=false;
 darwin=false;



Mime
View raw message