}
# avoid autovivification
my $bin = $_binarytosource{$binary};
+ next unless defined $bin;
if (not @versions) {
- next unless defined $bin;
for my $ver (keys %{$bin}) {
for my $ar (keys %{$bin->{$ver}}) {
my $src = $bin->{$ver}{$ar};
tie %_sourcetobinary, MLDBM => $config{source_binary_map}, O_RDONLY or
die "Unable top open $gSourceBinaryMap for reading";
}
- for my $maybe_sourcepkg (@binary) {
+ for my $maybe_sourcepkg (@binaries) {
if (exists $_sourcetobinary{$maybe_sourcepkg}) {
push @source,[$maybe_sourcepkg,$_] for keys %{$_sourcetobinary{$maybe_sourcepkg}};
}
if ($param{source_only}) {
my %uniq;
for my $s (@source) {
+ # we shouldn't need to do this, but do this temporarily to
+ # stop the warning.
+ next unless defined $s->[0];
$uniq{$s->[0]} = 1;
}
@result = sort keys %uniq;
}
my %versions;
for my $package (make_list($param{package})) {
+ my $source_only = 0;
+ if ($package =~ s/^src://) {
+ $source_only = 1;
+ }
my $version = $versions->{$package};
next unless defined $version;
for my $dist (make_list($param{dist})) {
make_list($param{arch}):
(grep {not $param{no_source_arch} or
$_ ne 'source'
- } keys %{$version->{$dist}})) {
+ } $source_only?'source':keys %{$version->{$dist}})) {
next unless defined $version->{$dist}{$arch};
for my $ver (ref $version->{$dist}{$arch} ?
keys %{$version->{$dist}{$arch}} :
}
my @srcinfo = binary_to_source(binary => $pkg,
version => $version,
- arch => $arch);
+ length($arch)?(arch => $arch):());
if (not @srcinfo) {
# We don't have explicit information about the
# binary-to-source mapping for this version