Author: pierre
Date: Thu Aug 10 08:25:12 2017
New Revision: 3997

Log:
Improve the list of installed LFS packages:
Take package names and versions from <sect1info> tags in lfs-full.xml

Modified:
   jhalfs/trunk/common/libs/func_install_blfs

Modified: jhalfs/trunk/common/libs/func_install_blfs
==============================================================================
--- jhalfs/trunk/common/libs/func_install_blfs  Thu Aug 10 01:10:43 2017        
(r3996)
+++ jhalfs/trunk/common/libs/func_install_blfs  Thu Aug 10 08:25:12 2017        
(r3997)
@@ -216,19 +216,30 @@
 cat >> Makefile << EOF
 update:
        @echo Updating the tracking file
-       @LFS_LIST=\$\$(cat $BLFS_ROOT/packages.xml | \\
-               sed -n '/lfs-6/,/LFS-Release/p' | \\
-               sed '/<sublist/,+1d' | \\
-               sed -n '/<name>/p' | \\
-               sed 's/<name>//;s/<\\/name>//'); \\
-       for file in \$\$LFS_LIST *-*; do \\
-       xsltproc --stringparam packages ../packages.xml \\
-       --stringparam package \$\${file##*z-} \\
-       -o track.tmp \\
-       ../xsl/bump.xsl \$(TRACKING_FILE); \\
-       sed -i 's@PACKDESC@$BLFS_ROOT/packdesc.dtd@' track.tmp; \\
-       xmllint --format --postvalid track.tmp > \$(TRACKING_FILE); \\
-       rm track.tmp; \\
+       @for pack in \$\$(grep '<productname' ../$LFS_XML/tmp/lfs-full.xml | \\
+               sed 's/.*>\([^<]*\)<.*/\1/' | \\
+               sort | uniq); do \\
+           VERSION=\$\$(grep -A1 "\$\$pack</product" \\
+                       ../$LFS_XML/tmp/lfs-full.xml | \\
+               head -n2|  \\
+               sed -n '2s/.*>\([^<]*\)<.*/\1/p');  \\
+           xsltproc --stringparam packages ../packages.xml \\
+               --stringparam package \$\$pack \\
+               --stringparam version \$\$VERSION \\
+               -o track.tmp \\
+               ../xsl/bump.xsl \$(TRACKING_FILE); \\
+           sed -i 's@PACKDESC@$BLFS_ROOT/packdesc.dtd@' track.tmp; \\
+           xmllint --format --postvalid track.tmp > \$(TRACKING_FILE); \\
+           rm track.tmp; \\
+       done; \\
+       for file in *-*; do \\
+           xsltproc --stringparam packages ../packages.xml \\
+               --stringparam package \$\${file##*z-} \\
+               -o track.tmp \\
+               ../xsl/bump.xsl \$(TRACKING_FILE); \\
+           sed -i 's@PACKDESC@$BLFS_ROOT/packdesc.dtd@' track.tmp; \\
+           xmllint --format --postvalid track.tmp > \$(TRACKING_FILE); \\
+           rm track.tmp; \\
        done
        @touch \$@
        @echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK
-- 
http://lists.linuxfromscratch.org/listinfo/alfs-log
Unsubscribe: See the above information page

Reply via email to