Order the depdendencies in xorg

packages according to the order in the "cat"
command, rather than the order of the entity declarations
This commit is contained in:
Pierre Labastie 2013-04-18 16:15:26 +00:00
parent d48726d654
commit 14a3e908c2

View file

@ -97,9 +97,15 @@ EOF
cat >> tmpfile << EOF cat >> tmpfile << EOF
<xsl:when test="\$section='$id'"> <xsl:when test="\$section='$id'">
EOF EOF
# In the list, the preceding package is a dependency of the following, # We extract the list of packages for an xorg page from
# except the first: # the version part of the .xml file. Seems that
precpack=NONE # the order is not always the same as in the "cat" command.
# So we have to read that command too, since it may be assumed
# that the preceding package is a dependency of the following,
# except the first.
list_cat="$(sed -n '/>cat/,/EOF</p' $file | grep -v 'cat\|EOF' |
sed 's/^[^ ]*\ *\([^&]*\).*/\1/' | sed 's/-$//')"
# Rationale for the sed below: the following for breaks words at spaces (unless # Rationale for the sed below: the following for breaks words at spaces (unless
# we tweak IFS). So replace spaces with commas in lines so that only newlines # we tweak IFS). So replace spaces with commas in lines so that only newlines
# are separators. # are separators.
@ -107,6 +113,12 @@ EOF
$(grep 'ENTITY.*version' $file | sed 's/[ ]\+/,/g'); do $(grep 'ENTITY.*version' $file | sed 's/[ ]\+/,/g'); do
packname=$(echo $pack | sed s'@.*ENTITY,\(.*\)-version.*@\1@') packname=$(echo $pack | sed s'@.*ENTITY,\(.*\)-version.*@\1@')
packversion=$(echo $pack | sed 's@[^"]*"\([^"]*\).*@\1@') packversion=$(echo $pack | sed 's@[^"]*"\([^"]*\).*@\1@')
precpack=NONE
for i in $list_cat; do
if [ "$i" = "$packname" ]; then break; fi
precpack=$i
done
cat >>$SPECIAL_FILE << EOF cat >>$SPECIAL_FILE << EOF
<module><xsl:text>&#xA; </xsl:text> <module><xsl:text>&#xA; </xsl:text>
<xsl:element name="name">$packname</xsl:element> <xsl:element name="name">$packname</xsl:element>
@ -149,7 +161,6 @@ EOF
<xsl:attribute name="type">ref</xsl:attribute> <xsl:attribute name="type">ref</xsl:attribute>
</xsl:element> </xsl:element>
EOF EOF
precpack=$packname
done done
cat >>$SPECIAL_FILE << EOF cat >>$SPECIAL_FILE << EOF
</package> </package>