r3579 - jhalfs/branches/ablfs/BLFS

pierre at linuxfromscratch.org pierre at linuxfromscratch.org
Mon Feb 27 02:52:33 PST 2012


Author: pierre
Date: 2012-02-27 03:52:29 -0700 (Mon, 27 Feb 2012)
New Revision: 3579

Modified:
   jhalfs/branches/ablfs/BLFS/Makefile
Log:
Updated BLFS/Makefile so that initial generation of TRACKFILE is more robust

Modified: jhalfs/branches/ablfs/BLFS/Makefile
===================================================================
--- jhalfs/branches/ablfs/BLFS/Makefile	2012-02-27 10:47:30 UTC (rev 3578)
+++ jhalfs/branches/ablfs/BLFS/Makefile	2012-02-27 10:52:29 UTC (rev 3579)
@@ -28,11 +28,11 @@
 TRACKFILE = $(TRACKING_DIR)/instpkg.xml
 
 define INITIAL_TRACK
-<?xml version="1.0" encoding="ISO-8859-1"?>\
-\
-<!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\
-<sublist>\
-  <name>Installed</name>\
+<?xml version="1.0" encoding="ISO-8859-1"?>\n\
+\n\
+<!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\n\
+<sublist>\n\
+  <name>Installed</name>\n\
 </sublist>
 endef
 
@@ -61,18 +61,24 @@
 	$(Q)xmllint --postvalid --format -o $@ $@.tmp
 	$(Q)rm $@.tmp
 
+# Beware of the echo '$(INITIAL_TRACK)' command below:
+# if default shell is bash, needs echo -e
+# if default shell is sh : echo is enough
+# Don't ask me why
 $(TRACKFILE): $(TRACKING_DIR)
 	$(Q)if ! [ -f $@ ]; then \
 	echo Initializing $(TRACKFILE) && \
 	echo '$(INITIAL_TRACK)' > $@ && \
 	$(MAKE) $(PACK_LIST) && \
 	for track in $(TRACKING_DIR)/*-*; do \
+        if [ -f $track ]; then \
 	pack=$$(echo $$track | sed 's at .*/\(.*\)-[0-9c].*@\1@') && \
 	xsltproc --stringparam packages $(PACK_LIST) \
 	--stringparam package $$pack \
 	-o track.tmp $(XSLDIR)/bump.xsl $@ && \
 	sed -i 's at PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \
 	xmllint --format --postvalid track.tmp > $@; \
+        fi; \
 	done; \
 	rm -f track.tmp; \
 	fi




More information about the alfs-log mailing list