Sfoglia il codice sorgente

scripts: Inherit from parent instead of base

Use the lightweight parent instead of the bloated base.
Guillem Jover 13 anni fa
parent
commit
e4dbdb8448

+ 1 - 1
scripts/Dpkg/Changelog.pm

@@ -48,7 +48,7 @@ use Dpkg::Index;
 use Dpkg::Version;
 use Dpkg::Vendor qw(run_vendor_hook);
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 use overload
     '@{}' => sub { return $_[0]->{data} };

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

@@ -48,7 +48,7 @@ our $VERSION = '1.00';
 use Dpkg::Gettext;
 use Dpkg::File;
 use Dpkg::Changelog qw(:util);
-use base qw(Dpkg::Changelog);
+use parent qw(Dpkg::Changelog);
 use Dpkg::Changelog::Entry::Debian qw($regex_header $regex_trailer);
 
 use constant {

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

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

+ 1 - 1
scripts/Dpkg/Compression/FileHandle.pm

@@ -26,7 +26,7 @@ use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 use POSIX qw(:signal_h :sys_wait_h);
 
-use base qw(FileHandle Tie::Handle);
+use parent qw(FileHandle Tie::Handle);
 
 # Useful reference to understand some kludges required to
 # have the object behave like a filehandle

+ 1 - 1
scripts/Dpkg/Conf.pm

@@ -23,7 +23,7 @@ our $VERSION = '1.01';
 use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 use overload
     '@{}' => sub { return [ $_[0]->get_options() ] },

+ 1 - 1
scripts/Dpkg/Control.pm

@@ -28,7 +28,7 @@ use Dpkg::Control::Fields;
 
 use Exporter qw(import);
 
-use base qw(Dpkg::Control::Hash);
+use parent 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

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

@@ -21,7 +21,7 @@ use warnings;
 our $VERSION = '1.00';
 
 use Dpkg::Control;
-use base 'Dpkg::Control';
+use parent qw(Dpkg::Control);
 
 =encoding utf8
 

+ 2 - 2
scripts/Dpkg/Control/Hash.pm

@@ -28,7 +28,7 @@ use Dpkg::ErrorHandling;
 # Dpkg::Control::Fields itself (Dpkg::Vendor)
 # That's why field_capitalize is duplicated
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 use overload
     '%{}' => sub { ${$_[0]}->{fields} },
@@ -401,7 +401,7 @@ package Dpkg::Control::Hash::Tie;
 use Dpkg::Checksums;
 
 use Tie::Hash;
-use base qw(Tie::ExtraHash);
+use parent -norequire, qw(Tie::ExtraHash);
 
 sub field_capitalize($) {
     my $field = lc(shift);

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

@@ -24,7 +24,7 @@ use Dpkg::Control;
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 use overload
     '@{}' => sub { return [ $_[0]->{source}, @{$_[0]->{packages}} ] };

+ 5 - 5
scripts/Dpkg/Deps.pm

@@ -551,7 +551,7 @@ use Dpkg::Version;
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 sub new {
     my ($this, $arg, %opts) = @_;
@@ -834,7 +834,7 @@ use warnings;
 
 use Dpkg::ErrorHandling;
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 sub new {
     my $this = shift;
@@ -924,7 +924,7 @@ The output method uses ", " to join the list of sub-dependencies.
 use strict;
 use warnings;
 
-use base qw(Dpkg::Deps::Multiple);
+use parent -norequire, qw(Dpkg::Deps::Multiple);
 
 sub output {
     my ($self, $fh) = @_;
@@ -1029,7 +1029,7 @@ The output method uses " | " to join the list of sub-dependencies.
 use strict;
 use warnings;
 
-use base qw(Dpkg::Deps::Multiple);
+use parent -norequire, qw(Dpkg::Deps::Multiple);
 
 sub output {
     my ($self, $fh) = @_;
@@ -1137,7 +1137,7 @@ It uses $simple_dep->merge_union($other_dep) to get its job done.
 use strict;
 use warnings;
 
-use base qw(Dpkg::Deps::Multiple);
+use parent -norequire, qw(Dpkg::Deps::Multiple);
 
 sub output {
     my ($self, $fh) = @_;

+ 1 - 1
scripts/Dpkg/Index.pm

@@ -25,7 +25,7 @@ use Dpkg::ErrorHandling;
 use Dpkg::Control;
 use Dpkg::Compression::FileHandle;
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 use overload
     '@{}' => sub { return $_[0]->{order} },

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

@@ -28,7 +28,7 @@ use Dpkg::Control::Fields;
 use Dpkg::Shlibs::Symbol;
 use Dpkg::Arch qw(get_host_arch);
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 my %blacklist = (
     __bss_end__ => 1,			# arm

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

@@ -30,7 +30,7 @@ use File::Basename qw(basename);
 use File::Spec;
 use Cwd;
 
-use base 'Dpkg::Compression::FileHandle';
+use parent qw(Dpkg::Compression::FileHandle);
 
 sub create {
     my ($self, %opts) = @_;

+ 1 - 1
scripts/Dpkg/Source/Package/V1.pm

@@ -20,7 +20,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base 'Dpkg::Source::Package';
+use parent qw(Dpkg::Source::Package);
 
 use Dpkg qw();
 use Dpkg::Gettext;

+ 1 - 1
scripts/Dpkg/Source/Package/V2.pm

@@ -20,7 +20,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base 'Dpkg::Source::Package';
+use parent qw(Dpkg::Source::Package);
 
 use Dpkg;
 use Dpkg::Gettext;

+ 1 - 1
scripts/Dpkg/Source/Package/V3/Bzr.pm

@@ -26,7 +26,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base 'Dpkg::Source::Package';
+use parent qw(Dpkg::Source::Package);
 
 use Cwd;
 use File::Basename;

+ 1 - 1
scripts/Dpkg/Source/Package/V3/Custom.pm

@@ -20,7 +20,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base 'Dpkg::Source::Package';
+use parent qw(Dpkg::Source::Package);
 
 use Dpkg;
 use Dpkg::Gettext;

+ 1 - 1
scripts/Dpkg/Source/Package/V3/Git.pm

@@ -24,7 +24,7 @@ use warnings;
 
 our $VERSION = '0.02';
 
-use base 'Dpkg::Source::Package';
+use parent qw(Dpkg::Source::Package);
 
 use Cwd qw(abs_path getcwd);
 use File::Basename;

+ 1 - 1
scripts/Dpkg/Source/Package/V3/Native.pm

@@ -20,7 +20,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base 'Dpkg::Source::Package';
+use parent qw(Dpkg::Source::Package);
 
 use Dpkg;
 use Dpkg::Gettext;

+ 1 - 1
scripts/Dpkg/Source/Package/V3/Quilt.pm

@@ -21,7 +21,7 @@ use warnings;
 our $VERSION = '0.01';
 
 # Based on wig&pen implementation
-use base 'Dpkg::Source::Package::V2';
+use parent qw(Dpkg::Source::Package::V2);
 
 use Dpkg;
 use Dpkg::Gettext;

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

@@ -36,7 +36,7 @@ use Fcntl ':mode';
 #XXX: Needed for sub-second timestamps, require recent perl
 #use Time::HiRes qw(stat);
 
-use base 'Dpkg::Compression::FileHandle';
+use parent qw(Dpkg::Compression::FileHandle);
 
 sub create {
     my ($self, %opts) = @_;

+ 1 - 1
scripts/Dpkg/Substvars.pm

@@ -29,7 +29,7 @@ use Dpkg::Gettext;
 use Carp;
 use POSIX qw(:errno_h);
 
-use base qw(Dpkg::Interface::Storable);
+use parent qw(Dpkg::Interface::Storable);
 
 my $maxsubsts = 50;
 

+ 1 - 1
scripts/Dpkg/Vendor/Debian.pm

@@ -24,7 +24,7 @@ use warnings;
 
 our $VERSION = '0.01';
 
-use base qw(Dpkg::Vendor::Default);
+use parent qw(Dpkg::Vendor::Default);
 
 use Dpkg::Gettext;
 use Dpkg::ErrorHandling;

+ 1 - 1
scripts/Dpkg/Vendor/Default.pm

@@ -22,7 +22,7 @@ our $VERSION = '0.01';
 
 # If you use this file as template to create a new vendor object, please
 # uncomment the following lines
-#use base qw(Dpkg::Vendor::Default);
+#use parent qw(Dpkg::Vendor::Default);
 
 =encoding utf8
 

+ 1 - 1
scripts/Dpkg/Vendor/Ubuntu.pm

@@ -31,7 +31,7 @@ use Dpkg::Control::Types;
 use Dpkg::BuildOptions;
 use Dpkg::Arch qw(debarch_eq get_host_arch);
 
-use base 'Dpkg::Vendor::Debian';
+use parent qw(Dpkg::Vendor::Debian);
 
 =encoding utf8