Subject: | Mysterious interaction with URPM |
Run the following testcase on any hdlist.cz file (rpm package headers
list, found on any mandriva packages mirror, such as
ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandriva/free/src/hdlist.cz),
and any empty configuration file: first header will automatically get
undefined, and an exception get thrown.
Curiously:
- using individual rpms instead of hdlist doesn't trigger the problem
- localising $_ before parsing the config file workaround the problem
Subject: | testcase.pl |
#!/usr/bin/perl
use URPM;
use AppConfig;
my $hdlist = shift || die "usage: $0 hdlist.cz file.conf";
my $file = shift || die "usage: $0 hdlist.cz file.conf";
my $urpm = URPM->new();
$urpm->parse_hdlist($hdlist);
my $config = AppConfig->new();
$urpm->traverse(sub {
$config->file($file);
print $_[0]->name() . "\n";
});