Просмотр исходного кода

Do not set the Arch substvar in dpkg-source

Avoid setting the variable by default as it is expensive, and not
really needed for dpkg-source anyway. Split the setting into a new
member set_arch_substvars().

Regression introduced in 120ecd5161f4cf468d611b3dea05ac8a43313a75.

Closes: #526132
Guillem Jover лет назад: 17
Родитель
Сommit
2b125e6ed9
4 измененных файлов с 18 добавлено и 3 удалено
  1. 2 0
      debian/changelog
  2. 14 3
      scripts/Dpkg/Substvars.pm
  3. 1 0
      scripts/dpkg-genchanges.pl
  4. 1 0
      scripts/dpkg-gencontrol.pl

+ 2 - 0
debian/changelog

@@ -88,6 +88,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
     have been disabled from configure.
   * Move Debian specific keyrings to the Debian vendor class and change the
     Ubuntu vendor class to inherit from it.
+  * Do not set the Arch substvar in dpkg-source, avoiding generating warnings
+    when there's no compiler present. Closes: #526132
 
   [ Frank Lichtenheld ]
   * Dpkg::Version: Remove unnecessary function next_elem which just

+ 14 - 3
scripts/Dpkg/Substvars.pm

@@ -45,8 +45,8 @@ strings.
 =item my $s = Dpkg::Substvars->new($file)
 
 Create a new object that can do substitutions. By default it contains
-generic substitutions like ${Newline}, ${Space}, ${Tab}, ${dpkg:Version},
-${dpkg:Upstream-Version} and ${Arch}.
+generic substitutions like ${Newline}, ${Space}, ${Tab}, ${dpkg:Version}
+and ${dpkg:Upstream-Version}.
 
 Additional substitutions will be read from the $file passed as parameter.
 
@@ -60,7 +60,6 @@ sub new {
 	"Tab" => "\t",
 	"dpkg:Version" => $version,
 	"dpkg:Upstream-Version" => $version,
-	"Arch" => get_host_arch(),
     };
     $self->{'dpkg:Upstream-Version'} =~ s/-[^-]+$//;
     bless $self, $class;
@@ -143,6 +142,18 @@ sub set_version_substvars {
     $self->{'Source-Version'} = $version;
 }
 
+=item $s->set_arch_substvars()
+
+Defines architecture variables: ${Arch}.
+
+=cut
+
+sub set_arch_substvars {
+    my ($self) = @_;
+
+    $self->{'Arch'} = get_host_arch();
+}
+
 =item $newstring = $s->substvars($string)
 
 Substitutes variables in $string and return the result in $newstring.

+ 1 - 0
scripts/dpkg-genchanges.pl

@@ -206,6 +206,7 @@ $bad_parser = 1 if ($@);
 my $control = Dpkg::Control->new($controlfile);
 my $fields = Dpkg::Fields::Object->new();
 $substvars->set_version_substvars($changelog->{"Version"});
+$substvars->set_arch_substvars();
 $substvars->parse($varlistfile) if -e $varlistfile;
 
 if (defined($prev_changelog) and

+ 1 - 0
scripts/dpkg-gencontrol.pl

@@ -126,6 +126,7 @@ my %options = (file => $changelogfile);
 $options{"changelogformat"} = $changelogformat if $changelogformat;
 my $changelog = parse_changelog(%options);
 $substvars->set_version_substvars($changelog->{"Version"});
+$substvars->set_arch_substvars();
 $substvars->parse($varlistfile) if -e $varlistfile;
 $substvars->set("binary:Version", $forceversion) if defined $forceversion;
 my $control = Dpkg::Control->new($controlfile);