Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/gen-special.sh

    re6a1ec3 r5ed69f8  
    8888done
    8989
    90 # Taking packages contained in pages installing several packages (x7* except
    91 # x7driver, kf5-frameworks, and plasma5-all), as versionned modules.
     90# Taking packages inside x7proto etc, as versionned modules.
    9291# We also write a dependency expansion when a dep is of the form
    93 # xorg7-something or kf5-frameworks or plasma5-build. Since that is another
    94 # template, we need a temporary file, which we shall concatenate at the end
     92# xorg7-something. Since that is another template, we need
     93# a temporary file, which we shall concatenate at the end
    9594cat >tmpfile << EOF
    9695  <xsl:template name="expand-deps">
     
    10099    <xsl:choose>
    101100EOF
    102 for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver) \
    103             ${BLFS_DIR}/kde/kf5/kf5-frameworks.xml                \
    104             ${BLFS_DIR}/kde/plasma5/plasma-all.xml; do
     101for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver); do
    105102  id=$(grep xreflabel $file | sed 's@.*id="\([^"]*\).*@\1@')
    106103  cat >>$SPECIAL_FILE << EOF
     
    114111      <xsl:when test="\$section='$id'">
    115112EOF
    116 # We extract the list of packages for those pages from
    117 # the "cat" command that creates the md5 file. We assume
     113# We extract the list of packages for an xorg page from
     114# the version part of the .xml file. Seems that
     115# the order is not always the same as in the "cat" command.
     116# So we have to read that command too, since it may be assumed
    118117# that the preceding package is a dependency of the following,
    119118# except the first.
    120 # note that some pages may have several "cat" command, so we have to
    121 # make a complex regex for the first line to save. All those lines have
    122 # .md5 in them except the one for x7legacy that has .dat.
    123 # we need also to remove lines beginning with #.
    124 # Note that only xorg pages have '&' in them. So for kde
    125 # pages, what is extracted it the full tarball name.
    126 list_cat="$(sed -n '/>cat.*\.\(md5\|dat\)/,/EOF</p' $file | \
    127             grep -v 'cat\|EOF\|#' | \
    128             awk '{ print $NF }' | sed 's/-&.*//')"
    129 
    130   precpack=NONE
    131   for pack in $list_cat; do
    132     if grep -q x7 $file; then # this is an xorg package
    133       packname=$pack
    134 # We extract the version from the ENTITY parts of the .xml file.
    135       packversion=$(grep "ENTITY ${pack}-version" $file | \
    136                     sed 's@[^"]*"\([^"]*\).*@\1@')
    137     else
    138       packname=${pack%-[[:digit:]]*}
    139       packversion=$(echo $pack | sed 's/[^.]*-\([.[:digit:]]*\)\.tar.*/\1/')
    140     fi
     119  list_cat="$(sed -n '/>cat/,/EOF</p' $file | grep -v 'cat\|EOF\|#' |
     120              awk '{ print $NF }' | sed 's/-&.*//')"
     121
     122# Rationale for the sed below: the following for breaks words at spaces (unless
     123# we tweak IFS). So replace spaces with commas in lines so that only newlines
     124# are separators.
     125  for pack in \
     126      $(grep 'ENTITY.*version' $file | sed 's/[ ]\+/,/g'); do
     127    packname=$(echo $pack | sed s'@.*ENTITY,\(.*\)-version.*@\1@')
     128    packversion=$(echo $pack | sed 's@[^"]*"\([^"]*\).*@\1@')
     129    precpack=NONE
     130    for i in $list_cat; do
     131      if [ "$i" = "$packname" ]; then break; fi
     132      precpack=$i
     133    done
     134# It may happen that packname is not in list_cat, because its entity
     135# is commented out in the xml, but we do not check that (too complicated).
     136# In that case, the whole list is scanned, and $precpack=$i at the end.
     137# when packname is found in the list $precpack!=$i.
     138    if [ "$precpack" = "$i" ]; then continue; fi
    141139    cat >>$SPECIAL_FILE << EOF
    142140        <module><xsl:text>&#xA;          </xsl:text>
     
    173171        </module>
    174172EOF
    175     cat >> tmpfile << EOF
     173#    cat >> tmpfile << EOF
     174#        <xsl:element name="dependency">
     175#          <xsl:attribute name="status">
     176#            <xsl:value-of select="\$status"/>
     177#          </xsl:attribute>
     178#          <xsl:attribute name="build">
     179#            <xsl:value-of select="\$build"/>
     180#          </xsl:attribute>
     181#          <xsl:attribute name="name">$packname</xsl:attribute>
     182#          <xsl:attribute name="type">ref</xsl:attribute>
     183#        </xsl:element>
     184#EOF
     185    precpack=$packname
     186  done
     187  cat >>$SPECIAL_FILE << EOF
     188     </package>
     189   </xsl:when>
     190EOF
     191  cat >> tmpfile << EOF
    176192        <xsl:element name="dependency">
    177193          <xsl:attribute name="status">
     
    184200          <xsl:attribute name="type">ref</xsl:attribute>
    185201        </xsl:element>
    186 EOF
    187     precpack=$packname
    188   done
    189   cat >>$SPECIAL_FILE << EOF
    190      </package>
    191    </xsl:when>
    192 EOF
    193   cat >> tmpfile << EOF
    194202      </xsl:when>
    195203EOF
Note: See TracChangeset for help on using the changeset viewer.