Strange use of tar in jhalfs

"Petr \"Qaxi\" Klíma" qaxi at seznam.cz
Sun Aug 5 23:03:08 PDT 2007


>> What is worse ALL files in /mnt/jhalfs-build_dir/sources are GONE .
>>     
>    ah-ha.. I had that happen _once_, years ago. I put it down to early 
> coding.
>   
>

Hi

this patch just check for empty $$ROOT variable

--- common/makefile-functions.orig      2007-07-02 22:59:52.000000000 +0200
+++ common/makefile-functions   2007-08-06 08:01:09.000000000 +0200
@@ -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 $(SRCSDIR)/$$ROOT && \
   rm -rf $(SRC)/$$ROOT && \
   rm -rf $(SRC)/$${ROOT%-*}-build
 endef

-- 

   Petr Klíma

   e-mail:  qaxi at seznam.cz              




More information about the alfs-discuss mailing list