Author: pierre
Date: Sat Mar 19 13:07:33 2016
New Revision: 3859

Log:
When running BLFS/gen-makefile.sh, the current working directory is emptied.
If this is not the directory you intended to work in, you may erase precious
data. So only erase data in directories whose name begin with "work".

Modified:
   jhalfs/trunk/BLFS/gen-makefile.sh

Modified: jhalfs/trunk/BLFS/gen-makefile.sh
==============================================================================
--- jhalfs/trunk/BLFS/gen-makefile.sh   Tue Mar  8 12:29:02 2016        (r3858)
+++ jhalfs/trunk/BLFS/gen-makefile.sh   Sat Mar 19 13:07:33 2016        (r3859)
@@ -9,7 +9,7 @@
 declare MKFILE=Makefile
 declare PREV_PACKAGE=""
 declare BUILD_SCRIPTS=${TOPDIR}/scripts
-declare TRACKING_FILE=tracking-dir/instpkg.xml
+declare TRACKING_FILE=/var/lib/jhalfs/BLFS/instpkg.xml
 declare XSLDIR=${TOPDIR}/xsl
 declare PACK_FILE=${TOPDIR}/packages.xml
 declare BUMP=${XSLDIR}/bump.xsl
@@ -156,11 +156,19 @@
 }
 
 if [[ ! -d ${BUILD_SCRIPTS} ]] ; then
-  echo -e "\n\tThe \'${BUILD_SCRIPTS}\' directory has not been found.\n"
+  echo -e "\n\tThe '${BUILD_SCRIPTS}' directory has not been found.\n"
+  exit 1
+fi
+
+# Let us make a clean base, but first ensure that we are
+# not emptying a useful directory.
+MYDIR=$(pwd)
+MYDIR=$(basename $MYDIR)
+if [ "${MYDIR#work}" = "${MYDIR}" ] ; then
+  echo -e \\n\\tDirectory ${BOLD}$MYDIR${OFF} does not begin with \"work\"\\n
   exit 1
 fi
 
-# Let us make a clean base:
 rm -rf *
 
 generate_Makefile
-- 
http://lists.linuxfromscratch.org/listinfo/alfs-log
Unsubscribe: See the above information page

Reply via email to