Просмотр исходного кода

scripts: Do not inherit from Exporter just import its import

Do not use base which is bloated, and we don't need any other of
Exporter's inherited methods anyway.
Guillem Jover лет назад: 13
Родитель
Сommit
e54df633c6

+ 1 - 1
scripts/Dpkg.pm

@@ -18,7 +18,7 @@ use warnings;
 
 our $VERSION = '1.01';
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT_OK = qw($PROGNAME $PROGVERSION $CONFDIR $ADMINDIR $LIBDIR $DATADIR);
 our @EXPORT = qw($version $progname $admindir $dpkglibdir $pkgdatadir);
 

+ 1 - 1
scripts/Dpkg/Arch.pm

@@ -20,7 +20,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT_OK = qw(get_raw_build_arch get_raw_host_arch
                     get_build_arch get_host_arch get_gcc_host_gnu_type
                     get_valid_arches debarch_eq debarch_is debarch_is_wildcard

+ 2 - 2
scripts/Dpkg/Changelog/Entry/Debian.pm

@@ -20,9 +20,9 @@ use warnings;
 
 our $VERSION = '1.00';
 
-use Exporter;
+use Exporter qw(import);
 use Dpkg::Changelog::Entry;
-use base qw(Exporter Dpkg::Changelog::Entry);
+use base qw(Dpkg::Changelog::Entry);
 our @EXPORT_OK = qw($regex_header $regex_trailer find_closes);
 
 use Date::Parse;

+ 1 - 1
scripts/Dpkg/Changelog/Parse.pm

@@ -41,7 +41,7 @@ use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 use Dpkg::Control::Changelog;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(changelog_parse);
 
 =head3 my $fields = changelog_parse(%opt)

+ 1 - 1
scripts/Dpkg/Checksums.pm

@@ -26,7 +26,7 @@ use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 use Dpkg::IPC;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(checksums_get_list checksums_is_supported
 		 checksums_get_property);
 

+ 1 - 1
scripts/Dpkg/Compression.pm

@@ -23,7 +23,7 @@ our $VERSION = '1.01';
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw($compression_re_file_ext compression_get_list
 		 compression_is_supported compression_get_property
 		 compression_guess_from_filename

+ 4 - 1
scripts/Dpkg/Control.pm

@@ -26,7 +26,10 @@ use Dpkg::Control::Types;
 use Dpkg::Control::Hash;
 use Dpkg::Control::Fields;
 
-use base qw(Dpkg::Control::Hash Exporter);
+use Exporter qw(import);
+
+use base qw(Dpkg::Control::Hash);
+
 our @EXPORT = qw(CTRL_UNKNOWN CTRL_INFO_SRC CTRL_INFO_PKG CTRL_INDEX_SRC
                  CTRL_INDEX_PKG CTRL_PKG_SRC CTRL_PKG_DEB CTRL_FILE_CHANGES
                  CTRL_FILE_VENDOR CTRL_FILE_STATUS CTRL_CHANGELOG);

+ 1 - 1
scripts/Dpkg/Control/Fields.pm

@@ -20,7 +20,7 @@ use warnings;
 
 our $VERSION = '1.00';
 
-use base qw(Exporter);
+use Exporter qw(import);
 use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 use Dpkg::Control::Types;

+ 1 - 1
scripts/Dpkg/Control/Types.pm

@@ -16,7 +16,7 @@ package Dpkg::Control::Types;
 use strict;
 use warnings;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(CTRL_UNKNOWN CTRL_INFO_SRC CTRL_INFO_PKG CTRL_INDEX_SRC
                  CTRL_INDEX_PKG CTRL_PKG_SRC CTRL_PKG_DEB CTRL_FILE_CHANGES
                  CTRL_FILE_VENDOR CTRL_FILE_STATUS CTRL_CHANGELOG);

+ 1 - 1
scripts/Dpkg/Deps.pm

@@ -56,7 +56,7 @@ use Dpkg::Arch qw(get_host_arch get_build_arch);
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(deps_concat deps_parse deps_eval_implication deps_compare);
 
 # Some factorized function

+ 1 - 1
scripts/Dpkg/ErrorHandling.pm

@@ -21,7 +21,7 @@ our $VERSION = '0.01';
 use Dpkg qw();
 use Dpkg::Gettext;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(report_options info warning error errormsg
                  syserr internerr subprocerr usageerr syntaxerr);
 our @EXPORT_OK = qw(report);

+ 1 - 1
scripts/Dpkg/File.pm

@@ -25,7 +25,7 @@ use Fcntl qw(:flock);
 use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(file_lock file_slurp);
 
 sub file_lock($$) {

+ 1 - 1
scripts/Dpkg/Gettext.pm

@@ -60,7 +60,7 @@ BEGIN {
 	}
 }
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT=qw(_g P_ textdomain ngettext);
 
 1;

+ 1 - 1
scripts/Dpkg/IPC.pm

@@ -24,7 +24,7 @@ our $VERSION = '1.00';
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(spawn wait_child);
 
 =encoding utf8

+ 1 - 1
scripts/Dpkg/Package.pm

@@ -23,7 +23,7 @@ our $VERSION = '0.01';
 
 use Dpkg::Gettext;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(pkg_name_is_illegal);
 
 sub pkg_name_is_illegal($) {

+ 1 - 1
scripts/Dpkg/Path.pm

@@ -21,7 +21,7 @@ use warnings;
 
 our $VERSION = '1.02';
 
-use base qw(Exporter);
+use Exporter qw(import);
 use File::Spec;
 use Cwd qw(realpath);
 

+ 1 - 1
scripts/Dpkg/Shlibs.pm

@@ -20,7 +20,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT_OK = qw(@librarypaths find_library);
 
 use File::Spec;

+ 1 - 1
scripts/Dpkg/Shlibs/Cppfilt.pm

@@ -20,7 +20,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base 'Exporter';
+use Exporter qw(import);
 
 use Dpkg::ErrorHandling;
 use Dpkg::IPC;

+ 1 - 1
scripts/Dpkg/Source/Functions.pm

@@ -18,7 +18,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT_OK = qw(erasedir fixperms fs_time is_binary);
 
 use Dpkg::ErrorHandling;

+ 1 - 1
scripts/Dpkg/Vars.pm

@@ -25,7 +25,7 @@ use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 use Dpkg::Package;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw($sourcepackage set_source_package);
 
 our $sourcepackage;

+ 1 - 1
scripts/Dpkg/Vendor.pm

@@ -26,7 +26,7 @@ use Dpkg::Gettext;
 use Dpkg::BuildEnv;
 use Dpkg::Control::Hash;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT_OK = qw(get_vendor_info get_current_vendor get_vendor_file
                     get_vendor_dir get_vendor_object run_vendor_hook);
 

+ 1 - 1
scripts/Dpkg/Version.pm

@@ -26,7 +26,7 @@ our $VERSION = '1.00';
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 
-use base qw(Exporter);
+use Exporter qw(import);
 our @EXPORT = qw(version_compare version_compare_relation
                  version_normalize_relation version_compare_string
                  version_compare_part version_split_digits version_check