r3443 - in jhalfs/trunk: BLFS/libs common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Fri Aug 10 14:24:02 PDT 2007


Author: manuel
Date: 2007-08-10 15:24:02 -0600 (Fri, 10 Aug 2007)
New Revision: 3443

Modified:
   jhalfs/trunk/BLFS/libs/scripts.xsl
   jhalfs/trunk/common/makefile-functions
Log:
Failsafe tests to be sure that we are deleting an existing unpacked sources directory. 
Thanks to Petr "Qaxi" Kl?\195?\173ma for the report and patch.

Modified: jhalfs/trunk/BLFS/libs/scripts.xsl
===================================================================
--- jhalfs/trunk/BLFS/libs/scripts.xsl	2007-08-10 21:06:15 UTC (rev 3442)
+++ jhalfs/trunk/BLFS/libs/scripts.xsl	2007-08-10 21:24:02 UTC (rev 3443)
@@ -155,7 +155,7 @@
         <xsl:text>
 if [[ -e unpacked ]] ; then
   UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
-  rm -rf $UNPACKDIR
+  [[ -n $UNPACKDIR ]] && [[ -d $UNPACKDIR ]] && rm -rf $UNPACKDIR
 fi
 tar -xvf $PACKAGE > unpacked
 UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`

Modified: jhalfs/trunk/common/makefile-functions
===================================================================
--- jhalfs/trunk/common/makefile-functions	2007-08-10 21:06:15 UTC (rev 3442)
+++ jhalfs/trunk/common/makefile-functions	2007-08-10 21:24:02 UTC (rev 3443)
@@ -64,6 +64,7 @@
 define remove_existing_dirs
   @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
   ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
+  test -n "$$ROOT" -a -d $(SRCSDIR)/$$ROOT && \
   rm -rf $(SRCSDIR)/$$ROOT && \
   rm -rf $(SRCSDIR)/$${ROOT%-*}-build
 endef
@@ -71,6 +72,7 @@
 define remove_existing_dirs2
   @PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
   ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
+  test -n "$$ROOT" -a -d $(SRC)/$$ROOT && \
   rm -rf $(SRC)/$$ROOT && \
   rm -rf $(SRC)/$${ROOT%-*}-build
 endef




More information about the alfs-log mailing list