From d1f3ebf6734301d372e072f1ab3412b41df18edb Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 29 Dec 2007 06:17:29 +0100 Subject: [PATCH] Dpkg::Compression: New module with compression variables from Dpkg --- ChangeLog | 12 ++++++++++++ debian/changelog | 3 +++ debian/dpkg-dev.install | 1 + scripts/Dpkg.pm | 9 --------- scripts/Dpkg/Compression.pm | 14 ++++++++++++++ scripts/Makefile.am | 1 + scripts/dpkg-genchanges.pl | 3 ++- scripts/dpkg-source.pl | 3 ++- 8 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 scripts/Dpkg/Compression.pm diff --git a/ChangeLog b/ChangeLog index 2da18865..1c2dd709 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-12-27 Guillem Jover + + * scripts/Dpkg.pm (%EXPORT_TAGS, @EXPORT_OK): Remove. + (@comp_supported, %comp_supported, %comp_ext, $comp_regex): Move + variables ... + * scripts/Dpkg/Compression.pm: ... here. New file. + * scripts/dpkg-genchanges.pl: Use new module Dpkg::Compression + instead of tag from Dpkg. + * scripts/dpkg-source.pl: Likewise + * scripts/Makefile.am (nobase_dist_perllib_DATA): Add + 'Dpkg/Compression.pm'. + 2007-12-27 Raphael Hertzog * scripts/Dpkg/Shlibs/SymbolFile.pm: Blacklist some armel specific diff --git a/debian/changelog b/debian/changelog index 85380ace..a4149995 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ dpkg (1.14.15) UNRELEASED; urgency=low * Blacklist armel-specific symbols in dpkg-gensymbols. Reported by Riku Voipio. Closes: #457964 + [ Guillem Jover ] + * Move compression related variables to a new Dpkg::Compression module. + [ Updated dpkg translations ] * Norwegian Bokmål (Hans Fredrik Nordhaug). Closes: #457918 diff --git a/debian/dpkg-dev.install b/debian/dpkg-dev.install index 5ad0fa92..70e74cdd 100644 --- a/debian/dpkg-dev.install +++ b/debian/dpkg-dev.install @@ -64,6 +64,7 @@ usr/share/man/*/*/dpkg-source.1 usr/share/man/*/dpkg-source.1 usr/share/perl5/Dpkg/Arch.pm usr/share/perl5/Dpkg/BuildOptions.pm +usr/share/perl5/Dpkg/Compression.pm usr/share/perl5/Dpkg/ErrorHandling.pm usr/share/perl5/Dpkg/Deps.pm usr/share/perl5/Dpkg/Fields.pm diff --git a/scripts/Dpkg.pm b/scripts/Dpkg.pm index 0dc07f65..7886018d 100644 --- a/scripts/Dpkg.pm +++ b/scripts/Dpkg.pm @@ -5,9 +5,6 @@ use warnings; use base qw(Exporter); our @EXPORT = qw($version $progname $admindir $dpkglibdir $pkgdatadir); -our %EXPORT_TAGS = ( 'compression' => - [ qw(@comp_supported %comp_supported %comp_ext $comp_regex) ] ); -our @EXPORT_OK = @{$EXPORT_TAGS{compression}}; our ($progname) = $0 =~ m#(?:.*/)?([^/]*)#; @@ -17,10 +14,4 @@ our $admindir = "/var/lib/dpkg"; our $dpkglibdir = "."; our $pkgdatadir = ".."; -# Compression -our @comp_supported = qw(gzip bzip2 lzma); -our %comp_supported = map { $_ => 1 } @comp_supported; -our %comp_ext = ( gzip => 'gz', bzip2 => 'bz2', lzma => 'lzma' ); -our $comp_regex = '(?:gz|bz2|lzma)'; - 1; diff --git a/scripts/Dpkg/Compression.pm b/scripts/Dpkg/Compression.pm new file mode 100644 index 00000000..7c1947b9 --- /dev/null +++ b/scripts/Dpkg/Compression.pm @@ -0,0 +1,14 @@ +package Dpkg::Compression; + +use strict; +use warnings; + +use base qw(Exporter); +our @EXPORT = qw(@comp_supported %comp_supported %comp_ext $comp_regex); + +our @comp_supported = qw(gzip bzip2 lzma); +our %comp_supported = map { $_ => 1 } @comp_supported; +our %comp_ext = ( gzip => 'gz', bzip2 => 'bz2', lzma => 'lzma' ); +our $comp_regex = '(?:gz|bz2|lzma)'; + +1; diff --git a/scripts/Makefile.am b/scripts/Makefile.am index f52457ed..add2dac9 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -79,6 +79,7 @@ perllibdir = $(PERL_LIBDIR) nobase_dist_perllib_DATA = \ Dpkg/Arch.pm \ Dpkg/BuildOptions.pm \ + Dpkg/Compression.pm \ Dpkg/ErrorHandling.pm \ Dpkg/Deps.pm \ Dpkg/Fields.pm \ diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index bd586531..c194ffb9 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -6,12 +6,13 @@ use warnings; use POSIX; use POSIX qw(:errno_h :signal_h); use English; -use Dpkg qw(:DEFAULT :compression); +use Dpkg; use Dpkg::Gettext; use Dpkg::ErrorHandling qw(warning error failure unknown internerr syserr subprocerr usageerr); use Dpkg::Arch qw(get_host_arch debarch_eq debarch_is); use Dpkg::Fields qw(capit set_field_importance sort_field_by_importance); +use Dpkg::Compression; push(@INC,$dpkglibdir); require 'controllib.pl'; diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 0640db4f..0acf61ff 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -3,7 +3,7 @@ use strict; use warnings; -use Dpkg qw(:DEFAULT :compression); +use Dpkg; use Dpkg::Gettext; use Dpkg::ErrorHandling qw(warning warnerror error failure unknown internerr syserr subprocerr usageerr @@ -11,6 +11,7 @@ use Dpkg::ErrorHandling qw(warning warnerror error failure unknown use Dpkg::Arch qw(debarch_eq); use Dpkg::Deps qw(@src_dep_fields %dep_field_type); use Dpkg::Fields qw(capit set_field_importance); +use Dpkg::Compression; my @filesinarchive; my %dirincluded; -- 2.39.5