From dba76dae66661d5ca872baee00d6715b88dfeaa8 Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Sun, 11 Jul 2004 20:43:27 +0000 Subject: [PATCH] Stefan Fiedler: scripts/config.in: add support for pkgforked packages in package selection rules and comment the pkgsel code. [2004070523563628767] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@3559 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- scripts/config.in | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/config.in b/scripts/config.in index 40367b172..fbb5ca43f 100644 --- a/scripts/config.in +++ b/scripts/config.in @@ -185,6 +185,23 @@ expert_begin editfile ROCKCFG_PKGSEL_FILE config/$config/pkgsel \ 'Package selection rules' +# Create an awk program from the list of package selection rules stored in +# config/$config/pkgsel which is applied to the list of packages stored in +# config/$config/packages. +# Syntax for package selection rules is: +# +# is a single character: x or X enables the packages matching +# , o or O disables them, - omits them in the packages list. +# Any other character exits the awk program, resulting in an empty list. +# consists of one or more white-space separated s. +# consists of letters, numbers, and characters _ * + . = - +# is performed on every line in the list matching all s of a rule. +# If the first of a rule is a !, is performed on every line +# _not_ matching _any_ of a rule. +# A of the form = denotes a pkgforked package; +# such a will duplicate the line of the and substitute its +# package name with the name of the pkgforked package, that is, the . + echo "# created from 'pkgsel'" > config/$config/pkgsel.awk while read action patternlist ; do case "$action" in @@ -205,12 +222,16 @@ expert_begin address="! " ; others="||" else pattern="$( echo "$pattern" | sed \ - -e 's,[^a-zA-Z0-9_/\*+\.-],,g' \ + -e 's,[^a-zA-Z0-9_/\*+\.=-],,g' \ -e 's,[/\.\+],\\&,g' \ -e 's,\*,[^ ]*,g' )" [ "$pattern" ] || continue - address="$address$first" - address="$address / $pattern /" +# check if pattern describes a pkgforked package + if [ "$pattern" != "${pattern%=*}" ] ; then + action="print; $action; \$5=\"$pattern\"" + pattern=${pattern%=*} + fi + address="$address$first / $pattern /" first=" $others" fi done < <( echo "$patternlist" | tr '\t ' '\n\n' )