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

Dpkg::Source::Package: Always pass compression_level explicitly

When creating a Dpkg::Source::Archive or a Dpkg::Source::Patch, always
be explicit about the compression level instead of relying on the global
default level.
Guillem Jover лет назад: 12
Родитель
Сommit
f6b8ce21be
2 измененных файлов с 6 добавлено и 3 удалено
  1. 2 1
      scripts/Dpkg/Source/Package/V1.pm
  2. 4 2
      scripts/Dpkg/Source/Package/V2.pm

+ 2 - 1
scripts/Dpkg/Source/Package/V1.pm

@@ -354,7 +354,8 @@ sub do_build {
 					DIR => getcwd(), UNLINK => 0);
         push_exit_handler(sub { unlink($newdiffgz) });
         my $diff = Dpkg::Source::Patch->new(filename => $newdiffgz,
-                                            compression => 'gzip');
+                                            compression => 'gzip',
+                                            compression_level => $self->{options}{comp_level});
         $diff->create();
         $diff->add_diff_directory($origdir, $dir,
                 basedirname => $basedirname,

+ 4 - 2
scripts/Dpkg/Source/Package/V2.pm

@@ -309,7 +309,8 @@ sub prepare_build {
         # No main orig.tar, create a dummy one
         my $filename = $self->get_basename() . '.orig.tar.' .
                        $self->{options}{comp_ext};
-        my $tar = Dpkg::Source::Archive->new(filename => $filename);
+        my $tar = Dpkg::Source::Archive->new(filename => $filename,
+                                             compression_level => $self->{options}{comp_level});
         $tar->create();
         $tar->finish();
     }
@@ -531,7 +532,8 @@ sub do_build {
     # Create the debian.tar
     my $debianfile = "$basenamerev.debian.tar." . $self->{options}{comp_ext};
     info(_g('building %s in %s'), $sourcepackage, $debianfile);
-    my $tar = Dpkg::Source::Archive->new(filename => $debianfile);
+    my $tar = Dpkg::Source::Archive->new(filename => $debianfile,
+                                         compression_level => $self->{options}{comp_level});
     $tar->create(options => \@tar_ignore, chdir => $dir);
     $tar->add_directory('debian');
     foreach my $binary ($binaryfiles->get_seen_binaries()) {