summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThorsten Glaser <tg@mirbsd.org>2014-05-03 11:36:16 +0000
committerWaldemar Brodkorb <wbx@openadk.org>2014-05-03 14:33:12 +0200
commit8a0005b61300850e11fe19202ccd2118736ec661 (patch)
tree20cf79ad72c7895c5b55542da7e51d802fab7012 /scripts
parent0bb1dee8453d8d723263fe63c38781faf6cb2bc6 (diff)
pass patches NUL-terminated
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/update-patches11
-rw-r--r--scripts/update-patches22
2 files changed, 8 insertions, 5 deletions
diff --git a/scripts/update-patches b/scripts/update-patches
index b7e3d485d..1d13a3901 100644
--- a/scripts/update-patches
+++ b/scripts/update-patches
@@ -116,7 +116,7 @@ for file in $(cd ${WRKDIST}; find . -type f | sed 's#^\./##'); do
$(grep -c "^+++ $D_CMP" "$i") -gt 1 ]]; then
print -ru2 -- "Cannot process, $i contains patches"
print -ru2 -- "to multiple files! Aborting."
- echo FAIL
+ print -n 'FAIL\0'
[[ -n $SUBDIST ]] && mv \
"${WRKDIR1}/${SUBDIST}.orig" \
"${WRKDIR1}.orig/${SUBDIST}"
@@ -137,7 +137,7 @@ for file in $(cd ${WRKDIST}; find . -type f | sed 's#^\./##'); do
print -ru2 -- "Cannot process, file $file"
print -ru2 -- "is contained in multiple patches:"
print -ru2 -- "$pflst"
- echo FAIL
+ print -n 'FAIL\0'
[[ -n $SUBDIST ]] && mv \
"${WRKDIR1}/${SUBDIST}.orig" \
"${WRKDIR1}.orig/${SUBDIST}"
@@ -150,7 +150,7 @@ for file in $(cd ${WRKDIST}; find . -type f | sed 's#^\./##'); do
( sed -e "/^--- /,\$d" <"$i"; \
cd "$D_BASE" && do_diff "$file" "$D_SUB.orig" "$D_SUB" \
) >"$i.new"
- # did it change ? mark it as changed
+ # did it change? mark it as changed
tfile=$(print -r -- "$file" | $TRANSFORM)
if eval diff "$(print -r -- "${DIFF_FLAGS}" | sed \
"s#@@#${tfile}#g")" "$i" "$i.new" 1>&2; then
@@ -188,6 +188,9 @@ for i in *; do
(( found )) || print -ru2 -- "*** Patch $i not accounted for"
done
-print -r -- "${edit[@]}"
+for i in "${edit[@]}"; do
+ print -nr -- "$i"
+ print -n '\0'
+done
[[ -n $SUBDIST ]] && mv "${WRKDIR1}/${SUBDIST}.orig" "${WRKDIR1}.orig/${SUBDIST}"
exit 0
diff --git a/scripts/update-patches2 b/scripts/update-patches2
index 8f8711af7..2b8349bcf 100644
--- a/scripts/update-patches2
+++ b/scripts/update-patches2
@@ -25,7 +25,7 @@ export CURDIR PATCH_LIST
mksh "${TOPDIR}"/scripts/update-patches |&
first=1
set -A toedit
-while IFS= read -p -r; do
+while IFS= read -p -d '' -r; do
if (( first )); then
if [[ $REPLY = FAIL ]]; then
rm -rf "${WRKDIR1}.orig"