From 6d1d77c1e8b09fb5bad0099fa017a5f3703365ae Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Thu, 10 Aug 2017 15:25:12 +0000 Subject: [PATCH] Improve the list of installed LFS packages: Take package names and versions from tags in lfs-full.xml --- common/libs/func_install_blfs | 37 +++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/common/libs/func_install_blfs b/common/libs/func_install_blfs index a591d09..0188e89 100644 --- a/common/libs/func_install_blfs +++ b/common/libs/func_install_blfs @@ -216,19 +216,30 @@ sed -i -e '/xsltproc/,+6d' \ cat >> Makefile << EOF update: @echo Updating the tracking file - @LFS_LIST=\$\$(cat $BLFS_ROOT/packages.xml | \\ - sed -n '/lfs-6/,/LFS-Release/p' | \\ - sed '//p' | \\ - sed 's///;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 '\([^<]*\)<.*/\1/' | \\ + sort | uniq); do \\ + VERSION=\$\$(grep -A1 "\$\$pack\([^<]*\)<.*/\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