aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2017-07-29 04:30:44 +0800
committerKoop Mast <kwm@rainbow-runner.nl>2018-02-04 05:15:46 +0800
commit866c2d8e2d357cd39d63659572742f5591f60684 (patch)
tree4ed8fbab86d985430d900fd7b2c0fb819b35bbe9 /Mk
parentae69632b9c7f2faaa1006b2ae2f1df8e9d9758e3 (diff)
downloadfreebsd-ports-gnome-866c2d8e2d357cd39d63659572742f5591f60684.tar.gz
freebsd-ports-gnome-866c2d8e2d357cd39d63659572742f5591f60684.tar.zst
freebsd-ports-gnome-866c2d8e2d357cd39d63659572742f5591f60684.zip
Exec less rm(1) for existing files.
Reported by: mjg Approved by: portmgr (implicit)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Scripts/create-manifest.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/Mk/Scripts/create-manifest.sh b/Mk/Scripts/create-manifest.sh
index acc4ba75a239..25f9c999c636 100644
--- a/Mk/Scripts/create-manifest.sh
+++ b/Mk/Scripts/create-manifest.sh
@@ -89,11 +89,19 @@ fi
cp ${dp_DESCR} ${dp_METADIR}/+DESC
# Concatenate all the scripts
+output_files=
+for stage in INSTALL DEINSTALL UPGRADE; do
+ for prepost in '' PRE POST; do
+ output=${dp_METADIR}/+${prepost:+${prepost}_}${stage}
+ [ -f "${output}" ] && output_files="${output_files:+${output_files} }${output}"
+ done
+done
+[ -n "${output_files}" ] && rm -f ${output_files}
+
for stage in INSTALL DEINSTALL UPGRADE; do
for prepost in '' PRE POST; do
eval files="\${dp_PKG${prepost}${stage}}"
output=${dp_METADIR}/+${prepost:+${prepost}_}${stage}
- rm -f ${output}
for input in ${files}; do
[ -f "${input}" ] && cat ${input} >> ${output}
done