aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2022-12-14 05:05:30 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2022-12-14 05:11:01 +0000
commitf0191973eadf9d52e3c32d5f430fa4f2d083fde6 (patch)
tree80b8634c25ebdde62ebf20552269f017b1d28b1c
parent439bd29bbfcfa7485d85956c40bd7cc8ab38c938 (diff)
downloadports-f0191973eadf9d52e3c32d5f430fa4f2d083fde6.tar.gz
ports-f0191973eadf9d52e3c32d5f430fa4f2d083fde6.zip
Mk/Scripts: Fix potential error creating .metadir/+DESC
In some builds it could be possible that pkg-descr is not writable. We could either install -m 0644 the file over or just let sh create it. This change also opens the destination file only once now. Fixes: ddd0e820c
-rw-r--r--Mk/Scripts/create-manifest.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/Mk/Scripts/create-manifest.sh b/Mk/Scripts/create-manifest.sh
index 2f68f0e9d436..c6d0ef559195 100644
--- a/Mk/Scripts/create-manifest.sh
+++ b/Mk/Scripts/create-manifest.sh
@@ -86,13 +86,15 @@ if [ -n "${dp_PKG_NOTES}" ]; then
fi
# Copy the pkg-descr file
-cp ${dp_DESCR} ${dp_METADIR}/+DESC
-if [ -n "${dp_WWW}" ] && ! grep -q '^WWW: ' ${dp_DESCR}; then
- echo >> ${dp_METADIR}/+DESC
- for www in ${dp_WWW}; do
- echo "WWW: ${www}" >> ${dp_METADIR}/+DESC
- done
-fi
+{
+ cat ${dp_DESCR}
+ if [ -n "${dp_WWW}" ] && ! grep -q '^WWW: ' ${dp_DESCR}; then
+ echo
+ for www in ${dp_WWW}; do
+ echo "WWW: ${www}"
+ done
+ fi
+} > ${dp_METADIR}/+DESC
# Concatenate all the scripts
output_files=