summaryrefslogtreecommitdiff
path: root/src/filters.c
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-09-23 08:53:02 +0200
committerGuillem Jover <guillem@debian.org>2012-10-05 00:59:18 +0200
commite9ea356ab8ab442420cea887d4734b0b8022ea12 (patch)
tree74143ef47833520703944e7266dbe814bdca1cc0 /src/filters.c
parentcaac19a3df7686db5907db3d8d6472855536442b (diff)
downloaddpkg-e9ea356ab8ab442420cea887d4734b0b8022ea12.tar.gz
dpkg: Ignore trailing filter subpattern slashes on reinclusion comparison
The code was not matching directories on subpatterns due to trailing slashes, which was causing unpack failures as the containing subdirectories were not being unpacked and as such, they were subsequently missing from the file system. While unpacking a «/usr/share/locale/de/LC_MESSAGES/foo.mo» file, for example, something like the following options would trigger this problem: --path-exclude=/usr/share/locale/* --path-include=/usr/share/locale/de/* Closes: #688416
Diffstat (limited to 'src/filters.c')
-rw-r--r--src/filters.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/filters.c b/src/filters.c
index 526673dad..1bde97cf3 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -114,6 +114,10 @@ filter_should_skip(struct tar_entry *ti)
else
path_len = strlen(f->pattern);
+ /* Ignore any trailing slash for the comparison. */
+ while (path_len && f->pattern[path_len - 1] == '/')
+ path_len--;
+
debug(dbg_eachfiledetail,
"filter subpattern '%.*s'", path_len, f->pattern);