r2190 - jhalfs/trunk

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Thu Nov 17 11:16:55 PST 2005


Author: manuel
Date: 2005-11-17 12:16:55 -0700 (Thu, 17 Nov 2005)
New Revision: 2190

Modified:
   jhalfs/trunk/jhalfs
Log:
Be sure that $BUILDDIR is clean and usable.

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2005-11-17 18:33:25 UTC (rev 2189)
+++ jhalfs/trunk/jhalfs	2005-11-17 19:16:55 UTC (rev 2190)
@@ -81,6 +81,18 @@
 help="\
 Try '$0 --help' for more information."
 
+no_empty_builddir="\
+echo \"\" >&2
+echo \"        W A R N I N G\" >&2
+echo \"\" >&2
+echo \"Look like the \$BUILDDIR directory contains subdirectories\" >&2
+echo \"from a previous LFS build.\" >&2
+echo \"\" >&2
+echo \"Please, format the partition mounted on \$BUILDDIR or set\" >&2
+echo \"a diferent build directory before to run jhalfs.\" >&2
+echo \"\" >&2
+exit 1"
+
 exit_missing_arg="\
 echo \"Option '\$1' requires an argument\" >&2
 echo \"\$help\" >&2
@@ -90,7 +102,6 @@
 echo \"Could not find a way to download the LFS sources.\" >&2
 echo \"Attempting to continue.\" >&2"
 
-
 HEADER="# This file is automatically generated by jhalfs
 # DO NOT EDIT THIS FILE MANUALLY
 #
@@ -1009,6 +1020,14 @@
   shift
 done
 
+# If $BUILDDIR have subdirectories like tools/ or bin/, stop the run
+# and notify the user about that. This also prevent to set "-d /"
+# by mistake.
+
+if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] ; then
+  eval "$no_empty_builddir"
+fi
+
 # Find the download client to use, if not already specified.
 
 if [ -z $DL ] ; then




More information about the alfs-log mailing list