This is a patch that supports a situation where a user of maven may be responsible for 
updating the installed version ( have write acces to maven.home, but has no permission 
to create a directory in ${maven.home}/..

Instead of deleting the directory, we just delete the contents. Before creating 
maven.home, check if it already exists. Also removes a duplicate delete of maven home 
in the install target.

-Peter

Index: build-bootstrap.xml
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-maven/build-bootstrap.xml,v
retrieving revision 1.81
diff -u -r1.81 build-bootstrap.xml
--- build-bootstrap.xml 14 May 2002 00:07:59 -0000  1.81
+++ build-bootstrap.xml 14 May 2002 20:19:46 -0000
@@ -78,7 +78,12 @@

   <target name="clean">
     <!-- Remove any old installations of Maven -->
-    <delete dir="${maven.home}"/>
+    <!-- Sometimes the installer may not have permission to create a     -->
+   <!-- maven dir, but permission to install files in the dir. So only  -->
+   <!-- the contents of the maven dir are deleted, not the dir itself   -->
+   <delete dir="${maven.home}" quiet="true" includeEmptyDirs="true">
+      <fileset includes="../${maven.home}/**" />
+   </delete>

     <!-- Remove any cruft left in build.dest -->
     <delete dir="target"/>
@@ -255,13 +260,17 @@
   <!-- ================================================================== -->
   <!-- I N S T A L L                                                      -->
   <!-- ================================================================== -->
-
+  <!-- don't create the directory if it already exists -->
+  <target name="create-maven-home" unless="maven.home.exists" >
+    <mkdir dir="${maven.home}"/>
+  </target>
+  <target name="check-home-dir" >
+    <available property="maven.home.exists" file="{maven.home}" type="dir" />
+   <antcall target="create-maven-home" />
+  </target>
   <target
     name="install"
-    depends="generate-build">
-
-    <delete dir="${maven.home}"/>
-    <mkdir dir="${maven.home}"/>
+    depends="clean,check-home-dir,generate-build">

     <copy
       tofile="maven/build-gump.xml"




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to