diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2014-04-17 22:42:44 +0800 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2014-04-17 22:42:44 +0800 |
commit | 817c4001a59de795f48231ffc7c11e8579a2ffc3 (patch) | |
tree | 6d56816801613f3f171cf33a42e591432ab228a7 | |
parent | cb5a1a5c5ea903c75a15689c78a42d0e81ae3d41 (diff) | |
download | freebsd-ports-gnome-817c4001a59de795f48231ffc7c11e8579a2ffc3.tar.gz freebsd-ports-gnome-817c4001a59de795f48231ffc7c11e8579a2ffc3.tar.zst freebsd-ports-gnome-817c4001a59de795f48231ffc7c11e8579a2ffc3.zip |
- Document PLIST_SUB_SED= will disable PLIST_SUB hints
- Avoid a redundant 'test -d'
- Properly show %%PORTEXAMPLES%% %%PORTDOCS%% where needed
- Avoid some forking for always-ignored files
With hat: portmgr
-rw-r--r-- | Mk/Scripts/check_leftovers.sh | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/Mk/Scripts/check_leftovers.sh b/Mk/Scripts/check_leftovers.sh index 73a04d702894..f5cedfe6b9f3 100644 --- a/Mk/Scripts/check_leftovers.sh +++ b/Mk/Scripts/check_leftovers.sh @@ -19,6 +19,9 @@ # stdout: # same -/+/M format, but with files substituted, without approved # whitelisted files, and hides any directories already in plist. +# +# The PLIST_SUB feature can be disabled by setting PLIST_SUB_SED= +# in environment. origin="$1" [ $# -eq 1 ] || { echo "Must supply ORIGIN as parameter" >&2; exit 1; } @@ -42,11 +45,6 @@ plistsub_sed=$(make -C ${portdir} -VPLIST_SUB_SED) tmpplist=$(make -C ${portdir} -VTMPPLIST) while read modtype path extra; do - ignore_path=0 - sub_path=$(echo "$path" | sed -e "s|^${PREFIX}/||" -e "${plistsub_sed}") - # If this is a directory, use @dirrm in output - [ -d "${path}" ] && sub_path="@dirrm ${sub_path}" - # Ignore everything from these files/directories case "${path}" in ${HOME:-/root}/.ccache/*|\ @@ -64,9 +62,26 @@ while read modtype path extra; do # fc-cache - skip for now /var/db/fontconfig/*) continue ;; esac + + ignore_path=0 + sub_path=$(echo "$path" | sed -e "s|^${PREFIX}/||" -e "${plistsub_sed}") + orig_sub_path="${sub_path}" + # If this is a directory, use @dirrm in output + is_dir=0 + if [ -d "${path}" ]; then + is_dir=1 + sub_path="@dirrm ${sub_path}" + fi + + # Handle PORTDOCS/PORTEXAMPLES/etc + case "${orig_sub_path}" in + %%DOCSDIR%%*) sub_path="%%PORTDOCS%%${sub_path}" ;; + %%EXAMPLESDIR%%*) sub_path="%%PORTEXAMPLES%%${sub_path}" ;; + esac + case $modtype in +) - if [ -d "${path}" ]; then + if [ ${is_dir} -eq 1 ]; then # home directory of users created case " ${homedirs} " in *\ ${path}\ *) continue ;; |