diff options
Diffstat (limited to 'Mk/Scripts/functions.sh')
-rw-r--r-- | Mk/Scripts/functions.sh | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Mk/Scripts/functions.sh b/Mk/Scripts/functions.sh index 20affc692b03..87f4e87451ed 100644 --- a/Mk/Scripts/functions.sh +++ b/Mk/Scripts/functions.sh @@ -25,13 +25,21 @@ parse_plist() { cwd=${PREFIX} cwd_save= commented_cwd= - while read -r line; do + # Strip (owner,group,perm) from keywords + sed -Ee 's/^@\([^)]*\)[[:space:]]+//' \ + -e 's/^(@[[:alpha:]]+)\([^)]*\)[[:space:]]+/\1 /' \ + | while read -r line; do # Handle deactivated OPTIONS. Treat "@comment file" as being in # the plist so it does not show up as an orphan. PLIST_SUB uses # a @comment to deactive files. XXX: It would be better to # make all ports use @ignore instead of @comment. if [ ${parse_comments} -eq 1 -a -z "${line%%@comment *}" ]; then line="${line##*@comment }" + # Strip (owner,group,perm) from keywords + # Need to do this again after stripping away @comment. + line="$(printf %s "$line" \ + | sed -Ee 's/^@\([^)]*\)[[:space:]]+//' \ + -e 's/^(@[[:alpha:]]+)\([^)]*\)[[:space:]]+/\1 /')" # Remove @comment so it can be parsed as a file, # but later prepend it again to create a list of # all files commented and uncommented. @@ -52,10 +60,6 @@ parse_plist() { fi fi - # Strip (owner,group,perm) from keywords - line="$(printf %s "$line" \ - | sed -Ee 's/^@\([^)]*\)[[:space:]]+//' \ - -e 's/^(@[[:alpha:]]+)\([^)]*\)[[:space:]]+/\1 /')" case $line in @dir*|'@unexec rmdir'*|'@unexec /bin/rmdir'*) line="$(printf %s "$line" \ |