SHA256
1
0
forked from pool/quilt
quilt/quilt-setup-05-fix-check_for_existing_files.patch
Jean Delvare 545a92cf89 - quilt-setup-04-handle-zip-files.patch: Refresh from upstream.
- quilt-setup-05-fix-check_for_existing_files.patch: Fix handling
  of directory names including white spaces by
  check_for_existing_files.
- quilt-setup-06-check-for-directories-too.patch: Check for
  existing directories before unpacking.

OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=63
2012-10-19 09:18:16 +00:00

38 lines
921 B
Diff

Fix handling of directory names including white spaces by
check_for_existing_files. awk can't deal with tokens which include
white spaces, so use bash's read function instead.
As a side bonus, we get rid of the undocumented dependency to "uniq".
---
quilt/setup.in | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -23,9 +23,12 @@ then
fi
check_for_existing_files() {
- local dir status=0
- for dir in $(awk ' $1 == "patch" { print $2 }' $tmpfile | uniq)
+ local tag dir last_dir arg status=0
+
+ while read tag dir arg
do
+ [ "$tag" = "patch" -a "$dir" != "$last_dir" ] || continue
+
if [ -e "$prefix$dir/$QUILT_PATCHES" ]
then
printf $"Directory %s exists\n" \
@@ -38,7 +41,9 @@ check_for_existing_files() {
"$prefix$dir/$QUILT_SERIES" >&2
status=1
fi
- done
+ last_dir=$dir
+ done < $tmpfile
+
return $status
}