diff options
author | Jean Delvare <jdelvare@suse.de> | 2014-07-23 09:54:25 +0200 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2014-07-23 09:54:25 +0200 |
commit | 054f2f0dc232f3609c2566ab4ce98595c5991065 (patch) | |
tree | 79fd7fc621c959db6ab0cd178cd6dba9dae249e6 | |
parent | d7b1e362b2e8b9b2c547ace938fc5a701d755023 (diff) | |
download | quilt-054f2f0dc232f3609c2566ab4ce98595c5991065.tar.gz |
filenames_in_patch: Print each file only once
Filter out duplicates in filenames_in_patch so that callers don't
have to deal with them.
-rw-r--r-- | quilt/scripts/patchfns.in | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index a2ff480..4b5b6e5 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -662,7 +662,8 @@ filenames_in_patch() next for (n=0 ; n<'$strip'; n++) sub(/^[^\/]+\//, "") - print $0 }' $patch_file + if (!printed[$0]++) + print $0 }' $patch_file fi } @@ -677,7 +678,7 @@ files_in_patch_ordered() $1 == "-" { out=1 ; next } !out { files[$0]=1 new_files[++n]=$0 } - out { if ($0 in files && !($0 in printed)) { + out { if ($0 in files) { print $0 printed[$0]=1 } |