Переглянути джерело

Dpkg::Compression: Deprecate default compression variables

Mark $default_compression and $default_compression_level as deprecated
to be removed on VERSION 2.00.

Addresses Variables::ProhibitPackageVars.

Warned-by: perlcritic
Guillem Jover 13 роки тому
батько
коміт
b8e79194cb
2 змінених файлів з 17 додано та 1 видалено
  1. 3 0
      debian/changelog
  2. 14 1
      scripts/Dpkg/Compression.pm

+ 3 - 0
debian/changelog

@@ -89,6 +89,9 @@ dpkg (1.17.2) UNRELEASED; urgency=low
     values in libintl.
   * Set a default gettext domain for libdpkg code, so that other programs
     using a different domain can still get correct translations, like dselect.
+  * Cleanup libdpkg-perl API:
+    - Dpkg::Compression: Deprecate $default_compression_level,
+      $default_compression package variables.
 
   [ Updated programs translations ]
   * German (Sven Joachim).

+ 14 - 1
scripts/Dpkg/Compression.pm

@@ -18,7 +18,7 @@ package Dpkg::Compression;
 use strict;
 use warnings;
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
@@ -76,8 +76,11 @@ my $COMP = {
     },
 };
 
+# XXX: Backwards compatibility, stop exporting on VERSION 2.00.
+## no critic (Variables::ProhibitPackageVars)
 our $default_compression = 'gzip';
 our $default_compression_level = undef;
+## use critic
 
 =item $compression_re_file_ext
 
@@ -219,6 +222,16 @@ sub compression_is_valid_level {
 
 =back
 
+=head1 CHANGES
+
+=head2 Version 1.02
+
+Deprecated variables: $default_compression, $default_compression_level
+
+=head2 Version 1.01
+
+Default compression level is not global any more, it is per compressor type.
+
 =head1 AUTHOR
 
 Raphaël Hertzog <hertzog@debian.org>.