diff --git a/lib/sde-config/functions.in b/lib/sde-config/functions.in index 023bb61..1e7b2da 100644 --- a/lib/sde-config/functions.in +++ b/lib/sde-config/functions.in @@ -203,85 +203,6 @@ pkgchecklicense() { done < <(grep "^X" $cfgtmpdir/config/packages) } -# Convert a pkg selection rule into awk format -# -# Usage: -# 1. call pkgsel_init -# 2. call pkgsel_parse as often as necessary -# 3. call pkgsel_finish -# Result: -# awk script for package selection, see config.in for its usage -# -# Example: -# pkgsel X python -# Result: ( / [^/]*\/python / ) { $1="X"; } -# pkgsel "O perl/*" -# Result: ( / perl\/[^/]* / ) { $1="O"; } -# pkgsel_parse < config/${config}/pkgsel -# Result: creates pkgsel.awk output -# pkgsel include file -# Result: continues processing file specified -pkgsel_parse() { - local action patterlist pattern - local address first others - while read action patternlist ; do - case "$action" in - [xX]) - action='$1="X"' ;; - [oO]) - action='$1="O"' ;; - -) - action='next' ;; - =) - action='$1=def' ;; - include) - pkgsel_parse < $patternlist - continue ;; - *) - echo '{ exit; }' - continue ;; - esac - address="" - while read xpattern ; do - pattern="${xpattern#\!}" - [ "$pattern" = "$xpattern" ]; neg=$? - [ "${pattern}" = "${pattern//\//}" ] && pattern="*/$pattern" - pattern="$( echo "$pattern" | sed \ - -e 's,[^a-zA-Z0-9_/\*+\-\[\]],,g' \ - -e 's,[/\.\+],\\\\&,g' \ - -e 's,\*,[^/]*,g' )" - if [ $neg -eq 0 ]; then - address="$address${address:+ && }( \$5 ~ \"^${pattern}\$\" )" - else - address="$address${address:+ && }( \$5 !~ \"^${pattern}\$\" )" - fi - done < <( echo "$patternlist" | tr '\t ' '\n\n' ) - echo "{ if ( $address ) { $action; } }" - done < <( if [ "$*" ]; then echo "$*"; else cat | egrep -v "^((^#.*$)|())$"; fi) -} - -pkgsel_init() { - cat <