[Zope-CVS] SVN: zpkgtools/trunk/ - clean up some output from the generated configure script

Fred L. Drake, Jr. fred at zope.com
Mon Jun 21 16:25:05 EDT 2004


Log message for revision 25928:
- clean up some output from the generated configure script
- check that the application directory is a new directory, or the user
  specified to overwrite an existing directory using -f/--force



-=-
Modified: zpkgtools/trunk/doc/TODO.txt
===================================================================
--- zpkgtools/trunk/doc/TODO.txt	2004-06-21 16:33:22 UTC (rev 25927)
+++ zpkgtools/trunk/doc/TODO.txt	2004-06-21 20:23:08 UTC (rev 25928)
@@ -16,10 +16,6 @@
     when building an "application" distribution since that has some
     support to select from different available Python interpreters.)
 
-  - When installing an application bundle, it should be an error if
-    the installation directory already exists and the user hasn't
-    explicitly said that's ok (-f/--force).
-
   - There should be a way to specify a Download-URL when building a
     package; using the distutils "register" command would then cause
     that field to be provided via PyPI.

Modified: zpkgtools/trunk/zpkgtools/appsupport/configure.in
===================================================================
--- zpkgtools/trunk/zpkgtools/appsupport/configure.in	2004-06-21 16:33:22 UTC (rev 25927)
+++ zpkgtools/trunk/zpkgtools/appsupport/configure.in	2004-06-21 20:23:08 UTC (rev 25928)
@@ -172,18 +172,17 @@
         FOUND=`echo $OPT | sed -e 's/--[^=][^=]*=//'`
         # use eval to do tilde expansion
         eval "FOUND='$FOUND'"
-        out ""
-        out "Using Python interpreter at $FOUND"
         ;;
     --with-python | --with-pytho | --with-pyth | --with-pyt )
         FOUND="$1"
         shift 1
-        out ""
-        out "Using Python interpreter at $FOUND"
         ;;
     --quiet | --quie | --qui | --qu | --q | -q)
         QUIET="true"
         ;;
+    --force | --forc | --for | --fo | --f | -f)
+        FORCE_APP_HOME="true"
+        ;;
     --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=* )
         prefix=`echo $OPT | sed -e 's/--[^=][^=]*=//'`
         # use eval to do tilde expansion
@@ -207,8 +206,19 @@
 
 if [ -z "$FOUND" ]; then
     get_python
+else
+    out "Using Python interpreter at $FOUND"
+    out ""
 fi
 
+if [ -e "$prefix" -a ! "$FORCE_APP_HOME" ] ; then
+    echo 2>&1 "Installation directory $prefix already exists."
+    echo 2>&1 "Specify a directory that isn't being used, or"
+    echo 2>&1 "use --force to use it anyway."
+    out ""
+    exit 2
+fi
+
 sed -e "s|@prefix@|$prefix|g" \
     -e "s|@PYTHON@|$FOUND|g" \
     "$HERE/Makefile.in" > "$HERE/Makefile"




More information about the Zope-CVS mailing list