Author: guillem
Date: 2007-07-22 13:32:07 +0000 (Sun, 22 Jul 2007)
New Revision: 885
Added:
trunk/scripts/Dpkg/
trunk/scripts/Dpkg/Gettext.pm
Removed:
trunk/scripts/dpkg-gettext.pl
Modified:
trunk/ChangeLog
trunk/debian/changelog
trunk/debian/dpkg.install
trunk/scripts/822-date.pl
trunk/scripts/Makefile.am
trunk/scripts/cleanup-info.pl
trunk/scripts/controllib.pl
trunk/scripts/dpkg-architecture.pl
trunk/scripts/dpkg-checkbuilddeps.pl
trunk/scripts/dpkg-distaddfile.pl
trunk/scripts/dpkg-divert.pl
trunk/scripts/dpkg-genchanges.pl
trunk/scripts/dpkg-gencontrol.pl
trunk/scripts/dpkg-parsechangelog.pl
trunk/scripts/dpkg-scanpackages.pl
trunk/scripts/dpkg-scansources.pl
trunk/scripts/dpkg-shlibdeps.pl
trunk/scripts/dpkg-source.pl
trunk/scripts/dpkg-statoverride.pl
trunk/scripts/install-info.pl
trunk/scripts/update-alternatives.pl
Log:
Switch 'dpkg-gettext.pl' to a new style perl module Dpkg::Gettext.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/ChangeLog 2007-07-22 13:32:07 UTC (rev 885)
@@ -1,5 +1,22 @@
2007-07-22 Guillem Jover <[EMAIL PROTECTED]>
+ * 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 <[EMAIL PROTECTED]>
+
* scripts/cleanup-info.pl: Use new Dpkg module, and remove variable
declarations already done in the module.
* scripts/controllib.pl: Likewise.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/debian/changelog 2007-07-22 13:32:07 UTC (rev 885)
@@ -16,6 +16,7 @@
- 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).
Modified: trunk/debian/dpkg.install
===================================================================
--- trunk/debian/dpkg.install 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/debian/dpkg.install 2007-07-22 13:32:07 UTC (rev 885)
@@ -7,7 +7,6 @@
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
Modified: trunk/scripts/822-date.pl
===================================================================
--- trunk/scripts/822-date.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/822-date.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -4,9 +4,8 @@
use warnings;
use Dpkg;
+use Dpkg::Gettext;
-push(@INC, $dpkglibdir);
-require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
require 'controllib.pl';
Copied: trunk/scripts/Dpkg/Gettext.pm (from rev 880,
trunk/scripts/dpkg-gettext.pl)
===================================================================
--- trunk/scripts/Dpkg/Gettext.pm (rev 0)
+++ trunk/scripts/Dpkg/Gettext.pm 2007-07-22 13:32:07 UTC (rev 885)
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+# Copied from /usr/share/perl5/Debconf/Gettext.pm
+
+package Dpkg::Gettext;
+
+use strict;
+use warnings;
+
+BEGIN {
+ eval 'use Locale::gettext';
+ if ($@) {
+ eval q{
+ sub _g {
+ return shift;
+ }
+ sub textdomain {
+ }
+ sub ngettext {
+ if ($_[2] == 1) {
+ return $_[0];
+ } else {
+ return $_[1];
+ }
+ }
+ };
+ } else {
+ eval q{
+ sub _g {
+ return gettext(shift);
+ }
+ };
+ }
+}
+
+use base qw(Exporter);
+our @EXPORT=qw(_g textdomain ngettext);
+
+1;
Modified: trunk/scripts/Makefile.am
===================================================================
--- trunk/scripts/Makefile.am 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/Makefile.am 2007-07-22 13:32:07 UTC (rev 885)
@@ -55,11 +55,11 @@
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):" \
Modified: trunk/scripts/cleanup-info.pl
===================================================================
--- trunk/scripts/cleanup-info.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/cleanup-info.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -25,9 +25,8 @@
use warnings;
use Dpkg;
+use Dpkg::Gettext;
-push(@INC,$dpkglibdir);
-require 'dpkg-gettext.pl';
textdomain("dpkg");
($0) = $0 =~ m:.*/(.+):;
Modified: trunk/scripts/controllib.pl
===================================================================
--- trunk/scripts/controllib.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/controllib.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -6,9 +6,8 @@
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
Modified: trunk/scripts/dpkg-architecture.pl
===================================================================
--- trunk/scripts/dpkg-architecture.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-architecture.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -23,11 +23,11 @@
use warnings;
use Dpkg;
+use Dpkg::Gettext;
push(@INC,$dpkglibdir);
require 'controllib.pl';
-require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
sub version {
Modified: trunk/scripts/dpkg-checkbuilddeps.pl
===================================================================
--- trunk/scripts/dpkg-checkbuilddeps.pl 2007-07-22 00:34:50 UTC (rev
884)
+++ trunk/scripts/dpkg-checkbuilddeps.pl 2007-07-22 13:32:07 UTC (rev
885)
@@ -6,13 +6,13 @@
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 {
Modified: trunk/scripts/dpkg-distaddfile.pl
===================================================================
--- trunk/scripts/dpkg-distaddfile.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-distaddfile.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -6,11 +6,11 @@
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';
Modified: trunk/scripts/dpkg-divert.pl
===================================================================
--- trunk/scripts/dpkg-divert.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-divert.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -4,9 +4,8 @@
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", $!);
Modified: trunk/scripts/dpkg-genchanges.pl
===================================================================
--- trunk/scripts/dpkg-genchanges.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-genchanges.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -6,6 +6,7 @@
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 $sourcepackage;
our $host_arch;
-require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
my @changes_fields = qw(Format Date Source Binary Architecture Version
Modified: trunk/scripts/dpkg-gencontrol.pl
===================================================================
--- trunk/scripts/dpkg-gencontrol.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-gencontrol.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -6,6 +6,7 @@
use POSIX;
use POSIX qw(:errno_h);
use Dpkg;
+use Dpkg::Gettext;
push(@INC,$dpkglibdir);
require 'controllib.pl';
@@ -18,7 +19,6 @@
our $sourcepackage;
our $host_arch;
-require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
my @control_fields = (qw(Package Source Version Architecture Essential Origin
Deleted: trunk/scripts/dpkg-gettext.pl
===================================================================
--- trunk/scripts/dpkg-gettext.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-gettext.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -1,36 +0,0 @@
-#!/usr/bin/perl -w
-# Copied from /usr/share/perl5/Debconf/Gettext.pm
-
-use strict;
-use warnings;
-
-BEGIN {
- eval 'use Locale::gettext';
- if ($@) {
- eval q{
- sub _g {
- return shift;
- }
- sub textdomain {
- }
- sub ngettext {
- if ($_[2] == 1) {
- return $_[0];
- } else {
- return $_[1];
- }
- }
- };
- } else {
- eval q{
- sub _g {
- return gettext(shift);
- }
- };
- }
-}
-
-use base qw(Exporter);
-our @EXPORT=qw(_g textdomain ngettext);
-
-1;
Modified: trunk/scripts/dpkg-parsechangelog.pl
===================================================================
--- trunk/scripts/dpkg-parsechangelog.pl 2007-07-22 00:34:50 UTC (rev
884)
+++ trunk/scripts/dpkg-parsechangelog.pl 2007-07-22 13:32:07 UTC (rev
885)
@@ -6,11 +6,11 @@
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';
Modified: trunk/scripts/dpkg-scanpackages.pl
===================================================================
--- trunk/scripts/dpkg-scanpackages.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-scanpackages.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -6,10 +6,10 @@
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;
Modified: trunk/scripts/dpkg-scansources.pl
===================================================================
--- trunk/scripts/dpkg-scansources.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-scansources.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -30,9 +30,8 @@
use warnings;
use Dpkg;
+use Dpkg::Gettext;
-push(@INC,$dpkglibdir);
-require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
use Getopt::Long ();
Modified: trunk/scripts/dpkg-shlibdeps.pl
===================================================================
--- trunk/scripts/dpkg-shlibdeps.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-shlibdeps.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -9,6 +9,7 @@
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 @@
push(@INC,$dpkglibdir);
require 'controllib.pl';
-require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
#use strict;
Modified: trunk/scripts/dpkg-source.pl
===================================================================
--- trunk/scripts/dpkg-source.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-source.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -4,6 +4,7 @@
use warnings;
use Dpkg;
+use Dpkg::Gettext;
my @filesinarchive;
my %dirincluded;
@@ -72,7 +73,6 @@
our %substvar;
our @src_dep_fields;
-require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
my @dsc_fields = (qw(Format Source Binary Architecture Version Origin
Modified: trunk/scripts/dpkg-statoverride.pl
===================================================================
--- trunk/scripts/dpkg-statoverride.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/dpkg-statoverride.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -6,9 +6,8 @@
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;
Modified: trunk/scripts/install-info.pl
===================================================================
--- trunk/scripts/install-info.pl 2007-07-22 00:34:50 UTC (rev 884)
+++ trunk/scripts/install-info.pl 2007-07-22 13:32:07 UTC (rev 885)
@@ -2,9 +2,8 @@
use Text::Wrap;
use Dpkg;
+use Dpkg::Gettext;
-push (@INC, $dpkglibdir);
-require 'dpkg-gettext.pl';
textdomain("dpkg");
# fixme: sort entries
Modified: trunk/scripts/update-alternatives.pl
===================================================================
--- trunk/scripts/update-alternatives.pl 2007-07-22 00:34:50 UTC (rev
884)
+++ trunk/scripts/update-alternatives.pl 2007-07-22 13:32:07 UTC (rev
885)
@@ -4,9 +4,8 @@
use warnings;
use Dpkg;
+use Dpkg::Gettext;
-push (@INC, $dpkglibdir);
-require 'dpkg-gettext.pl';
textdomain("dpkg");
# Global variables:
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]