Author: brett
Date: Thu Jun  9 21:10:29 2005
New Revision: 189892

URL: http://svn.apache.org/viewcvs?rev=189892&view=rev
Log:
PR: MNG-463
safety guard against bootstrapping with a Maven Home that is not empty, and not 
a previous Maven installation

Modified:
    maven/components/trunk/maven-mboot2/src/main/java/MBoot.java

Modified: maven/components/trunk/maven-mboot2/src/main/java/MBoot.java
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-mboot2/src/main/java/MBoot.java?rev=189892&r1=189891&r2=189892&view=diff
==============================================================================
--- maven/components/trunk/maven-mboot2/src/main/java/MBoot.java (original)
+++ maven/components/trunk/maven-mboot2/src/main/java/MBoot.java Thu Jun  9 
21:10:29 2005
@@ -217,6 +217,19 @@
 
         System.out.println( "Maven installation directory: " + dist );
 
+        if ( dist.exists() )
+        {
+            if ( !new File( dist, "bin/m2.conf" ).exists() )
+            {
+                System.err.println( "The directory given to install Maven in 
already exists, but does not contain a Maven installation" );
+                System.err.println();
+                System.err.println( "\t" + dist );
+                System.err.println();
+                System.err.println( "If you really mean to install Maven to 
this location, please delete the directory first" );
+                System.exit( 1 );
+            }
+        }
+
         Date fullStop;
 
         Date fullStart = new Date();
@@ -365,7 +378,6 @@
         }
 
         // build the installation
-
         FileUtils.deleteDirectory( dist );
 
         // 
----------------------------------------------------------------------



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

Reply via email to