Author: guillem
Date: 2007-07-22 00:31:25 +0000 (Sun, 22 Jul 2007)
New Revision: 883
Modified:
trunk/ChangeLog
trunk/debian/changelog
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 perl programs to use the new Dpkg module and its variables.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/ChangeLog 2007-07-22 00:31:25 UTC (rev 883)
@@ -1,3 +1,36 @@
+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.
+ * scripts/dpkg-architecture.pl: Likewise.
+ * scripts/dpkg-checkbuilddeps.pl: Likewise.
+ * scripts/dpkg-distaddfile.pl: Likewise.
+ * scripts/dpkg-divert.pl: Likewise.
+ * scripts/dpkg-genchanges.pl: Likewise.
+ * scripts/dpkg-gencontrol.pl: Likewise.
+ * scripts/dpkg-parsechangelog.pl: Likewise.
+ * scripts/dpkg-scanpackages.pl: Likewise.
+ * scripts/dpkg-scansources.pl: Likewise.
+ * scripts/dpkg-shlibdeps.pl: Likewise.
+ * scripts/dpkg-source.pl: Likewise.
+ * scripts/dpkg-statoverride.pl: Likewise.
+ * scripts/install-info.pl: Likewise.
+ * scripts/update-alternatives.pl: Likewise.
+
+ * scripts/controllib.pl (init_substvars): Remove comment about
+ $version needing to be a global variable set elsewhere.
+
+ * scripts/dpkg-scanpackages.pl: Remove $0 mangling.
+ (version, usage): Use $progname instead of $0.
+ * scripts/dpkg-statoverride.pl: Likewise.
+ * scripts/install-info.pl: Likewise.
+ * scripts/dpkg-divert.pl: Likewise.
+ (quit, badusage): Use $progname instead of $0.
+ * scripts/update-alternatives.pl: Likewise.
+ * scripts/dpkg-scansources.pl ($Me): Remove declaration.
+ (xwarndie_mess, version, usage): Use $progname instead of $Me.
+
2007-07-21 Guillem Jover <[EMAIL PROTECTED]>
* m4/perl.m4 (DPKG_PROG_PERL): Add support for user overridable
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/debian/changelog 2007-07-22 00:31:25 UTC (rev 883)
@@ -15,7 +15,7 @@
- Split option descriptions so that it gets easier to distinguish.
- Unify author and copyright information formatting.
* Move variables automatically modified at build time to a new style perl
- module.
+ module and make all programs use the new module..
[ Updated scripts translations ]
* French (Frédéric Bothamy, Christian Perrier).
Modified: trunk/scripts/cleanup-info.pl
===================================================================
--- trunk/scripts/cleanup-info.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/cleanup-info.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -24,14 +24,14 @@
use strict;
use warnings;
-my $dpkglibdir = "."; # This line modified by Makefile
+use Dpkg;
+
push(@INC,$dpkglibdir);
require 'dpkg-gettext.pl';
textdomain("dpkg");
($0) = $0 =~ m:.*/(.+):;
-my $version = '1.1.6'; # This line modified by Makefile
sub version {
printf _g("Debian %s version %s.\n"), $0, $version;
Modified: trunk/scripts/controllib.pl
===================================================================
--- trunk/scripts/controllib.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/controllib.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -5,10 +5,8 @@
use English;
use POSIX qw(:errno_h);
+use Dpkg;
-our $dpkglibdir;
-our $pkgdatadir;
-
push(@INC,$dpkglibdir);
require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
@@ -36,11 +34,7 @@
our $warnable_error = 1;
our $quiet_warnings = 0;
-our $version;
-our $progname = $0;
-$progname = $& if $progname =~ m,[^/]+$,;
-
sub getfowner
{
my $getlogin = getlogin();
@@ -551,8 +545,6 @@
$substvar{'source:Upstream-Version'} = $fi{"L Version"};
$substvar{'source:Upstream-Version'} =~ s/-[^-]*$//;
- # FIXME: this needs all progs using controllib to set $version as 'our'.
- # We expect the calling program to set $version.
$substvar{"dpkg:Version"} = $version;
$substvar{"dpkg:Upstream-Version"} = $version;
$substvar{"dpkg:Upstream-Version"} =~ s/-[^-]+$//;
Modified: trunk/scripts/dpkg-architecture.pl
===================================================================
--- trunk/scripts/dpkg-architecture.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-architecture.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -22,10 +22,7 @@
use strict;
use warnings;
-our $progname;
-our $version = "1.0.0"; # This line modified by Makefile
-our $dpkglibdir = "."; # This line modified by Makefile
-our $pkgdatadir = ".."; # This line modified by Makefile
+use Dpkg;
push(@INC,$dpkglibdir);
require 'controllib.pl';
Modified: trunk/scripts/dpkg-checkbuilddeps.pl
===================================================================
--- trunk/scripts/dpkg-checkbuilddeps.pl 2007-07-21 16:30:16 UTC (rev
882)
+++ trunk/scripts/dpkg-checkbuilddeps.pl 2007-07-22 00:31:25 UTC (rev
883)
@@ -4,13 +4,9 @@
use strict;
use warnings;
-our $progname;
-our $dpkglibdir = "."; # This line modified by Makefile
-our $pkgdatadir = ".."; # This line modified by Makefile
-
use Getopt::Long;
+use Dpkg;
-my $admindir = "/var/lib/dpkg";
push(@INC,$dpkglibdir);
require 'controllib.pl';
Modified: trunk/scripts/dpkg-distaddfile.pl
===================================================================
--- trunk/scripts/dpkg-distaddfile.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-distaddfile.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -3,12 +3,9 @@
use strict;
use warnings;
-our $progname;
-our $version = '1.3.0'; # This line modified by Makefile
-our $dpkglibdir = "."; # This line modified by Makefile
-
use POSIX;
use POSIX qw(:errno_h :signal_h);
+use Dpkg;
push(@INC,$dpkglibdir);
require 'controllib.pl';
Modified: trunk/scripts/dpkg-divert.pl
===================================================================
--- trunk/scripts/dpkg-divert.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-divert.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -3,10 +3,7 @@
use strict;
use warnings;
-my $version = '1.0.11'; # This line modified by Makefile
-my $admindir = "/var/lib/dpkg"; # This line modified by Makefile
-my $dpkglibdir = "../utils"; # This line modified by Makefile
-($0) = $0 =~ m:.*/(.+):;
+use Dpkg;
push (@INC, $dpkglibdir);
require 'dpkg-gettext.pl';
@@ -16,7 +13,7 @@
sub ENOENT { $enoent; }
sub version {
- printf _g("Debian %s version %s.\n"), $0, $version;
+ printf _g("Debian %s version %s.\n"), $progname, $version;
printf _g("
Copyright (C) 1995 Ian Jackson.
@@ -53,7 +50,7 @@
When adding, default is --local and --divert <original>.distrib.
When removing, --package or --local and --divert must match if specified.
Package preinst/postrm scripts should always specify --package and --divert.
-"), $0);
+"), $progname);
}
my $testmode = 0;
@@ -296,13 +293,13 @@
sub quit
{
- printf STDERR "%s: %s\n", $0, "@_";
+ printf STDERR "%s: %s\n", $progname, "@_";
exit(2);
}
sub badusage
{
- printf STDERR "%s: %s\n\n", $0, "@_";
+ printf STDERR "%s: %s\n\n", $progname, "@_";
&usage;
exit(2);
}
Modified: trunk/scripts/dpkg-genchanges.pl
===================================================================
--- trunk/scripts/dpkg-genchanges.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-genchanges.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -3,13 +3,9 @@
use strict;
use warnings;
-our $progname;
-our $version = '1.3.0'; # This line modified by Makefile
-our $dpkglibdir = "."; # This line modified by Makefile
-our $pkgdatadir = ".."; # This line modified by Makefile
-
use POSIX;
use POSIX qw(:errno_h :signal_h);
+use Dpkg;
push(@INC,$dpkglibdir);
require 'controllib.pl';
Modified: trunk/scripts/dpkg-gencontrol.pl
===================================================================
--- trunk/scripts/dpkg-gencontrol.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-gencontrol.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -3,17 +3,13 @@
use strict;
use warnings;
-our $version = '1.3.0'; # This line modified by Makefile
-our $dpkglibdir = "."; # This line modified by Makefile
-our $pkgdatadir = ".."; # This line modified by Makefile
-
use POSIX;
use POSIX qw(:errno_h);
+use Dpkg;
push(@INC,$dpkglibdir);
require 'controllib.pl';
-our $progname;
our %substvar;
our (%f, %fi);
our %fieldimps;
Modified: trunk/scripts/dpkg-parsechangelog.pl
===================================================================
--- trunk/scripts/dpkg-parsechangelog.pl 2007-07-21 16:30:16 UTC (rev
882)
+++ trunk/scripts/dpkg-parsechangelog.pl 2007-07-22 00:31:25 UTC (rev
883)
@@ -3,12 +3,9 @@
use strict;
use warnings;
-our $progname;
-our $version = '1.3.0'; # This line modified by Makefile
-our $dpkglibdir = "/usr/lib/dpkg"; # This line modified by Makefile
-
use POSIX;
use POSIX qw(:errno_h);
+use Dpkg;
push(@INC,$dpkglibdir);
require 'controllib.pl';
Modified: trunk/scripts/dpkg-scanpackages.pl
===================================================================
--- trunk/scripts/dpkg-scanpackages.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-scanpackages.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -5,12 +5,8 @@
use IO::Handle;
use IO::File;
+use Dpkg;
-my $version= '1.2.6'; # This line modified by Makefile
-my $dpkglibdir= "."; # This line modified by Makefile
-
-($0) = $0 =~ m:.*/(.+):;
-
push(@INC,$dpkglibdir);
require 'controllib.pl';
require 'dpkg-gettext.pl';
@@ -48,7 +44,7 @@
my $result =
GetOptions(\%options,'help|h|?','version','udeb|u!','arch|a=s','multiversion|m!');
sub version {
- printf _g("Debian %s version %s.\n"), $0, $version;
+ printf _g("Debian %s version %s.\n"), $progname, $version;
exit;
}
@@ -62,7 +58,7 @@
-m, --multiversion allow multiple versions of a single package.
-h, --help show this help message.
--version show the version.
-"), $0;
+"), $progname;
}
sub load_override
Modified: trunk/scripts/dpkg-scansources.pl
===================================================================
--- trunk/scripts/dpkg-scansources.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-scansources.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -29,7 +29,8 @@
use strict;
use warnings;
-my $dpkglibdir= "."; # This line modified by Makefile
+use Dpkg;
+
push(@INC,$dpkglibdir);
require 'dpkg-gettext.pl';
textdomain("dpkg-dev");
@@ -37,8 +38,6 @@
use Getopt::Long ();
my $Exit = 0;
-(my $Me = $0) =~ s-.*/--;
-my $version= '1.6.2.1'; # This line modified by Makefile
# %Override is a hash of lists. The subs following describe what's in
# the lists.
@@ -76,7 +75,7 @@
}
sub xwarndie_mess {
- my @mess = ("$Me: ", @_);
+ my @mess = ("$progname: ", @_);
$mess[$#mess] =~ s/:$/: $!\n/; # XXX loses if it's really /:\n/
return @mess;
}
@@ -95,7 +94,7 @@
}
sub version {
- printf _g("Debian %s version %s.\n"), $Me, $version;
+ printf _g("Debian %s version %s.\n"), $progname, $version;
exit;
}
@@ -113,7 +112,7 @@
--version show the version.
See the man page for the full documentation.
-"), $Me;
+"), $progname;
exit;
}
Modified: trunk/scripts/dpkg-shlibdeps.pl
===================================================================
--- trunk/scripts/dpkg-shlibdeps.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-shlibdeps.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -6,13 +6,9 @@
use strict;
use warnings;
-our $progname;
-our $version = "1.4.1.19"; # This line modified by Makefile
-our $dpkglibdir = "/usr/lib/dpkg";
-my $admindir = "/var/lib/dpkg";
-
use English;
use POSIX qw(:errno_h :signal_h);
+use Dpkg;
my $shlibsoverride= '/etc/dpkg/shlibs.override';
my $shlibsdefault= '/etc/dpkg/shlibs.default';
Modified: trunk/scripts/dpkg-source.pl
===================================================================
--- trunk/scripts/dpkg-source.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-source.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -3,10 +3,7 @@
use strict;
use warnings;
-our $progname;
-our $version = "1.3.0"; # This line modified by Makefile
-our $dpkglibdir = "."; # This line modified by Makefile
-our $pkgdatadir = ".."; # This line modified by Makefile
+use Dpkg;
my @filesinarchive;
my %dirincluded;
Modified: trunk/scripts/dpkg-statoverride.pl
===================================================================
--- trunk/scripts/dpkg-statoverride.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/dpkg-statoverride.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -5,13 +5,8 @@
use POSIX;
use POSIX qw(:errno_h :signal_h);
+use Dpkg;
-my $admindir = "/var/lib/dpkg"; # This line modified by Makefile
-my $version = '1.3.0'; # This line modified by Makefile
-
-($0) = $0 =~ m:.*/(.+):;
-
-my $dpkglibdir= "."; # This line modified by Makefile
push (@INC, $dpkglibdir);
require 'dpkg-gettext.pl';
textdomain("dpkg");
@@ -26,7 +21,7 @@
my %mode;
sub version {
- printf _g("Debian %s version %s.\n"), $0, $version;
+ printf _g("Debian %s version %s.\n"), $progname, $version;
printf _g("
Copyright (C) 2000 Wichert Akkerman.");
@@ -54,7 +49,7 @@
--quiet quiet operation, minimal output.
--help show this help message.
--version show the version.
-"), $0;
+"), $progname;
}
sub CheckModeConflict {
Modified: trunk/scripts/install-info.pl
===================================================================
--- trunk/scripts/install-info.pl 2007-07-21 16:30:16 UTC (rev 882)
+++ trunk/scripts/install-info.pl 2007-07-22 00:31:25 UTC (rev 883)
@@ -1,20 +1,17 @@
#!/usr/bin/perl --
use Text::Wrap;
+use Dpkg;
-my $dpkglibdir = "."; # This line modified by Makefile
push (@INC, $dpkglibdir);
require 'dpkg-gettext.pl';
textdomain("dpkg");
-($0) = $0 =~ m:.*/(.+):;
-
# fixme: sort entries
# fixme: send to FSF ?
-$version= '0.93.42.2'; # This line modified by Makefile
sub version {
- printf _g("Debian %s version %s.\n"), $0, $version;
+ printf _g("Debian %s version %s.\n"), $progname, $version;
printf _g("
Copyright (C) 1994,1995 Ian Jackson.");
@@ -48,7 +45,7 @@
--quiet do not show output messages.
--help show this help message.
--version show the version.
-"), $0;
+"), $progname;
}
$dirfile = '/usr/share/info/dir';
Modified: trunk/scripts/update-alternatives.pl
===================================================================
--- trunk/scripts/update-alternatives.pl 2007-07-21 16:30:16 UTC (rev
882)
+++ trunk/scripts/update-alternatives.pl 2007-07-22 00:31:25 UTC (rev
883)
@@ -3,15 +3,12 @@
use strict;
use warnings;
-my $admindir = "/var/lib/dpkg"; # This line modified by Makefile
-my $dpkglibdir = "../utils"; # This line modified by Makefile
-my $version = '0.93.80'; # This line modified by Makefile
+use Dpkg;
+
push (@INC, $dpkglibdir);
require 'dpkg-gettext.pl';
textdomain("dpkg");
-($0) = $0 =~ m:.*/(.+):;
-
# Global variables:
my $altdir = '/etc/alternatives';
@@ -61,7 +58,7 @@
sub ENOENT { $enoent; }
sub version {
- printf _g("Debian %s version %s.\n"), $0, $version;
+ printf _g("Debian %s version %s.\n"), $progname, $version;
printf _g("
Copyright (C) 1995 Ian Jackson.
@@ -108,18 +105,18 @@
--quiet quiet operation, minimal output.
--help show this help message.
--version show the version.
-"), $0, $altdir;
+"), $progname, $altdir;
}
sub quit
{
- printf STDERR "%s: %s\n", $0, "@_";
+ printf STDERR "%s: %s\n", $progname, "@_";
exit(2);
}
sub badusage
{
- printf STDERR "%s: %s\n\n", $0, "@_";
+ printf STDERR "%s: %s\n\n", $progname, "@_";
&usage;
exit(2);
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]