diff options
Diffstat (limited to 'scripts')
27 files changed, 100 insertions, 90 deletions
diff --git a/scripts/Dpkg.pm b/scripts/Dpkg.pm index 47ad0843e..660e031ea 100644 --- a/scripts/Dpkg.pm +++ b/scripts/Dpkg.pm @@ -16,20 +16,28 @@ package Dpkg; use strict; use warnings; -our $VERSION = '1.00'; +our $VERSION = '1.01'; use base qw(Exporter); -our @EXPORT_OK = qw($CONFDIR); +our @EXPORT_OK = qw($PROGNAME $PROGVERSION $CONFDIR $ADMINDIR $LIBDIR $DATADIR); our @EXPORT = qw($version $progname $admindir $dpkglibdir $pkgdatadir); -our ($progname) = $0 =~ m{(?:.*/)?([^/]*)}; +our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)}; # The following lines are automatically fixed at install time -our $version = '1.17.x'; +our $PROGVERSION = '1.17.x'; our $CONFDIR = '/etc/dpkg'; -our $admindir = '/var/lib/dpkg'; -our $dpkglibdir = '.'; -our $pkgdatadir = '..'; -$pkgdatadir = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR}; +our $ADMINDIR = '/var/lib/dpkg'; +our $LIBDIR = '.'; +our $DATADIR = '..'; +$DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR}; + +# XXX: Backwards compatibility, to be removed on VERSION 2.00. +## no critic (Variables::ProhibitPackageVars) +our $version = $PROGVERSION; +our $admindir = $ADMINDIR; +our $dpkglibdir = $LIBDIR; +our $pkgdatadir = $DATADIR; +## use critic 1; diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm index 06cfe59d2..776ca0654 100644 --- a/scripts/Dpkg/Arch.pm +++ b/scripts/Dpkg/Arch.pm @@ -31,7 +31,7 @@ our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch gnutriplet_to_multiarch debarch_to_multiarch); use POSIX qw(:errno_h); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::BuildEnv; @@ -146,7 +146,7 @@ sub read_cputable local $_; local $/ = "\n"; - open my $cputable_fh, '<', "$pkgdatadir/cputable" + open my $cputable_fh, '<', "$Dpkg::DATADIR/cputable" or syserr(_g('cannot open %s'), 'cputable'); while (<$cputable_fh>) { if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/) { @@ -170,7 +170,7 @@ sub read_ostable local $_; local $/ = "\n"; - open my $ostable_fh, '<', "$pkgdatadir/ostable" + open my $ostable_fh, '<', "$Dpkg::DATADIR/ostable" or syserr(_g('cannot open %s'), 'ostable'); while (<$ostable_fh>) { if (m/^(?!\#)(\S+)\s+(\S+)\s+(\S+)/) { @@ -196,7 +196,7 @@ sub abitable_load() # it does not exist, as that will only mean the other tables do not have # an entry needing to be overridden. This way we do not require a newer # dpkg by libdpkg-perl. - if (open my $abitable_fh, '<', "$pkgdatadir/abitable") { + if (open my $abitable_fh, '<', "$Dpkg::DATADIR/abitable") { while (<$abitable_fh>) { if (m/^(?!\#)(\S+)\s+(\S+)/) { $abibits{$1} = $2; @@ -220,7 +220,7 @@ sub read_triplettable() local $_; local $/ = "\n"; - open my $triplettable_fh, '<', "$pkgdatadir/triplettable" + open my $triplettable_fh, '<', "$Dpkg::DATADIR/triplettable" or syserr(_g('cannot open %s'), 'triplettable'); while (<$triplettable_fh>) { if (m/^(?!\#)(\S+)\s+(\S+)/) { diff --git a/scripts/Dpkg/Changelog/Parse.pm b/scripts/Dpkg/Changelog/Parse.pm index 538301273..4014659b9 100644 --- a/scripts/Dpkg/Changelog/Parse.pm +++ b/scripts/Dpkg/Changelog/Parse.pm @@ -36,7 +36,7 @@ use warnings; our $VERSION = '1.00'; -use Dpkg; # for $dpkglibdir +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control::Changelog; @@ -75,7 +75,7 @@ it's passed as the parameter that follows. sub changelog_parse { my (%options) = @_; my @parserpath = ('/usr/local/lib/dpkg/parsechangelog', - "$dpkglibdir/parsechangelog", + "$Dpkg::LIBDIR/parsechangelog", '/usr/lib/dpkg/parsechangelog'); my $format = 'debian'; my $changelogfile = 'debian/changelog'; diff --git a/scripts/Dpkg/Control.pm b/scripts/Dpkg/Control.pm index a77914b1f..8e6d7b921 100644 --- a/scripts/Dpkg/Control.pm +++ b/scripts/Dpkg/Control.pm @@ -93,7 +93,7 @@ Corresponds to a vendor file in $Dpkg::CONFDIR/origins/. =item CTRL_FILE_STATUS -Corresponds to an entry in dpkg's status file (/var/lib/dpkg/status). +Corresponds to an entry in dpkg's status file ($Dpkg::ADMINDIR/status). =item CTRL_CHANGELOG diff --git a/scripts/Dpkg/Control/Types.pm b/scripts/Dpkg/Control/Types.pm index 7a2ec63be..433a71360 100644 --- a/scripts/Dpkg/Control/Types.pm +++ b/scripts/Dpkg/Control/Types.pm @@ -47,7 +47,7 @@ use constant { CTRL_PKG_DEB => 32, # DEBIAN/control in binary packages CTRL_FILE_CHANGES => 64, # .changes file CTRL_FILE_VENDOR => 128, # File in $Dpkg::CONFDIR/origins - CTRL_FILE_STATUS => 256, # /var/lib/dpkg/status + CTRL_FILE_STATUS => 256, # $Dpkg::ADMINDIR/status CTRL_CHANGELOG => 512, # Output of dpkg-parsechangelog }; diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm index 0584add61..939721020 100644 --- a/scripts/Dpkg/ErrorHandling.pm +++ b/scripts/Dpkg/ErrorHandling.pm @@ -18,7 +18,7 @@ use warnings; our $VERSION = '0.01'; -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use base qw(Exporter); @@ -46,7 +46,7 @@ sub report(@) my ($type, $msg) = (shift, shift); $msg = sprintf($msg, @_) if (@_); - return "$progname: $type: $msg\n"; + return "$Dpkg::PROGNAME: $type: $msg\n"; } sub info($;@) @@ -102,7 +102,7 @@ sub usageerr(@) my ($msg) = (shift); $msg = sprintf($msg, @_) if (@_); - warn "$progname: $msg\n\n"; + warn "$Dpkg::PROGNAME: $msg\n\n"; # XXX: access to main namespace main::usage(); exit(2); diff --git a/scripts/Dpkg/Source/Package/V1.pm b/scripts/Dpkg/Source/Package/V1.pm index 83b43c45b..596c44e80 100644 --- a/scripts/Dpkg/Source/Package/V1.pm +++ b/scripts/Dpkg/Source/Package/V1.pm @@ -22,7 +22,7 @@ our $VERSION = '0.01'; use base 'Dpkg::Source::Package'; -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Compression; @@ -387,7 +387,7 @@ sub do_build { if ($ur) { printf(STDERR _g('%s: unrepresentable changes to source') . "\n", - $progname); + $Dpkg::PROGNAME); exit(1); } } diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm index 43eb1ad1c..f8c45977f 100644 --- a/scripts/Dpkg/Substvars.pm +++ b/scripts/Dpkg/Substvars.pm @@ -21,7 +21,7 @@ use warnings; our $VERSION = '1.02'; -use Dpkg qw($version); +use Dpkg qw(); use Dpkg::Arch qw(get_host_arch); use Dpkg::ErrorHandling; use Dpkg::Gettext; @@ -70,8 +70,8 @@ sub new { 'Newline' => "\n", 'Space' => ' ', 'Tab' => "\t", - 'dpkg:Version' => $version, - 'dpkg:Upstream-Version' => $version, + 'dpkg:Version' => $Dpkg::PROGVERSION, + 'dpkg:Upstream-Version' => $Dpkg::PROGVERSION, }, used => {}, msg_prefix => '', diff --git a/scripts/Makefile.am b/scripts/Makefile.am index ee31b1f3a..9d1f3f2bb 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -116,10 +116,10 @@ man3_MANS = do_perl_subst = $(AM_V_GEN) \ sed -e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL):" \ -e "s:\$$CONFDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$CONFDIR='$(pkgconfdir)':" \ - -e "s:\$$dpkglibdir[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$dpkglibdir='$(pkglibdir)':" \ - -e "s:\$$pkgdatadir[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$pkgdatadir='$(pkgdatadir)':" \ - -e "s:\$$admindir[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$admindir='$(admindir)':" \ - -e "s:\$$version[[:space:]]*=[[:space:]]*['\"][^'\"]*[\"']:\$$version='$(PACKAGE_VERSION)':" + -e "s:\$$ADMINDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$ADMINDIR='$(admindir)':" \ + -e "s:\$$LIBDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$LIBDIR='$(pkglibdir)':" \ + -e "s:\$$DATADIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$DATADIR='$(pkgdatadir)':" \ + -e "s:\$$PROGVERSION[[:space:]]*=[[:space:]]*['\"][^'\"]*[\"']:\$$PROGVERSION='$(PACKAGE_VERSION)':" do_shell_subst = $(AM_V_GEN) \ sed -e "s:^version[[:space:]]*=[[:space:]]*['\"][^'\"]*[\"']:version=\"$(PACKAGE_VERSION)\":" diff --git a/scripts/changelog/debian.pl b/scripts/changelog/debian.pl index cf6e9bf24..7e7c10fa3 100755 --- a/scripts/changelog/debian.pl +++ b/scripts/changelog/debian.pl @@ -24,17 +24,17 @@ use warnings; use Getopt::Long qw(:config posix_default bundling no_ignorecase); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Changelog::Debian; textdomain('dpkg-dev'); -$progname = "parsechangelog/$progname"; +$Dpkg::PROGNAME = "parsechangelog/$Dpkg::PROGNAME"; sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -68,7 +68,7 @@ Options: counted from the top (or the tail if <number> is lower than 0) --all include all changes -"), $progname; +"), $Dpkg::PROGNAME; } my ( $since, $until, $from, $to, $all, $count, $offset, $file, $label ); diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index 769aaffd0..d69f92989 100755 --- a/scripts/dpkg-architecture.pl +++ b/scripts/dpkg-architecture.pl @@ -22,7 +22,7 @@ use strict; use warnings; -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_gcc_host_gnu_type @@ -34,7 +34,7 @@ use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_gcc_host_gnu_type textdomain('dpkg-dev'); sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -62,7 +62,7 @@ sub usage { -c <command> set environment and run the command in it. -?, --help show this help message. --version show the version. -'), $progname; +'), $Dpkg::PROGNAME; } sub list_arches() diff --git a/scripts/dpkg-buildflags.pl b/scripts/dpkg-buildflags.pl index b43bc9e78..723a3b08b 100755 --- a/scripts/dpkg-buildflags.pl +++ b/scripts/dpkg-buildflags.pl @@ -21,7 +21,7 @@ use strict; use warnings; -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling qw(:DEFAULT report); use Dpkg::BuildFlags; @@ -30,7 +30,7 @@ use Dpkg::Vendor qw(get_current_vendor); textdomain('dpkg-dev'); sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -58,7 +58,7 @@ sub usage { and their origin. --help show this help message. --version show the version. -'), $progname; +'), $Dpkg::PROGNAME; } my ($param, $action); diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index e557c93aa..5606e7a3e 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -27,7 +27,7 @@ use Cwd; use File::Basename; use POSIX qw(:sys_wait_h); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::BuildOptions; @@ -40,7 +40,7 @@ use Dpkg::IPC; textdomain('dpkg-dev'); sub showversion { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; print _g(' This is free software; see the GNU General Public License version 2 or @@ -105,7 +105,7 @@ sub usage { -I[<pattern>] filter out files when building tarballs. --source-option=<opt> pass option <opt> to dpkg-source. -'), $progname; +'), $Dpkg::PROGNAME; } my @debian_rules = ('debian/rules'); @@ -507,7 +507,7 @@ chdir($dir) or syserr("chdir $dir"); if (not $signreleased) { warning(_g('not signing UNRELEASED build; use --force-sign to override')); } -print "$progname: $srcmsg\n"; +print "$Dpkg::PROGNAME: $srcmsg\n"; if ($signerrors) { warning($signerrors); exit 1; @@ -519,7 +519,7 @@ sub mustsetvar { error(_g('unable to determine %s'), $text) unless defined($var); - print "$progname: $text $var\n"; + print "$Dpkg::PROGNAME: $text $var\n"; return $var; } diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl index 3b717fb9e..242f6666f 100755 --- a/scripts/dpkg-checkbuilddeps.pl +++ b/scripts/dpkg-checkbuilddeps.pl @@ -24,7 +24,7 @@ use warnings; use Getopt::Long qw(:config posix_default bundling no_ignorecase); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Arch qw(get_host_arch); @@ -35,7 +35,7 @@ textdomain('dpkg-dev'); sub version() { - printf(_g("Debian %s version %s.\n"), $progname, $version); + printf(_g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION); exit(0); } @@ -57,13 +57,14 @@ sub usage { --version show the version.') . "\n\n" . _g( '<control-file> is the control file to process (default: debian/control).') - . "\n", $progname; + . "\n", $Dpkg::PROGNAME; } my $ignore_bd_arch = 0; my $ignore_bd_indep = 0; my ($bd_value, $bc_value); my $host_arch = get_host_arch(); +my $admindir = $Dpkg::ADMINDIR; if (!GetOptions('A' => \$ignore_bd_arch, 'B' => \$ignore_bd_indep, 'help|?' => sub { usage(); exit(0); }, @@ -108,11 +109,11 @@ if ($bc_value) { } if (@unmet) { - printf STDERR _g('%s: Unmet build dependencies: '), $progname; + printf STDERR _g('%s: Unmet build dependencies: '), $Dpkg::PROGNAME; print STDERR join(' ', map { $_->output() } @unmet), "\n"; } if (@conflicts) { - printf STDERR _g('%s: Build conflicts: '), $progname; + printf STDERR _g('%s: Build conflicts: '), $Dpkg::PROGNAME; print STDERR join(' ', map { $_->output() } @conflicts), "\n"; } exit 1 if @unmet || @conflicts; diff --git a/scripts/dpkg-distaddfile.pl b/scripts/dpkg-distaddfile.pl index 272f75435..5dd24dd75 100755 --- a/scripts/dpkg-distaddfile.pl +++ b/scripts/dpkg-distaddfile.pl @@ -22,7 +22,7 @@ use strict; use warnings; use POSIX qw(:errno_h :fcntl_h); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::File; @@ -33,7 +33,7 @@ my $fileslistfile = 'debian/files'; sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -49,7 +49,7 @@ Options: -f<files-list-file> write files here instead of debian/files. -?, --help show this help message. --version show the version. -'), $progname; +'), $Dpkg::PROGNAME; } while (@ARGV && $ARGV[0] =~ m/^-/) { diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 53caa325f..13e685c85 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -24,7 +24,7 @@ use warnings; use Encode; use POSIX qw(:errno_h); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::File; use Dpkg::Checksums; @@ -97,7 +97,7 @@ sub binary_opt() { return (($include == BIN) ? '-b' : } sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -133,7 +133,7 @@ sub usage { -U<field> remove a field. -?, --help show this help message. --version show the version. -"), $progname; +"), $Dpkg::PROGNAME; } @@ -145,11 +145,11 @@ while (@ARGV) { } elsif (m/^-B$/) { is_sourceonly && usageerr(_g('cannot combine %s and %s'), $_, '-S'); $include = ARCH_DEP; - printf STDERR _g('%s: arch-specific upload - not including arch-independent packages') . "\n", $progname; + printf STDERR _g('%s: arch-specific upload - not including arch-independent packages') . "\n", $Dpkg::PROGNAME; } elsif (m/^-A$/) { is_sourceonly && usageerr(_g('cannot combine %s and %s'), $_, '-S'); $include = ARCH_INDEP; - printf STDERR _g('%s: arch-indep upload - not including arch-specific packages') . "\n", $progname; + printf STDERR _g('%s: arch-indep upload - not including arch-specific packages') . "\n", $Dpkg::PROGNAME; } elsif (m/^-S$/) { is_binaryonly && usageerr(_g('cannot combine %s and %s'), binary_opt, '-S'); $include = SOURCE; @@ -443,7 +443,7 @@ if (!is_binaryonly) { $origsrcmsg= _g('binary-only upload - not including any source code'); } -print(STDERR "$progname: $origsrcmsg\n") || +print(STDERR "$Dpkg::PROGNAME: $origsrcmsg\n") || syserr(_g('write original source message')) unless $quiet; $fields->{'Format'} = $substvars->get('Format'); diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 7ac0c7d9c..5cc3b764b 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -23,7 +23,7 @@ use strict; use warnings; use POSIX qw(:errno_h :fcntl_h); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::File; @@ -59,7 +59,7 @@ my $substvars_loaded = 0; sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -88,7 +88,7 @@ sub usage { -T<substvars-file> read variables here, not debian/substvars. -?, --help show this help message. --version show the version. -'), $progname; +'), $Dpkg::PROGNAME; } while (@ARGV) { diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl index 34334da17..28a788da5 100755 --- a/scripts/dpkg-gensymbols.pl +++ b/scripts/dpkg-gensymbols.pl @@ -21,7 +21,7 @@ use strict; use warnings; -use Dpkg; +use Dpkg qw(); use Dpkg::Arch qw(get_host_arch); use Dpkg::Package; use Dpkg::Shlibs qw(@librarypaths); @@ -50,7 +50,7 @@ my $debug = 0; my $host_arch = get_host_arch(); sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -88,7 +88,7 @@ sub usage { -d display debug information during work. -?, --help show this help message. --version show the version. -'), $progname; +'), $Dpkg::PROGNAME; } my @files; diff --git a/scripts/dpkg-mergechangelogs.pl b/scripts/dpkg-mergechangelogs.pl index 997786945..0dc4f62dd 100755 --- a/scripts/dpkg-mergechangelogs.pl +++ b/scripts/dpkg-mergechangelogs.pl @@ -19,7 +19,7 @@ use warnings; use strict; -use Dpkg; +use Dpkg qw(); use Dpkg::Changelog::Debian; use Dpkg::ErrorHandling; use Dpkg::Gettext; @@ -51,7 +51,7 @@ BEGIN { } sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf "\n" . _g( 'This is free software; see the GNU General Public License version 2 or @@ -68,7 +68,7 @@ Options: after the last '~' in the version. -?, --help show this help message. --version show the version. -"), $progname); +"), $Dpkg::PROGNAME); } my $merge_prereleases; diff --git a/scripts/dpkg-name.pl b/scripts/dpkg-name.pl index 9e9caf702..c83221d89 100755 --- a/scripts/dpkg-name.pl +++ b/scripts/dpkg-name.pl @@ -24,7 +24,7 @@ use strict; use File::Basename; use File::Path; -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control; @@ -43,12 +43,12 @@ my %options = ( sub version() { - printf(_g("Debian %s version %s.\n"), $progname, $version); + printf(_g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION); } sub usage() { - printf(_g("Usage: %s [<option>...] <file>...\n"), $progname); + printf(_g("Usage: %s [<option>...] <file>...\n"), $Dpkg::PROGNAME); print(_g(" Options: diff --git a/scripts/dpkg-parsechangelog.pl b/scripts/dpkg-parsechangelog.pl index ef94982a0..257524f67 100755 --- a/scripts/dpkg-parsechangelog.pl +++ b/scripts/dpkg-parsechangelog.pl @@ -22,7 +22,7 @@ use strict; use warnings; -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Changelog::Parse; @@ -33,7 +33,7 @@ my %options; my $fieldname; sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -71,7 +71,7 @@ sub usage { -o<number> counted from the top (or the tail if <number> is lower than 0) --all include all changes -"), $progname; +"), $Dpkg::PROGNAME; } while (@ARGV) { diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl index 1dec6e519..d2d528d3f 100755 --- a/scripts/dpkg-scanpackages.pl +++ b/scripts/dpkg-scanpackages.pl @@ -24,7 +24,7 @@ use IO::Handle; use IO::File; use Getopt::Long qw(:config posix_default bundling no_ignorecase); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control; @@ -58,7 +58,7 @@ my $result = GetOptions(\%options, 'medium|M=s'); sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; exit; } @@ -75,7 +75,7 @@ Options: -M, --medium <medium> add X-Medium field for dselect multicd access method -?, --help show this help message. --version show the version. -"), $progname; +"), $Dpkg::PROGNAME; } sub load_override diff --git a/scripts/dpkg-scansources.pl b/scripts/dpkg-scansources.pl index 7045738ed..f7d5b5bec 100755 --- a/scripts/dpkg-scansources.pl +++ b/scripts/dpkg-scansources.pl @@ -22,7 +22,7 @@ use warnings; use Getopt::Long qw(:config posix_default bundling no_ignorecase); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Control; @@ -75,7 +75,7 @@ sub debug { } sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; exit; } @@ -95,7 +95,7 @@ Options: --version show the version. See the man page for the full documentation. -"), $progname; +"), $Dpkg::PROGNAME; exit; } diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 853fb991c..47a08f8c9 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -28,7 +28,7 @@ use POSIX qw(:errno_h); use Cwd qw(realpath); use File::Basename qw(dirname); -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Path qw(relative_to_pkg_root guess_pkg_root_dir @@ -55,6 +55,7 @@ my $i = 0; my %depstrength = map { $_ => $i++ } @depfields; textdomain('dpkg-dev'); +my $admindir = $Dpkg::ADMINDIR; my $shlibsoverride = "$Dpkg::CONFDIR/shlibs.override"; my $shlibsdefault = "$Dpkg::CONFDIR/shlibs.default"; my $shlibslocal = 'debian/shlibs.local'; @@ -539,7 +540,7 @@ if (!$stdout) { ## sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -574,7 +575,7 @@ sub usage { . "\n\n" . _g( 'Dependency fields recognized are: %s -'), $progname, join('/', @depfields); +'), $Dpkg::PROGNAME, join('/', @depfields); } sub get_min_version_from_deps { diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 7018361e9..4ba4de814 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -28,7 +28,7 @@ use strict; use warnings; -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Arch qw(debarch_eq debarch_is debarch_is_wildcard); @@ -464,7 +464,7 @@ sub setopmode { } sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; print _g(' This is free software; see the GNU General Public License version 2 or @@ -514,7 +514,7 @@ sub usage { . "\n\n" . _g( 'More options are available but they depend on the source package format. See dpkg-source(1) for more info.') . "\n", - $progname, + $Dpkg::PROGNAME, $Dpkg::Source::Package::diff_ignore_default_regexp, join(' ', map { "-I$_" } @Dpkg::Source::Package::tar_ignore_default_pattern), compression_get_default(), diff --git a/scripts/dpkg-vendor.pl b/scripts/dpkg-vendor.pl index 6eaf4ddcd..fcff4b196 100755 --- a/scripts/dpkg-vendor.pl +++ b/scripts/dpkg-vendor.pl @@ -21,7 +21,7 @@ use strict; use warnings; -use Dpkg; +use Dpkg qw(); use Dpkg::Gettext; use Dpkg::ErrorHandling; use Dpkg::Vendor qw(get_vendor_dir get_vendor_info get_current_vendor); @@ -29,7 +29,7 @@ use Dpkg::Vendor qw(get_vendor_dir get_vendor_info get_current_vendor); textdomain('dpkg-dev'); sub version { - printf _g("Debian %s version %s.\n"), $progname, $version; + printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION; printf _g(' This is free software; see the GNU General Public License version 2 or @@ -50,7 +50,7 @@ sub usage { --query <field> print the content of the vendor-specific field. --help show this help message. --version show the version. -'), $progname; +'), $Dpkg::PROGNAME; } my ($vendor, $param, $action); diff --git a/scripts/t/750_Dpkg_Substvars.t b/scripts/t/750_Dpkg_Substvars.t index ddfae716f..fb9b9761f 100644 --- a/scripts/t/750_Dpkg_Substvars.t +++ b/scripts/t/750_Dpkg_Substvars.t @@ -18,7 +18,7 @@ use Test::More tests => 32; use strict; use warnings; -use Dpkg qw($version); +use Dpkg qw(); use Dpkg::Arch qw(get_host_arch); use_ok('Dpkg::Substvars'); @@ -48,7 +48,7 @@ is($s->get('var3'), undef, 'var3 deleted'); is($s->get('Newline'), "\n", 'newline'); is($s->get('Space'), ' ', 'space'); is($s->get('Tab'), "\t", 'tab'); -is($s->get('dpkg:Version'), $version, 'dpkg version 1'); +is($s->get('dpkg:Version'), $Dpkg::PROGVERSION, 'dpkg version 1'); # special variables is($s->get('Arch'), undef, 'no arch'); |