summaryrefslogtreecommitdiff
path: root/scripts/Dpkg.pm
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2013-01-02 00:39:08 +0100
committerGuillem Jover <guillem@debian.org>2013-06-22 05:07:34 +0200
commitfb5285f56924fdf84d3281bbf6046f8b4bb00048 (patch)
treea3030aec8a2891a811d7803034a383dd8c33c6ed /scripts/Dpkg.pm
parenta55de1500d33db1192e5c2ace48e58baf252f8b9 (diff)
downloaddpkg-fb5285f56924fdf84d3281bbf6046f8b4bb00048.tar.gz
Dpkg: Deprecate lowercase exported by default variables
Rename, uppercase and do not export new variables by default, to avoid cluttering the caller namespace, and to give them consistent names. We'll keep the old variables for a while, to not break uses from external modules. Addresses Variables::ProhibitPackageVars.
Diffstat (limited to 'scripts/Dpkg.pm')
-rw-r--r--scripts/Dpkg.pm24
1 files changed, 16 insertions, 8 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;