diff options
author | Jean Delvare <jdelvare@suse.de> | 2012-10-25 17:42:46 +0200 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2012-10-25 17:42:46 +0200 |
commit | e7fa08b805942be26bbce1d3f93e5a3729a95ac0 (patch) | |
tree | 83526437f5b73892ed87bd3056c03e4cfbee4877 | |
parent | 1f6fbf64d20d0d0b5dc04fa3f63f764e8c3a32ea (diff) | |
download | quilt-e7fa08b805942be26bbce1d3f93e5a3729a95ac0.tar.gz |
setup: Fix white space handling by check_for_existing_files
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".
-rw-r--r-- | quilt.changes | 1 | ||||
-rw-r--r-- | quilt/setup.in | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/quilt.changes b/quilt.changes index e9401b7..2a9f980 100644 --- a/quilt.changes +++ b/quilt.changes @@ -5,6 +5,7 @@ Thu Oct 25 15:05:42 CEST 2012 - jdelvare@suse.de - setup: Try alternative patches/series names. - setup: Run create_db(). - setup/inspect: Handle zip archives. +- setup: Fix white space handling by check_for_existing_files. ------------------------------------------------------------------- Thu Oct 25 15:05:10 CEST 2012 - jdelvare@suse.de diff --git a/quilt/setup.in b/quilt/setup.in index 6714e60..055e2dd 100644 --- 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 } |