File quilt-setup-05-fix-check_for_existing_files.patch of Package quilt
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
}