diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Dpkg/Control/Info.pm | 6 | ||||
-rwxr-xr-x | scripts/dpkg-source.pl | 5 | ||||
-rw-r--r-- | scripts/t/700_Dpkg_Control.t | 4 | ||||
-rw-r--r-- | scripts/t/700_Dpkg_Control/control-1 | 3 |
4 files changed, 17 insertions, 1 deletions
diff --git a/scripts/Dpkg/Control/Info.pm b/scripts/Dpkg/Control/Info.pm index 556c531c8..d7ec187a1 100644 --- a/scripts/Dpkg/Control/Info.pm +++ b/scripts/Dpkg/Control/Info.pm @@ -107,8 +107,12 @@ sub parse { last if not $cdata->parse($fh, $desc); push @{$self->{packages}}, $cdata; unless (exists $cdata->{Package}) { - syntaxerr($desc, _g("block lacks a package field")); + syntaxerr($desc, _g("block lacks the '%s' field"), "Package"); } + unless (exists $cdata->{Architecture}) { + syntaxerr($desc, _g("block lacks the '%s' field"), "Architecture"); + } + } } diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 8d2380642..209368f29 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -223,6 +223,8 @@ if ($options{'opmode'} =~ /^(-b|--print-format|--(before|after)-build)$/) { # Scan control info of source package my $src_fields = $control->get_source(); + error(_g("%s doesn't contain any information about the source package"), + $controlfile) unless defined $src_fields; my $src_sect = $src_fields->{'Section'} || "unknown"; my $src_prio = $src_fields->{'Priority'} || "unknown"; foreach $_ (keys %{$src_fields}) { @@ -283,6 +285,9 @@ if ($options{'opmode'} =~ /^(-b|--print-format|--(before|after)-build)$/) { } } } + unless (scalar(@pkglist)) { + error(_g("%s doesn't list any binary package"), $controlfile); + } if (grep($_ eq 'any', @sourcearch)) { # If we encounter one 'any' then the other arches become insignificant # except for 'all' that must also be kept diff --git a/scripts/t/700_Dpkg_Control.t b/scripts/t/700_Dpkg_Control.t index 09dcffc5f..fbdc99711 100644 --- a/scripts/t/700_Dpkg_Control.t +++ b/scripts/t/700_Dpkg_Control.t @@ -41,12 +41,15 @@ Long-Field: line1 Empty-Field: Package: mypackage1 +Architecture: any Depends: libc6 Package: mypackage2 +Architecture: all Depends: hello Package: mypackage3 +Architecture: all Depends: hello Description: short one long one @@ -80,5 +83,6 @@ $pkg->output($io); is(${$io->string_ref()}, 'Package: mypackage2 +Architecture: all Depends: hello ', "Dump of second binary package of $datadir/control-1"); diff --git a/scripts/t/700_Dpkg_Control/control-1 b/scripts/t/700_Dpkg_Control/control-1 index 8b320339d..85bdbb555 100644 --- a/scripts/t/700_Dpkg_Control/control-1 +++ b/scripts/t/700_Dpkg_Control/control-1 @@ -12,13 +12,16 @@ empty-field: # First package Package: mypackage1 +Architecture: any Depends: libc6 # Second package Package: mypackage2 +Architecture: all Depends: hello Package: mypackage3 +Architecture: all Depends:hello Description: short one long one |