Changeset e6a1ec3 for BLFS


Ignore:
Timestamp:
09/20/2023 09:52:52 AM (12 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, trunk
Children:
c801809
Parents:
0cd09c6
Message:

Update comments in BLFS/gen-special.sh

Also change a %%-:digit:]* to %-[[:digit:* because we want to
select only the last occurrence of this pattern.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/gen-special.sh

    r0cd09c6 re6a1ec3  
    8888done
    8989
    90 # Taking packages inside x7proto etc, as versionned modules.
     90# Taking packages contained in pages installing several packages (x7* except
     91# x7driver, kf5-frameworks, and plasma5-all), as versionned modules.
    9192# We also write a dependency expansion when a dep is of the form
    92 # xorg7-something. Since that is another template, we need
    93 # a temporary file, which we shall concatenate at the end
     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
    9495cat >tmpfile << EOF
    9596  <xsl:template name="expand-deps">
     
    113114      <xsl:when test="\$section='$id'">
    114115EOF
    115 # We extract the list of packages for an xorg page from
    116 # the version part of the .xml file. Seems that
    117 # the order is not always the same as in the "cat" command.
    118 # So we have to read that command too, since it may be assumed
     116# We extract the list of packages for those pages from
     117# the "cat" command that creates the md5 file. We assume
    119118# that the preceding package is a dependency of the following,
    120119# except the first.
    121 list_cat="$(sed -n '/>cat.*\.\(md5\|dat\)/,/EOF</p' $file | grep -v 'cat\|EOF\|#' |
    122               awk '{ print $NF }' | sed 's/-&.*//')"
     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.
     126list_cat="$(sed -n '/>cat.*\.\(md5\|dat\)/,/EOF</p' $file | \
     127            grep -v 'cat\|EOF\|#' | \
     128            awk '{ print $NF }' | sed 's/-&.*//')"
    123129
    124130  precpack=NONE
     
    126132    if grep -q x7 $file; then # this is an xorg package
    127133      packname=$pack
     134# We extract the version from the ENTITY parts of the .xml file.
    128135      packversion=$(grep "ENTITY ${pack}-version" $file | \
    129136                    sed 's@[^"]*"\([^"]*\).*@\1@')
    130137    else
    131       packname=${pack%%-[[:digit:]]*}
     138      packname=${pack%-[[:digit:]]*}
    132139      packversion=$(echo $pack | sed 's/[^.]*-\([.[:digit:]]*\)\.tar.*/\1/')
    133140    fi
    134 ## Rationale for the sed below: the following for breaks words at spaces (unless
    135 ## we tweak IFS). So replace spaces with commas in lines so that only newlines
    136 ## are separators.
    137 #  for pack in \
    138 #      $(grep 'ENTITY.*version' $file | sed 's/[ ]\+/,/g'); do
    139 #    packname=$(echo $pack | sed s'@.*ENTITY,\(.*\)-version.*@\1@')
    140 #    packversion=$(echo $pack | sed 's@[^"]*"\([^"]*\).*@\1@')
    141 #    for i in $list_cat; do
    142 #      if [ "$i" = "$packname" ]; then break; fi
    143 #      precpack=$i
    144 #    done
    145 ## It may happen that packname is not in list_cat, because its entity
    146 ## is commented out in the xml, but we do not check that (too complicated).
    147 ## In that case, the whole list is scanned, and $precpack=$i at the end.
    148 ## when packname is found in the list $precpack!=$i.
    149 #    if [ "$precpack" = "$i" ]; then continue; fi
    150141    cat >>$SPECIAL_FILE << EOF
    151142        <module><xsl:text>&#xA;          </xsl:text>
Note: See TracChangeset for help on using the changeset viewer.