[BLFS] Ticket #1730: clean the dependency list

With the new xsl/dependencies.xsl, the full dependency list is generated.
We compare the version and installed version gotten from packages.xml
using xsl/get_version.xsl and only install if the installed version is
lower than the available version. Since the installed version returned
by get_version.xsl for a non installed package is 0, that version is
always lower than the available version and the package is installed.
Note that if a package does not exist, both versions are empty, and
they compare as equal with our method. So they are never installed...
This commit is contained in:
Pierre Labastie 2021-12-12 18:39:03 +01:00
parent 1fc36f5654
commit a690d42f88

View file

@ -22,6 +22,7 @@ declare LibDir="${TOPDIR}/libs"
declare PackFile="${TOPDIR}/packages.xml" declare PackFile="${TOPDIR}/packages.xml"
declare BookXml="${TOPDIR}/book.xml" declare BookXml="${TOPDIR}/book.xml"
declare MakeBook="${TOPDIR}/xsl/make_book.xsl" declare MakeBook="${TOPDIR}/xsl/make_book.xsl"
declare GetVersion="${TOPDIR}/xsl/get_version.xsl"
declare MakeScripts="${TOPDIR}/xsl/scripts.xsl" declare MakeScripts="${TOPDIR}/xsl/scripts.xsl"
declare BookHtml="${TOPDIR}/book-html" declare BookHtml="${TOPDIR}/book-html"
declare BLFS_XML="${TOPDIR}/blfs-xml" declare BLFS_XML="${TOPDIR}/blfs-xml"
@ -192,12 +193,24 @@ echo 1 >> root.tree
cat root.dep >> root.tree cat root.dep >> root.tree
generate_dependency_tree root.tree 1 generate_dependency_tree root.tree 1
echo -e "\n${SD_BORDER}" echo -e "\n${SD_BORDER}"
echo Generating the ordered full dependency list
FULL_LIST="$(tree_browse root.tree)"
set -e
popd > /dev/null
#echo "$FULL_LIST"
#echo -e \\n provisional end... #echo -e \\n provisional end...
#exit #exit
echo Generating the ordered package list echo Generating the ordered package list
LIST="$(tree_browse root.tree)" LIST=
set -e while read p; do
popd > /dev/null versions=$(xsltproc --stringparam package "$p" $GetVersion $PackFile)
if [ "$versions" != "$(sort -V <<<$versions)" ]; then
LIST="$LIST $p"
fi
done <<<$FULL_LIST
#echo \""$LIST"\"
#echo -e \\n provisional end...
#exit
rm -f ${BookXml} rm -f ${BookXml}
echo Making XML book echo Making XML book
xsltproc --stringparam list "$LIST" \ xsltproc --stringparam list "$LIST" \