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".
This commit is contained in:
Pierre Labastie 2016-03-19 20:07:33 +00:00
parent 4888f0cdd4
commit e253015c69

View file

@ -9,7 +9,7 @@ declare ATOPDIR=`cd $TOPDIR; pwd`
declare MKFILE=Makefile declare MKFILE=Makefile
declare PREV_PACKAGE="" declare PREV_PACKAGE=""
declare BUILD_SCRIPTS=${TOPDIR}/scripts 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 XSLDIR=${TOPDIR}/xsl
declare PACK_FILE=${TOPDIR}/packages.xml declare PACK_FILE=${TOPDIR}/packages.xml
declare BUMP=${XSLDIR}/bump.xsl declare BUMP=${XSLDIR}/bump.xsl
@ -156,11 +156,19 @@ EOF
} }
if [[ ! -d ${BUILD_SCRIPTS} ]] ; then 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 exit 1
fi fi
# Let us make a clean base:
rm -rf * rm -rf *
generate_Makefile generate_Makefile