summaryrefslogtreecommitdiff
path: root/scripts/Dpkg
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2009-11-29 17:02:08 +0100
committerRaphaël Hertzog <hertzog@debian.org>2009-11-29 17:02:08 +0100
commit0fc211581b9bfbc2b1575d4bd79fa06fc30d6083 (patch)
tree31ed6a7c8e2918fa4c1d7d00bc1deb63e61cbec4 /scripts/Dpkg
parentabf378780102adedb7d13f4d36a1641d8856499e (diff)
parentb6a2926a1670d28583ad38c43981fb2f425057de (diff)
downloaddpkg-0fc211581b9bfbc2b1575d4bd79fa06fc30d6083.tar.gz
Merge sid branch through commit '1.15.5.3'
Conflicts: man/po/de.po man/po/sv.po scripts/dpkg-scanpackages.pl scripts/po/de.po scripts/po/sv.po
Diffstat (limited to 'scripts/Dpkg')
-rw-r--r--scripts/Dpkg/Changelog/Entry/Debian.pm1
-rw-r--r--scripts/Dpkg/Control/Hash.pm5
-rw-r--r--scripts/Dpkg/IPC.pm8
-rw-r--r--scripts/Dpkg/Source/Package/V2.pm4
-rw-r--r--scripts/Dpkg/Source/Package/V3/quilt.pm24
5 files changed, 38 insertions, 4 deletions
diff --git a/scripts/Dpkg/Changelog/Entry/Debian.pm b/scripts/Dpkg/Changelog/Entry/Debian.pm
index 9399888e8..ccaf5046c 100644
--- a/scripts/Dpkg/Changelog/Entry/Debian.pm
+++ b/scripts/Dpkg/Changelog/Entry/Debian.pm
@@ -25,6 +25,7 @@ our @EXPORT_OK = qw($regex_header $regex_trailer find_closes);
use Date::Parse;
+use Dpkg::Gettext;
use Dpkg::Control::Changelog;
use Dpkg::Version;
diff --git a/scripts/Dpkg/Control/Hash.pm b/scripts/Dpkg/Control/Hash.pm
index afb177b7e..75fbc8957 100644
--- a/scripts/Dpkg/Control/Hash.pm
+++ b/scripts/Dpkg/Control/Hash.pm
@@ -52,6 +52,9 @@ unchanged directly after the field name, supplementary lines are
modified. Empty lines and lines containing only dots are prefixed with
" ." (space + dot) while other lines are prefixed with a single space.
+During parsing, trailing spaces are stripped on all lines while leading
+spaces are stripped only on the first line of each field.
+
=head1 FUNCTIONS
=over 4
@@ -168,7 +171,7 @@ sub parse_fh {
next if (m/^$/ and $paraborder);
next if (m/^#/);
$paraborder = 0;
- if (m/^(\S+?)\s*:\s?(.*)$/) {
+ if (m/^(\S+?)\s*:\s*(.*)$/) {
if (exists $self->{$1}) {
unless ($$self->{'allow_duplicate'}) {
syntaxerr($desc, sprintf(_g("duplicate field %s found"), $1));
diff --git a/scripts/Dpkg/IPC.pm b/scripts/Dpkg/IPC.pm
index 4302ffa92..116051d32 100644
--- a/scripts/Dpkg/IPC.pm
+++ b/scripts/Dpkg/IPC.pm
@@ -278,8 +278,14 @@ sub fork_and_exec {
${$opts{"error_to_string"}} = readline($error_to_string_pipe);
}
if ($opts{"wait_child"}) {
+ my $cmdline = "@prog";
+ if ($opts{"env"}) {
+ foreach (keys %{$opts{"env"}}) {
+ $cmdline = "$_=\"" . $opts{"env"}{$_} . "\" $cmdline";
+ }
+ }
wait_child($pid, nocheck => $opts{"nocheck"},
- timeout => $opts{"timeout"}, cmdline => "@prog");
+ timeout => $opts{"timeout"}, cmdline => $cmdline);
return 1;
}
diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm
index e1874cb2d..6757795c3 100644
--- a/scripts/Dpkg/Source/Package/V2.pm
+++ b/scripts/Dpkg/Source/Package/V2.pm
@@ -248,6 +248,10 @@ sub do_build {
my @origtarballs;
foreach (sort $self->find_original_tarballs()) {
if (/\.orig\.tar\.$comp_regex$/) {
+ if (defined($tarfile)) {
+ error(_g("several orig.tar files found (%s and %s) but only " .
+ "one is allowed"), $tarfile, $_);
+ }
$tarfile = $_;
push @origtarballs, $_;
$self->add_file($_);
diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm
index 2400c96fa..ca527c193 100644
--- a/scripts/Dpkg/Source/Package/V3/quilt.pm
+++ b/scripts/Dpkg/Source/Package/V3/quilt.pm
@@ -55,6 +55,24 @@ sub parse_cmdline_option {
return 0;
}
+sub can_build {
+ my ($self, $dir) = @_;
+ my ($code, $msg) = $self->SUPER::can_build($dir);
+ return ($code, $msg) if $code eq 0;
+ my $pd = File::Spec->catdir($dir, "debian", "patches");
+ if (-e $pd and not -d _) {
+ return (0, sprintf(_g("%s should be a directory or non-existing"), $pd));
+ }
+ my $series_vendor = $self->get_series_file($dir);
+ my $series_main = File::Spec->catfile($pd, "series");
+ foreach my $series ($series_vendor, $series_main) {
+ if (defined($series) and -e $series and not -f _) {
+ return (0, sprintf(_g("%s should be a file or non-existing"), $series));
+ }
+ }
+ return (1, "");
+}
+
sub get_autopatch_name {
my ($self) = @_;
return "debian-changes-" . $self->{'fields'}{'Version'};
@@ -114,7 +132,10 @@ sub run_quilt {
}
my %opts = (
env => { QUILT_PATCHES => "$absdir/debian/patches",
- QUILT_SERIES => $series },
+ QUILT_SERIES => $series,
+ # Kept as close as possible to default patch options in
+ # Dpkg::Source::Patch (used in without_quilt mode)
+ QUILT_PATCH_OPTS => "-t -F 0 -N -u -V never -g0" },
'chdir' => $dir,
'exec' => [ 'quilt', '--quiltrc', '/dev/null', @$params ],
%more_opts
@@ -169,7 +190,6 @@ sub apply_patches {
$opts{"to_file"} = "/dev/null" if $skip_auto;
info(_g("applying all patches with %s"), "quilt push -q " . $patches[-1]) unless $skip_auto;
$self->run_quilt($dir, ['push', '-q', $patches[-1]],
- delete_env => ['QUILT_PATCH_OPTS'],
wait_child => 1, %opts);
foreach my $patch (@patches) {
foreach my $fn (keys %{$panalysis->{$patch}->{'filepatched'}}) {