From: Guillem Jover Date: Sun, 22 Jul 2007 13:32:07 +0000 (+0000) Subject: Switch 'dpkg-gettext.pl' to a new style perl module Dpkg::Gettext. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cd101f18784d8f49b774d7c6e2952d8ca6007a6;p=dpkg Switch 'dpkg-gettext.pl' to a new style perl module Dpkg::Gettext. --- diff --git a/ChangeLog b/ChangeLog index 479cd29d..81505b6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2007-07-22 Guillem Jover + + * scripts/dpkg-gettext.pl: Move ... + * scripts/Dpkg/Gettext.pm: ... here. Add a package statement. + Fix all users. + * scripts/Makefile.am (dist_pkglib_SCRIPTS): Remove 'dpkg-gettext.pl'. + (nobase_dist_perllib_DATA): Add 'Dpkg/Gettext.pm'. + + * scripts/822-date.pl: Do not push $dpkglibdir into @INC anymore. + * scripts/cleanup-info.pl: Likewise. + * scripts/controllib.pl: Likewise. + * scripts/dpkg-divert.pl: Likewise. + * scripts/dpkg-scansources.pl: Likewise. + * scripts/dpkg-statoverride.pl: Likewise. + * scripts/install-info.pl: Likewise. + * scripts/update-alternatives.pl: Likewise. + 2007-07-22 Guillem Jover * scripts/cleanup-info.pl: Use new Dpkg module, and remove variable diff --git a/debian/changelog b/debian/changelog index 8a44db8a..a3be66cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ dpkg (1.14.6) UNRELEASED; urgency=low - Unify author and copyright information formatting. * Move variables automatically modified at build time to a new style perl module and make all programs use the new module.. + * Switch 'dpkg-gettext.pl' to a new style perl module Dpkg::Gettext. [ Updated scripts translations ] * French (Frédéric Bothamy, Christian Perrier). diff --git a/debian/dpkg.install b/debian/dpkg.install index 478405f7..e1d4b489 100644 --- a/debian/dpkg.install +++ b/debian/dpkg.install @@ -7,7 +7,6 @@ usr/bin/dpkg usr/bin/dpkg-deb usr/bin/dpkg-query usr/bin/dpkg-split -usr/lib/dpkg/dpkg-gettext.pl usr/lib/dpkg/enoent usr/lib/dpkg/mksplit usr/sbin diff --git a/scripts/822-date.pl b/scripts/822-date.pl index c3145451..28cfab33 100755 --- a/scripts/822-date.pl +++ b/scripts/822-date.pl @@ -4,9 +4,8 @@ use strict; use warnings; use Dpkg; +use Dpkg::Gettext; -push(@INC, $dpkglibdir); -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); require 'controllib.pl'; diff --git a/scripts/dpkg-gettext.pl b/scripts/Dpkg/Gettext.pm similarity index 95% rename from scripts/dpkg-gettext.pl rename to scripts/Dpkg/Gettext.pm index c7dca780..99bba388 100644 --- a/scripts/dpkg-gettext.pl +++ b/scripts/Dpkg/Gettext.pm @@ -1,6 +1,8 @@ #!/usr/bin/perl -w # Copied from /usr/share/perl5/Debconf/Gettext.pm +package Dpkg::Gettext; + use strict; use warnings; diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e83f2aba..454db544 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -55,11 +55,11 @@ CLEANFILES = \ perllibdir = $(PERL_LIBDIR) nobase_dist_perllib_DATA = \ + Dpkg/Gettext.pm \ Dpkg.pm dist_pkglib_SCRIPTS = \ - controllib.pl \ - dpkg-gettext.pl + controllib.pl do_perl_subst = sed -e "s:^\#![:space:]*/usr/bin/perl:\#!$(PERL):" \ diff --git a/scripts/cleanup-info.pl b/scripts/cleanup-info.pl index 5fcbdc8b..0adcbc96 100755 --- a/scripts/cleanup-info.pl +++ b/scripts/cleanup-info.pl @@ -25,9 +25,8 @@ use strict; use warnings; use Dpkg; +use Dpkg::Gettext; -push(@INC,$dpkglibdir); -require 'dpkg-gettext.pl'; textdomain("dpkg"); ($0) = $0 =~ m:.*/(.+):; diff --git a/scripts/controllib.pl b/scripts/controllib.pl index 96731cab..08cbd311 100755 --- a/scripts/controllib.pl +++ b/scripts/controllib.pl @@ -6,9 +6,8 @@ use warnings; use English; use POSIX qw(:errno_h); use Dpkg; +use Dpkg::Gettext; -push(@INC,$dpkglibdir); -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); our $sourcepackage; # - name of sourcepackage diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index c199e0ba..5588976d 100755 --- a/scripts/dpkg-architecture.pl +++ b/scripts/dpkg-architecture.pl @@ -23,11 +23,11 @@ use strict; use warnings; use Dpkg; +use Dpkg::Gettext; push(@INC,$dpkglibdir); require 'controllib.pl'; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); sub version { diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl index 88163168..9e30b84c 100755 --- a/scripts/dpkg-checkbuilddeps.pl +++ b/scripts/dpkg-checkbuilddeps.pl @@ -6,13 +6,13 @@ use warnings; use Getopt::Long; use Dpkg; +use Dpkg::Gettext; push(@INC,$dpkglibdir); require 'controllib.pl'; our %fi; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); sub usage { diff --git a/scripts/dpkg-distaddfile.pl b/scripts/dpkg-distaddfile.pl index 15555011..e7ebb329 100755 --- a/scripts/dpkg-distaddfile.pl +++ b/scripts/dpkg-distaddfile.pl @@ -6,11 +6,11 @@ use warnings; use POSIX; use POSIX qw(:errno_h :signal_h); use Dpkg; +use Dpkg::Gettext; push(@INC,$dpkglibdir); require 'controllib.pl'; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); my $fileslistfile = 'debian/files'; diff --git a/scripts/dpkg-divert.pl b/scripts/dpkg-divert.pl index 78484717..253209ef 100755 --- a/scripts/dpkg-divert.pl +++ b/scripts/dpkg-divert.pl @@ -4,9 +4,8 @@ use strict; use warnings; use Dpkg; +use Dpkg::Gettext; -push (@INC, $dpkglibdir); -require 'dpkg-gettext.pl'; textdomain("dpkg"); my $enoent = `$dpkglibdir/enoent` || die sprintf(_g("Cannot get ENOENT value from %s: %s"), "$dpkglibdir/enoent", $!); diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 51c90a6d..42564c9d 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -6,6 +6,7 @@ use warnings; use POSIX; use POSIX qw(:errno_h :signal_h); use Dpkg; +use Dpkg::Gettext; push(@INC,$dpkglibdir); require 'controllib.pl'; @@ -17,7 +18,6 @@ our %substvar; our $sourcepackage; our $host_arch; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); my @changes_fields = qw(Format Date Source Binary Architecture Version diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 6f7ec1a5..bdaaa00f 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -6,6 +6,7 @@ use warnings; use POSIX; use POSIX qw(:errno_h); use Dpkg; +use Dpkg::Gettext; push(@INC,$dpkglibdir); require 'controllib.pl'; @@ -18,7 +19,6 @@ our @pkg_dep_fields; our $sourcepackage; our $host_arch; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); my @control_fields = (qw(Package Source Version Architecture Essential Origin diff --git a/scripts/dpkg-parsechangelog.pl b/scripts/dpkg-parsechangelog.pl index 2ef223b5..4a2e370c 100755 --- a/scripts/dpkg-parsechangelog.pl +++ b/scripts/dpkg-parsechangelog.pl @@ -6,11 +6,11 @@ use warnings; use POSIX; use POSIX qw(:errno_h); use Dpkg; +use Dpkg::Gettext; push(@INC,$dpkglibdir); require 'controllib.pl'; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); my $format ='debian'; diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl index 2581391e..fd4c1ce2 100755 --- a/scripts/dpkg-scanpackages.pl +++ b/scripts/dpkg-scanpackages.pl @@ -6,10 +6,10 @@ use strict; use IO::Handle; use IO::File; use Dpkg; +use Dpkg::Gettext; push(@INC,$dpkglibdir); require 'controllib.pl'; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); our @pkg_dep_fields; diff --git a/scripts/dpkg-scansources.pl b/scripts/dpkg-scansources.pl index 4eade815..72749ff3 100755 --- a/scripts/dpkg-scansources.pl +++ b/scripts/dpkg-scansources.pl @@ -30,9 +30,8 @@ use strict; use warnings; use Dpkg; +use Dpkg::Gettext; -push(@INC,$dpkglibdir); -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); use Getopt::Long (); diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 198d7267..95795fd2 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -9,6 +9,7 @@ use warnings; use English; use POSIX qw(:errno_h :signal_h); use Dpkg; +use Dpkg::Gettext; my $shlibsoverride= '/etc/dpkg/shlibs.override'; my $shlibsdefault= '/etc/dpkg/shlibs.default'; @@ -27,7 +28,6 @@ my $i=0; grep($depstrength{$_}= ++$i, @depfields); push(@INC,$dpkglibdir); require 'controllib.pl'; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); #use strict; diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 4c92e3b1..1ed1213b 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -4,6 +4,7 @@ use strict; use warnings; use Dpkg; +use Dpkg::Gettext; my @filesinarchive; my %dirincluded; @@ -72,7 +73,6 @@ our $quiet_warnings; our %substvar; our @src_dep_fields; -require 'dpkg-gettext.pl'; textdomain("dpkg-dev"); my @dsc_fields = (qw(Format Source Binary Architecture Version Origin diff --git a/scripts/dpkg-statoverride.pl b/scripts/dpkg-statoverride.pl index e75eceff..06cabbc5 100755 --- a/scripts/dpkg-statoverride.pl +++ b/scripts/dpkg-statoverride.pl @@ -6,9 +6,8 @@ use warnings; use POSIX; use POSIX qw(:errno_h :signal_h); use Dpkg; +use Dpkg::Gettext; -push (@INC, $dpkglibdir); -require 'dpkg-gettext.pl'; textdomain("dpkg"); my $verbose = 1; diff --git a/scripts/install-info.pl b/scripts/install-info.pl index 35f30d32..906322c5 100755 --- a/scripts/install-info.pl +++ b/scripts/install-info.pl @@ -2,9 +2,8 @@ use Text::Wrap; use Dpkg; +use Dpkg::Gettext; -push (@INC, $dpkglibdir); -require 'dpkg-gettext.pl'; textdomain("dpkg"); # fixme: sort entries diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl index 1f879a0c..f851ccc5 100755 --- a/scripts/update-alternatives.pl +++ b/scripts/update-alternatives.pl @@ -4,9 +4,8 @@ use strict; use warnings; use Dpkg; +use Dpkg::Gettext; -push (@INC, $dpkglibdir); -require 'dpkg-gettext.pl'; textdomain("dpkg"); # Global variables: