diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-09-06 17:39:13 +0000 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2005-09-06 17:39:13 +0000 |
commit | 48b6905c825412f2064339254744b1dfc1955f23 (patch) | |
tree | eb3839420036f3de810432a0d52990688fc7dc35 /scripts | |
parent | e33703fab91eb7cb981d6685aed735f4252e71bc (diff) | |
download | quilt-48b6905c825412f2064339254744b1dfc1955f23.tar.gz |
- scripts/patchfns.in: Rewrite files_in_patch_ordered() so as to not
require the awk asort function, which is not available on all versions
of awk.
- test/sort.test: Add more files to better test the ordering and sorting
issues. Original patch by John Vandenberg.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/patchfns.in | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/scripts/patchfns.in b/scripts/patchfns.in index e75e365..98f5c51 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -492,28 +492,22 @@ files_in_patch_ordered() { local patch=$1 - ( files_in_patch $patch + ( files_in_patch $patch | sort echo "-" filenames_in_patch $patch ) | @AWK@ ' $1 == "-" { out=1 ; next } - !out { files[$0]=1 } + !out { files[$0]=1 + new_files[++n]=$0 } out { if ($0 in files && !($0 in printed)) { print $0 printed[$0]=1 } } END { - i = 1 - for (file in files) { - if (!(file in printed)) { - new_files[i]=file - i++ - } - } - n = asort(new_files) for (i=1; i<=n; i++) - print new_files[i] + if (!(new_files[i] in printed)) + print new_files[i] } ' } |