use Debbugs::Common qw(:util :lock :quit :misc);
use Debbugs::Config qw(:config);
use Debbugs::MIME qw(decode_rfc1522 encode_rfc1522);
-use Debbugs::Packages qw(makesourceversions make_source_versions getversions get_versions binarytosource);
+use Debbugs::Packages qw(makesourceversions make_source_versions getversions get_versions binary_to_source);
use Debbugs::Versions;
use Debbugs::Versions::Dpkg;
use POSIX qw(ceil);
for my $line (@lines) {
if ($line =~ /(\S+?): (.*)/) {
my ($name, $value) = (lc $1, $2);
- $data{$namemap{$name}} = $value if exists $namemap{$name};
+ # this is a bit of a hack; we should never, ever have \r
+ # or \n in the fields of status. Kill them off here.
+ # [Eventually, this should be superfluous.]
+ $value =~ s/[\r\n]//g;
+ $data{$namemap{$name}} = $value if exists $namemap{$name};
}
}
for my $field (keys %fields) {
}
}
+ # this is a bit of a hack; we should never, ever have \r or \n in
+ # the fields of status. Kill them off here. [Eventually, this
+ # should be superfluous.]
+ for my $field (keys %newdata) {
+ $newdata{$field} =~ s/[\r\n]//g if defined $newdata{$field};
+ }
+
if ($version == 1) {
for my $field (@v1fieldorder) {
if (exists $newdata{$field} and defined $newdata{$field}) {
addfoundversions($status,$package,$version,$isbinary);
-
+All use of this should be phased out in favor of Debbugs::Control::fixed/found
=cut
return unless defined $version;
undef $package if $package =~ m[(?:\s|/)];
my $source = $package;
+ if ($package =~ s/^src://) {
+ $isbinary = 0;
+ $source = $package;
+ }
if (defined $package and $isbinary) {
- my @srcinfo = binarytosource($package, $version, undef);
+ my @srcinfo = binary_to_source(binary => $package,
+ version => $version);
if (@srcinfo) {
# We know the source package(s). Use a fully-qualified version.
addfoundversions($data, $_->[0], $_->[1], '') foreach @srcinfo;
my $source = $package;
if (defined $package and $isbinary) {
- my @srcinfo = binarytosource($package, $version, undef);
+ my @srcinfo = binary_to_source(binary => $package,
+ version => $version);
if (@srcinfo) {
# We know the source package(s). Use a fully-qualified version.
addfixedversions($data, $_->[0], $_->[1], '') foreach @srcinfo;
$status{package} = '' if not defined $status{package};
$status{"package"} =~ s/\s*$//;
- # if we aren't supposed to indicate the source, we'll return
- # unknown here.
- $status{source} = 'unknown';
- if ($param{indicatesource}) {
- my @packages = split /\s*,\s*/, $status{package};
- my @source;
- for my $package (@packages) {
- next if $package eq '';
- if ($package =~ /^src\:(.+)$/) {
- push @source,$1;
- }
- else {
- push @source, binarytosource($package);
- }
- }
- if (@source) {
- $status{source} = join(', ',@source);
- }
- }
+
+ $status{source} = binary_to_source(binary=>[split /\s*,\s*/, $status{package}],
+ source_only => 1,
+ );
$status{"package"} = 'unknown' if ($status{"package"} eq '');
$status{"severity"} = 'normal' if (not defined $status{severity} or $status{"severity"} eq '');