svn commit: r504140 - head/Mk/Scripts
Bryan Drewery
bdrewery at FreeBSD.org
Thu Jun 13 22:22:07 UTC 2019
Author: bdrewery
Date: Thu Jun 13 22:22:06 2019
New Revision: 504140
URL: https://svnweb.freebsd.org/changeset/ports/504140
Log:
parse_plist: Avoid excess fork+exec inside the loop for stripping (mode) lines.
Need to do it still after stripping away @comment though.
The @dir handling could probably be improved as well somehow.
Modified:
head/Mk/Scripts/functions.sh
Modified: head/Mk/Scripts/functions.sh
==============================================================================
--- head/Mk/Scripts/functions.sh Thu Jun 13 22:14:10 2019 (r504139)
+++ head/Mk/Scripts/functions.sh Thu Jun 13 22:22:06 2019 (r504140)
@@ -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" \
More information about the svn-ports-all
mailing list