# need an extra cache for speed here.
return () unless defined $gBinarySourceMap;
+ if ($binname =~ m/^src:(.+)$/) {
+ return $1;
+ }
if (not tied %_binarytosource) {
tie %_binarytosource, MLDBM => $gBinarySourceMap, O_RDONLY or
die "Unable to open $gBinarySourceMap for reading";
elsif (exists $binary{$binver}) {
if (defined $binarch) {
my $src = $binary{$binver}{$binarch};
+ if (not defined $src and exists $binary{$binver}{all}) {
+ $src = $binary{$binver}{all};
+ }
return () unless defined $src; # not on this arch
# Copy the data to avoid tiedness problems.
return dclone($src);
# avoid autovivification
my $source = $_sourcetobinary{$srcname};
return () unless defined $source;
- my %source = %{$source};
- if (exists $source{$srcver}) {
- my $bin = $source{$srcver};
+ if (exists $source->{$srcver}) {
+ my $bin = $source->{$srcver};
return () unless defined $bin;
return @$bin;
}
for my $arch (exists $param{arch}?
make_list($param{arch}):
(grep {not $param{no_source_arch} or
- $_ ne 'source'
- } keys %{$version->{$dist}})) {
+ $_ ne 'source'
+ } keys %{$version->{$dist}})) {
next unless defined $version->{$dist}{$arch};
for my $ver (ref $version->{$dist}{$arch} ?
keys %{$version->{$dist}{$arch}} :
my %param = validate_with(params => \@_,
spec => {package => {type => SCALAR|ARRAYREF,
},
- arch => {type => SCALAR|ARRAYREF,
+ arch => {type => SCALAR|ARRAYREF|UNDEF,
default => ''
},
versions => {type => SCALAR|ARRAYREF,
my ($warnings) = globify_scalar(exists $param{warnings}?$param{warnings}:undef);
my ($debug) = globify_scalar(exists $param{debug} ?$param{debug} :undef);
-
my @packages = grep {defined $_ and length $_ } make_list($param{package});
- my @archs = grep {defined $_ } make_list ($param{archs});
+ my @archs = grep {defined $_ } make_list ($param{arch});
if (not @archs) {
push @archs, '';
}
}
elsif ($param{guess_source} and
exists$param{source_version_cache}{$cachekey.'/guess'}) {
- for my $v (@{$param{source_version_cache}{$cachekey}}) {
+ for my $v (@{$param{source_version_cache}{$cachekey.'/guess'}}) {
$sourceversions{$v} = 1;
}
next;