aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/Scripts
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2017-07-29 04:30:44 +0800
committerbdrewery <bdrewery@FreeBSD.org>2017-07-29 04:30:44 +0800
commit81a28eedd8bd3b439c80d153b058996d9ccb4aad (patch)
tree6c75abbcabc930d06218ffcd2552c9073ccdf14a /Mk/Scripts
parentb4b25b9011735793e3d5871d7026a3944b97705d (diff)
downloadfreebsd-ports-gnome-81a28eedd8bd3b439c80d153b058996d9ccb4aad.tar.gz
freebsd-ports-gnome-81a28eedd8bd3b439c80d153b058996d9ccb4aad.tar.zst
freebsd-ports-gnome-81a28eedd8bd3b439c80d153b058996d9ccb4aad.zip
Exec less rm(1) for existing files.
Reported by: mjg Approved by: portmgr (implicit)
Diffstat (limited to 'Mk/Scripts')
-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