[lintian] 01/01: L::C::Package: Work around a bug
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 5bbad99f9cb953590ab5e35425e5f5cd3d895c03
Author: Niels Thykier <niels@thykier.net>
Date: Fri Sep 20 00:45:44 2013 +0200
L::C::Package: Work around a bug
After commit 6460c51d, I noticed that some tests (e.g.
deb-format-wrong-order) started to produce use of uninitialised
values.
It boiled down to $file->dirname being undef for the "usr/" entry
and strangely enough, only that entry seemed to trigger that problem.
Work around this problem by unconditionally and immediately set the
dirname of all entries again. We will replace it later to share the
varable and thereby save memory.
Signed-off-by: Niels Thykier <niels@thykier.net>
---
lib/Lintian/Collect/Package.pm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/Lintian/Collect/Package.pm b/lib/Lintian/Collect/Package.pm
index d601e76..0b42b54 100644
--- a/lib/Lintian/Collect/Package.pm
+++ b/lib/Lintian/Collect/Package.pm
@@ -381,7 +381,11 @@ sub _fetch_index_data {
$file{basename} = $base;
# Insert the dirname field later for all (non-root) entries as
# it allows us to better reuse memory.
- $file{dirname} = '' if $base eq '';
+ # - actually, insert the name now and then replace it later.
+ # This is a temporary work around for an ood behaviour seen
+ # under perl5.18 where the "usr/" for some reason does not
+ # have a "dirname" in the deb-format-wrong-order test.
+ $file{dirname} = $parent;
$children{$parent} = [] unless exists $children{$parent};
# Ensure the "root" is not its own child. It is not really helpful
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: