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

Dpkg: Use shift instead of @_ on single argument unpacking

Guillem Jover лет назад: 11
Родитель
Сommit
ea1357d0f1
43 измененных файлов с 135 добавлено и 125 удалено
  1. 8 8
      scripts/Dpkg/Arch.pm
  2. 2 2
      scripts/Dpkg/BuildEnv.pm
  3. 15 8
      scripts/Dpkg/BuildFlags.pm
  4. 1 1
      scripts/Dpkg/BuildOptions.pm
  5. 4 4
      scripts/Dpkg/Changelog.pm
  6. 4 4
      scripts/Dpkg/Changelog/Entry.pm
  7. 13 13
      scripts/Dpkg/Changelog/Entry/Debian.pm
  8. 4 3
      scripts/Dpkg/Checksums.pm
  9. 3 3
      scripts/Dpkg/Compression.pm
  10. 3 3
      scripts/Dpkg/Compression/FileHandle.pm
  11. 2 2
      scripts/Dpkg/Compression/Process.pm
  12. 1 1
      scripts/Dpkg/Conf.pm
  13. 1 1
      scripts/Dpkg/Control.pm
  14. 1 1
      scripts/Dpkg/Control/FieldsCore.pm
  15. 1 1
      scripts/Dpkg/Control/HashCore.pm
  16. 4 4
      scripts/Dpkg/Deps.pm
  17. 1 1
      scripts/Dpkg/Dist/Files.pm
  18. 1 1
      scripts/Dpkg/File.pm
  19. 2 2
      scripts/Dpkg/Index.pm
  20. 1 1
      scripts/Dpkg/Interface/Storable.pm
  21. 1 1
      scripts/Dpkg/Shlibs.pm
  22. 5 5
      scripts/Dpkg/Shlibs/Objdump.pm
  23. 1 1
      scripts/Dpkg/Shlibs/Symbol.pm
  24. 4 4
      scripts/Dpkg/Shlibs/SymbolFile.pm
  25. 2 1
      scripts/Dpkg/Source/Archive.pm
  26. 4 4
      scripts/Dpkg/Source/Functions.pm
  27. 6 6
      scripts/Dpkg/Source/Package.pm
  28. 2 1
      scripts/Dpkg/Source/Package/V1.pm
  29. 6 6
      scripts/Dpkg/Source/Package/V2.pm
  30. 2 2
      scripts/Dpkg/Source/Package/V3/Quilt.pm
  31. 2 2
      scripts/Dpkg/Source/Patch.pm
  32. 12 12
      scripts/Dpkg/Source/Quilt.pm
  33. 1 1
      scripts/Dpkg/Substvars.pm
  34. 1 1
      scripts/Dpkg/Vendor/Default.pm
  35. 1 1
      scripts/Dpkg/Vendor/Ubuntu.pm
  36. 2 2
      scripts/Dpkg/Version.pm
  37. 1 1
      scripts/dpkg-architecture.pl
  38. 3 3
      scripts/dpkg-buildpackage.pl
  39. 3 3
      scripts/dpkg-name.pl
  40. 1 1
      scripts/dpkg-source.pl
  41. 1 1
      scripts/t/Dpkg_Compression.t
  42. 1 1
      scripts/t/Dpkg_Control.t
  43. 1 1
      scripts/t/Dpkg_Deps.t

+ 8 - 8
scripts/Dpkg/Arch.pm

@@ -235,7 +235,7 @@ sub debtriplet_to_gnutriplet(@)
 
 sub gnutriplet_to_debtriplet($)
 {
-    my ($gnu) = @_;
+    my $gnu = shift;
     return unless defined($gnu);
     my ($gnu_cpu, $gnu_os) = split(/-/, $gnu, 2);
     return unless defined($gnu_cpu) && defined($gnu_os);
@@ -265,7 +265,7 @@ sub gnutriplet_to_debtriplet($)
 
 sub gnutriplet_to_multiarch($)
 {
-    my ($gnu) = @_;
+    my $gnu = shift;
     my ($cpu, $cdr) = split(/-/, $gnu, 2);
 
     if ($cpu =~ /^i[4567]86$/) {
@@ -277,7 +277,7 @@ sub gnutriplet_to_multiarch($)
 
 sub debarch_to_multiarch($)
 {
-    my ($arch) = @_;
+    my $arch = shift;
 
     return gnutriplet_to_multiarch(debarch_to_gnutriplet($arch));
 }
@@ -319,21 +319,21 @@ sub debarch_to_debtriplet($)
 
 sub debarch_to_gnutriplet($)
 {
-    my ($arch) = @_;
+    my $arch = shift;
 
     return debtriplet_to_gnutriplet(debarch_to_debtriplet($arch));
 }
 
 sub gnutriplet_to_debarch($)
 {
-    my ($gnu) = @_;
+    my $gnu = shift;
 
     return debtriplet_to_debarch(gnutriplet_to_debtriplet($gnu));
 }
 
 sub debwildcard_to_debtriplet($)
 {
-    my ($arch) = @_;
+    my $arch = shift;
     my @tuple = split /-/, $arch, 3;
 
     if (any { $_ eq 'any' } @tuple) {
@@ -351,7 +351,7 @@ sub debwildcard_to_debtriplet($)
 
 sub debarch_to_cpuattrs($)
 {
-    my ($arch) = @_;
+    my $arch = shift;
     my ($abi, $os, $cpu) = debarch_to_debtriplet($arch);
 
     if (defined($cpu)) {
@@ -399,7 +399,7 @@ sub debarch_is($$)
 
 sub debarch_is_wildcard($)
 {
-    my ($arch) = @_;
+    my $arch = shift;
 
     return 0 if $arch eq 'all';
 

+ 2 - 2
scripts/Dpkg/BuildEnv.pm

@@ -60,7 +60,7 @@ accessed.
 =cut
 
 sub get {
-    my ($varname) = @_;
+    my $varname = shift;
     $env_accessed{$varname} = 1;
     return $ENV{$varname};
 }
@@ -73,7 +73,7 @@ Record it as being accessed.
 =cut
 
 sub has {
-    my ($varname) = @_;
+    my $varname = shift;
     $env_accessed{$varname} = 1;
     return exists $ENV{$varname};
 }

+ 15 - 8
scripts/Dpkg/BuildFlags.pm

@@ -67,7 +67,8 @@ Reset the flags stored to the default set provided by the vendor.
 =cut
 
 sub load_vendor_defaults {
-    my ($self) = @_;
+    my $self = shift;
+
     $self->{options} = {};
     $self->{source} = {};
     $self->{features} = {};
@@ -118,7 +119,8 @@ Update flags from the system configuration.
 =cut
 
 sub load_system_config {
-    my ($self) = @_;
+    my $self = shift;
+
     $self->update_from_conffile("$Dpkg::CONFDIR/buildflags.conf", 'system');
 }
 
@@ -129,7 +131,8 @@ Update flags from the user configuration.
 =cut
 
 sub load_user_config {
-    my ($self) = @_;
+    my $self = shift;
+
     my $confdir = $ENV{XDG_CONFIG_HOME};
     $confdir ||= $ENV{HOME} . '/.config' if length $ENV{HOME};
     if (length $confdir) {
@@ -145,7 +148,8 @@ dpkg-buildflags(1) for details.
 =cut
 
 sub load_environment_config {
-    my ($self) = @_;
+    my $self = shift;
+
     foreach my $flag (keys %{$self->{flags}}) {
 	my $envvar = 'DEB_' . $flag . '_SET';
 	if (Dpkg::BuildEnv::has($envvar)) {
@@ -174,7 +178,8 @@ dpkg-buildflags(1) for details.
 =cut
 
 sub load_maintainer_config {
-    my ($self) = @_;
+    my $self = shift;
+
     foreach my $flag (keys %{$self->{flags}}) {
 	my $envvar = 'DEB_' . $flag . '_MAINT_SET';
 	if (Dpkg::BuildEnv::has($envvar)) {
@@ -205,7 +210,8 @@ default build flags defined by the vendor.
 =cut
 
 sub load_config {
-    my ($self) = @_;
+    my $self = shift;
+
     $self->load_system_config();
     $self->load_user_config();
     $self->load_environment_config();
@@ -360,7 +366,8 @@ true for).
 =cut
 
 sub get_feature_areas {
-    my ($self) = @_;
+    my $self = shift;
+
     return keys %{$self->{features}};
 }
 
@@ -429,7 +436,7 @@ Returns the list of flags stored in the object.
 =cut
 
 sub list {
-    my ($self) = @_;
+    my $self = shift;
     my @list = sort keys %{$self->{flags}};
     return @list;
 }

+ 1 - 1
scripts/Dpkg/BuildOptions.pm

@@ -70,7 +70,7 @@ Reset the object to not have any option (it's empty).
 =cut
 
 sub reset {
-    my ($self) = @_;
+    my $self = shift;
     $self->{options} = {};
     $self->{source} = {};
 }

+ 4 - 4
scripts/Dpkg/Changelog.pm

@@ -103,7 +103,7 @@ previous L<parse> runs.
 =cut
 
 sub reset_parse_errors {
-    my ($self) = @_;
+    my $self = shift;
     $self->{parse_errors} = [];
 }
 
@@ -159,7 +159,7 @@ the original line
 =cut
 
 sub get_parse_errors {
-    my ($self) = @_;
+    my $self = shift;
 
     if (wantarray) {
 	return @{$self->{parse_errors}};
@@ -194,7 +194,7 @@ sub set_unparsed_tail {
 }
 
 sub get_unparsed_tail {
-    my ($self) = @_;
+    my $self = shift;
     return $self->{unparsed_tail};
 }
 
@@ -411,7 +411,7 @@ entries selected by the range set at creation (or with set_options).
 =cut
 
 sub abort_early {
-    my ($self) = @_;
+    my $self = shift;
 
     my $data = $self->{data} or return;
     my $r = $self->{range} or return;

+ 4 - 4
scripts/Dpkg/Changelog/Entry.pm

@@ -55,7 +55,7 @@ until one has been successfully parsed or built from scratch.
 =cut
 
 sub new {
-    my ($this) = @_;
+    my $this = shift;
     my $class = ref($this) || $this;
 
     my $self = {
@@ -176,7 +176,7 @@ parts.
 =cut
 
 sub is_empty {
-    my ($self) = @_;
+    my $self = shift;
     return !(defined($self->{header}) || defined($self->{trailer}) ||
 	     scalar(@{$self->{changes}}));
 }
@@ -189,7 +189,7 @@ empty line to separate each part.
 =cut
 
 sub normalize {
-    my ($self) = @_;
+    my $self = shift;
     if (defined($self->{header})) {
 	$self->{header} =~ s/\s+$//g;
 	$self->{blank_after_header} = [''];
@@ -289,7 +289,7 @@ in the output format of C<dpkg-parsechangelog>.
 =cut
 
 sub get_dpkg_changes {
-    my ($self) = @_;
+    my $self = shift;
     my $header = $self->get_part('header') // '';
     $header =~ s/\s+$//;
     return "\n$header\n\n" . join("\n", @{$self->get_part('changes')});

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

@@ -78,7 +78,7 @@ following line necessarily starts a new item).
 =cut
 
 sub get_change_items {
-    my ($self) = @_;
+    my $self = shift;
     my (@items, @blanks, $item);
     foreach my $line (@{$self->get_part('changes')}) {
 	if ($line =~ /^\s*\*/) {
@@ -115,7 +115,7 @@ have been found.
 =cut
 
 sub check_header {
-    my ($self) = @_;
+    my $self = shift;
     my @errors;
     if (defined($self->{header}) and $self->{header} =~ $regex_header) {
 	my ($version, $options) = ($2, $4);
@@ -153,7 +153,7 @@ sub check_header {
 }
 
 sub check_trailer {
-    my ($self) = @_;
+    my $self = shift;
     my @errors;
     if (defined($self->{trailer}) and $self->{trailer} =~ $regex_trailer) {
 	if ($3 ne '  ') {
@@ -176,13 +176,13 @@ empty line to separate each part.
 =cut
 
 sub normalize {
-    my ($self) = @_;
+    my $self = shift;
     $self->SUPER::normalize();
     #XXX: recreate header/trailer
 }
 
 sub get_source {
-    my ($self) = @_;
+    my $self = shift;
     if (defined($self->{header}) and $self->{header} =~ $regex_header) {
 	return $1;
     }
@@ -190,7 +190,7 @@ sub get_source {
 }
 
 sub get_version {
-    my ($self) = @_;
+    my $self = shift;
     if (defined($self->{header}) and $self->{header} =~ $regex_header) {
 	return Dpkg::Version->new($2);
     }
@@ -198,7 +198,7 @@ sub get_version {
 }
 
 sub get_distributions {
-    my ($self) = @_;
+    my $self = shift;
     if (defined($self->{header}) and $self->{header} =~ $regex_header) {
 	my $value = $3;
 	$value =~ s/^\s+//;
@@ -210,7 +210,7 @@ sub get_distributions {
 }
 
 sub get_optional_fields {
-    my ($self) = @_;
+    my $self = shift;
     my $f = Dpkg::Control::Changelog->new();
     if (defined($self->{header}) and $self->{header} =~ $regex_header) {
 	my $options = $4;
@@ -229,7 +229,7 @@ sub get_optional_fields {
 }
 
 sub get_urgency {
-    my ($self) = @_;
+    my $self = shift;
     my $f = $self->get_optional_fields();
     if (exists $f->{Urgency}) {
 	$f->{Urgency} =~ s/\s.*$//;
@@ -239,7 +239,7 @@ sub get_urgency {
 }
 
 sub get_maintainer {
-    my ($self) = @_;
+    my $self = shift;
     if (defined($self->{trailer}) and $self->{trailer} =~ $regex_trailer) {
 	return "$1 <$2>";
     }
@@ -247,7 +247,7 @@ sub get_maintainer {
 }
 
 sub get_timestamp {
-    my ($self) = @_;
+    my $self = shift;
     if (defined($self->{trailer}) and $self->{trailer} =~ $regex_trailer) {
 	return $4;
     }
@@ -267,7 +267,7 @@ Checks if the line matches a valid changelog header line.
 =cut
 
 sub match_header {
-    my ($line) = @_;
+    my $line = shift;
 
     return $line =~ /$regex_header/;
 }
@@ -279,7 +279,7 @@ Checks if the line matches a valid changelog trailing line.
 =cut
 
 sub match_trailer {
-    my ($line) = @_;
+    my $line = shift;
 
     return $line =~ /$regex_trailer/;
 }

+ 4 - 3
scripts/Dpkg/Checksums.pm

@@ -83,7 +83,7 @@ supported. The checksum algorithm is case-insensitive.
 =cut
 
 sub checksums_is_supported($) {
-    my ($alg) = @_;
+    my $alg = shift;
     return exists $CHECKSUMS->{lc($alg)};
 }
 
@@ -137,7 +137,8 @@ as if it was newly created.
 =cut
 
 sub reset {
-    my ($self) = @_;
+    my $self = shift;
+
     $self->{files} = [];
     $self->{checksums} = {};
     $self->{size} = {};
@@ -272,7 +273,7 @@ Return the list of files whose checksums are stored in the object.
 =cut
 
 sub get_files {
-    my ($self) = @_;
+    my $self = shift;
     return @{$self->{files}};
 }
 

+ 3 - 3
scripts/Dpkg/Compression.pm

@@ -175,7 +175,7 @@ sub compression_get_default {
 }
 
 sub compression_set_default {
-    my ($method) = @_;
+    my $method = shift;
     error(g_('%s is not a supported compression'), $method)
             unless compression_is_supported($method);
     $default_compression = $method;
@@ -204,7 +204,7 @@ sub compression_get_default_level {
 }
 
 sub compression_set_default_level {
-    my ($level) = @_;
+    my $level = shift;
     error(g_('%s is not a compression level'), $level)
         if defined($level) and not compression_is_valid_level($level);
     $default_compression_level = $level;
@@ -218,7 +218,7 @@ Returns a boolean indicating whether $level is a valid compression level
 =cut
 
 sub compression_is_valid_level {
-    my ($level) = @_;
+    my $level = shift;
     return $level =~ /^([1-9]|fast|best)$/;
 }
 

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

@@ -363,7 +363,7 @@ method.
 =cut
 
 sub use_compression {
-    my ($self) = @_;
+    my $self = shift;
     my $comp = *$self->{compression};
     if ($comp eq 'none') {
 	return 0;
@@ -382,7 +382,7 @@ along in a derived object.
 =cut
 
 sub get_filehandle {
-    my ($self) = @_;
+    my $self = shift;
     return *$self->{file} if exists *$self->{file};
 }
 
@@ -426,7 +426,7 @@ sub open_for_read {
 }
 
 sub cleanup {
-    my ($self) = @_;
+    my $self = shift;
     my $cmdline = *$self->{compressor}{cmdline} // '';
     *$self->{compressor}->wait_end_process(nocheck => *$self->{allow_sigpipe});
     if (*$self->{allow_sigpipe}) {

+ 2 - 2
scripts/Dpkg/Compression/Process.pm

@@ -104,7 +104,7 @@ and its standard output.
 =cut
 
 sub get_compress_cmdline {
-    my ($self) = @_;
+    my $self = shift;
     my @prog = (@{compression_get_property($self->{compression}, 'comp_prog')});
     my $level = '-' . $self->{compression_level};
     $level = '--' . $self->{compression_level}
@@ -114,7 +114,7 @@ sub get_compress_cmdline {
 }
 
 sub get_uncompress_cmdline {
-    my ($self) = @_;
+    my $self = shift;
     return (@{compression_get_property($self->{compression}, 'decomp_prog')});
 }
 

+ 1 - 1
scripts/Dpkg/Conf.pm

@@ -78,7 +78,7 @@ Returns the list of options that can be parsed like @ARGV.
 =cut
 
 sub get_options {
-    my ($self) = @_;
+    my $self = shift;
     return @{$self->{options}};
 }
 

+ 1 - 1
scripts/Dpkg/Control.pm

@@ -185,7 +185,7 @@ set during new().
 =cut
 
 sub get_type {
-    my ($self) = @_;
+    my $self = shift;
     return $$self->{type};
 }
 

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

@@ -540,7 +540,7 @@ The list might be empty for types where the order does not matter much.
 =cut
 
 sub field_ordered_list($) {
-    my ($type) = @_;
+    my $type = shift;
     return @{$FIELD_ORDER{$type}} if exists $FIELD_ORDER{$type};
     return ();
 }

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

@@ -133,7 +133,7 @@ sub new {
 # that everything gets garbage-collected.
 
 sub DESTROY {
-    my ($self) = @_;
+    my $self = shift;
     delete $$self->{fields};
 }
 

+ 4 - 4
scripts/Dpkg/Deps.pm

@@ -564,7 +564,7 @@ sub new {
 }
 
 sub reset {
-    my ($self) = @_;
+    my $self = shift;
     $self->{package} = undef;
     $self->{relation} = undef;
     $self->{version} = undef;
@@ -826,7 +826,7 @@ sub reduce_arch {
 }
 
 sub has_arch_restriction {
-    my ($self) = @_;
+    my $self = shift;
     if (defined $self->{arches}) {
 	return $self->{package};
     } else {
@@ -940,7 +940,7 @@ sub new {
 }
 
 sub reset {
-    my ($self) = @_;
+    my $self = shift;
     $self->{list} = [];
 }
 
@@ -981,7 +981,7 @@ sub reduce_arch {
 }
 
 sub has_arch_restriction {
-    my ($self) = @_;
+    my $self = shift;
     my @res;
     foreach my $dep (@{$self->{list}}) {
 	push @res, $dep->has_arch_restriction();

+ 1 - 1
scripts/Dpkg/Dist/Files.pm

@@ -84,7 +84,7 @@ sub parse {
 }
 
 sub get_files {
-    my ($self) = @_;
+    my $self = shift;
 
     return map { $self->{files}->{$_} } @{$self->{order}};
 }

+ 1 - 1
scripts/Dpkg/File.pm

@@ -50,7 +50,7 @@ sub file_lock($$) {
 }
 
 sub file_slurp {
-    my ($fh) = @_;
+    my $fh = shift;
 
     local $/;
     my $data = <$fh>;

+ 2 - 2
scripts/Dpkg/Index.pm

@@ -127,7 +127,7 @@ set during new().
 =cut
 
 sub get_type {
-    my ($self) = @_;
+    my $self = shift;
     return $self->{type};
 }
 
@@ -187,7 +187,7 @@ object.
 =cut
 
 sub new_item {
-    my ($self) = @_;
+    my $self = shift;
     return Dpkg::Control->new(type => $self->{type});
 }
 

+ 1 - 1
scripts/Dpkg/Interface/Storable.pm

@@ -129,7 +129,7 @@ Return a string representation of the object.
 =cut
 
 sub _stringify {
-    my ($self) = @_;
+    my $self = shift;
     unless ($self->can('output')) {
 	croak ref($self) . ' cannot be stringified, it lacks the output method';
     }

+ 1 - 1
scripts/Dpkg/Shlibs.pm

@@ -108,7 +108,7 @@ sub parse_ldso_conf {
 }
 
 sub add_library_dir {
-    my ($dir) = @_;
+    my $dir = shift;
     unshift @librarypaths, $dir;
 }
 

+ 5 - 5
scripts/Dpkg/Shlibs/Objdump.pm

@@ -121,7 +121,7 @@ sub has_object {
 }
 
 sub is_elf {
-    my ($file) = @_;
+    my $file = shift;
     open(my $file_fh, '<', $file) or syserr(g_('cannot read %s'), $file);
     my ($header, $result) = ('', 0);
     if (read($file_fh, $header, 4) == 4) {
@@ -152,7 +152,7 @@ sub new {
 }
 
 sub reset {
-    my ($self) = @_;
+    my $self = shift;
 
     $self->{file} = '';
     $self->{id} = '';
@@ -346,7 +346,7 @@ sub parse_dynamic_symbol {
 }
 
 sub apply_relocations {
-    my ($self) = @_;
+    my $self = shift;
     foreach my $sym (values %{$self->{dynsyms}}) {
 	# We want to mark as undefined symbols those which are currently
 	# defined but that depend on a copy relocation
@@ -388,13 +388,13 @@ sub get_symbol {
 }
 
 sub get_exported_dynamic_symbols {
-    my ($self) = @_;
+    my $self = shift;
     return grep { $_->{defined} && $_->{dynamic} && !$_->{local} }
 	    values %{$self->{dynsyms}};
 }
 
 sub get_undefined_dynamic_symbols {
-    my ($self) = @_;
+    my $self = shift;
     return grep { (!$_->{defined}) && $_->{dynamic} }
 	    values %{$self->{dynsyms}};
 }

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

@@ -396,7 +396,7 @@ sub convert_to_alias {
 }
 
 sub get_tagspec {
-    my ($self) = @_;
+    my $self = shift;
     if ($self->has_tags()) {
 	my @tags;
 	for my $tagname (@{$self->{tagorder}}) {

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

@@ -101,12 +101,12 @@ sub new {
 }
 
 sub get_arch {
-    my ($self) = @_;
+    my $self = shift;
     return $self->{arch};
 }
 
 sub clear {
-    my ($self) = @_;
+    my $self = shift;
     $self->{objects} = {};
 }
 
@@ -120,7 +120,7 @@ sub clear_except {
 }
 
 sub get_sonames {
-    my ($self) = @_;
+    my $self = shift;
     return keys %{$self->{objects}};
 }
 
@@ -457,7 +457,7 @@ sub merge_symbols {
 }
 
 sub is_empty {
-    my ($self) = @_;
+    my $self = shift;
     return scalar(keys %{$self->{objects}}) ? 0 : 1;
 }
 

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

@@ -87,7 +87,8 @@ sub add_directory {
 }
 
 sub finish {
-    my ($self) = @_;
+    my $self = shift;
+
     close(*$self->{tar_input}) or syserr(g_('close on tar input'));
     wait_child(*$self->{pid}, cmdline => 'tar -cf -');
     delete *$self->{pid};

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

@@ -28,7 +28,7 @@ use Dpkg::IPC;
 use POSIX qw(:errno_h);
 
 sub erasedir {
-    my ($dir) = @_;
+    my $dir = shift;
     if (not lstat($dir)) {
         return if $! == ENOENT;
         syserr(g_('cannot stat directory %s (before removal)'), $dir);
@@ -43,7 +43,7 @@ sub erasedir {
 }
 
 sub fixperms {
-    my ($dir) = @_;
+    my $dir = shift;
     my ($mode, $modes_set);
     # Unfortunately tar insists on applying our umask _to the original
     # permissions_ rather than mostly-ignoring the original
@@ -72,7 +72,7 @@ sub fixperms {
 # used to set file timestamps. This avoids confusion when an
 # NFS server and NFS client disagree about what time it is.
 sub fs_time($) {
-    my ($file) = @_;
+    my $file = shift;
     my $is_temp = 0;
     if (not -e $file) {
 	open(my $temp_fh, '>', $file) or syserr(g_('cannot write %s'));
@@ -89,7 +89,7 @@ sub fs_time($) {
 }
 
 sub is_binary($) {
-    my ($file) = @_;
+    my $file = shift;
 
     # TODO: might want to reimplement what diff does, aka checking if the
     # file contains \0 in the first 4Kb of data

+ 6 - 6
scripts/Dpkg/Source/Package.pm

@@ -140,7 +140,7 @@ Set a regex as the new default diff ignore regex.
 =cut
 
 sub set_default_diff_ignore_regex {
-    my ($regex) = @_;
+    my $regex = shift;
 
     $diff_ignore_default_regex = $regex;
 }
@@ -209,7 +209,7 @@ sub new {
 }
 
 sub init_options {
-    my ($self) = @_;
+    my $self = shift;
     # Use full ignore list by default
     # note: this function is not called by V1 packages
     $self->{options}{diff_ignore_regex} ||= $diff_ignore_default_regex;
@@ -298,7 +298,7 @@ Returns the filename of the DSC file.
 =cut
 
 sub get_filename {
-    my ($self) = @_;
+    my $self = shift;
     return $self->{basedir} . $self->{filename};
 }
 
@@ -310,7 +310,7 @@ usually do not have any path information.
 =cut
 
 sub get_files {
-    my ($self) = @_;
+    my $self = shift;
     return $self->{checksums}->get_files();
 }
 
@@ -323,7 +323,7 @@ discovered, it immediately errors out.
 =cut
 
 sub check_checksums {
-    my ($self) = @_;
+    my $self = shift;
     my $checksums = $self->{checksums};
     # add_from_file verify the checksums if they are already existing
     foreach my $file ($checksums->get_files()) {
@@ -386,7 +386,7 @@ then any problem will result in a fatal error.
 =cut
 
 sub check_signature {
-    my ($self) = @_;
+    my $self = shift;
     my $dsc = $self->get_filename();
     my @exec;
 

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

@@ -41,7 +41,8 @@ use File::Spec;
 our $CURRENT_MINOR_VERSION = '0';
 
 sub init_options {
-    my ($self) = @_;
+    my $self = shift;
+
     # Don't call $self->SUPER::init_options() on purpose, V1.0 has no
     # ignore by default
     if ($self->{options}{diff_ignore_regex}) {

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

@@ -50,7 +50,7 @@ use File::Copy;
 our $CURRENT_MINOR_VERSION = '0';
 
 sub init_options {
-    my ($self) = @_;
+    my $self = shift;
     $self->SUPER::init_options();
     $self->{options}{include_removal} //= 0;
     $self->{options}{include_timestamp} //= 0;
@@ -270,7 +270,7 @@ sub unapply_patches {
 }
 
 sub upstream_tarball_template {
-    my ($self) = @_;
+    my $self = shift;
     my $ext = '{' . join(',',
         sort map {
             compression_get_property($_, 'file_ext')
@@ -723,7 +723,7 @@ sub new_binary_found {
 }
 
 sub load_allowed_binaries {
-    my ($self) = @_;
+    my $self = shift;
     my $incbin_file = $self->{include_binaries_path};
     if (-f $incbin_file) {
         open(my $incbin_fh, '<', $incbin_file)
@@ -744,7 +744,7 @@ sub binary_is_allowed {
 }
 
 sub update_debian_source_include_binaries {
-    my ($self) = @_;
+    my $self = shift;
 
     my @unknown_binaries = $self->get_unknown_binaries();
     return unless scalar(@unknown_binaries);
@@ -762,12 +762,12 @@ sub update_debian_source_include_binaries {
 }
 
 sub get_unknown_binaries {
-    my ($self) = @_;
+    my $self = shift;
     return grep { not $self->binary_is_allowed($_) } $self->get_seen_binaries();
 }
 
 sub get_seen_binaries {
-    my ($self) = @_;
+    my $self = shift;
     my @seen = sort keys %{$self->{seen_binaries}};
     return @seen;
 }

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

@@ -39,7 +39,7 @@ use File::Copy;
 our $CURRENT_MINOR_VERSION = '0';
 
 sub init_options {
-    my ($self) = @_;
+    my $self = shift;
     $self->{options}{single_debian_patch} //= 0;
     $self->{options}{allow_version_of_quilt_db} //= [];
 
@@ -84,7 +84,7 @@ sub can_build {
 }
 
 sub get_autopatch_name {
-    my ($self) = @_;
+    my $self = shift;
     if ($self->{options}{single_debian_patch}) {
         return 'debian-changes';
     } else {

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

@@ -298,13 +298,13 @@ sub add_diff_directory {
 }
 
 sub finish {
-    my ($self) = @_;
+    my $self = shift;
     close($self) or syserr(g_('cannot close %s'), $self->get_filename());
     return not *$self->{errors};
 }
 
 sub register_error {
-    my ($self) = @_;
+    my $self = shift;
     *$self->{errors}++;
 }
 sub _fail_with_msg {

+ 12 - 12
scripts/Dpkg/Source/Quilt.pm

@@ -49,7 +49,7 @@ sub new {
 }
 
 sub setup_db {
-    my ($self) = @_;
+    my $self = shift;
     my $db_dir = $self->get_db_file();
     if (not -d $db_dir) {
         mkdir $db_dir or syserr(g_('cannot mkdir %s'), $db_dir);
@@ -80,14 +80,14 @@ sub setup_db {
 }
 
 sub load_db {
-    my ($self) = @_;
+    my $self = shift;
 
     my $pc_applied = $self->get_db_file('applied-patches');
     $self->{applied_patches} = [ $self->read_patch_list($pc_applied) ];
 }
 
 sub save_db {
-    my ($self) = @_;
+    my $self = shift;
 
     $self->setup_db();
     my $pc_applied = $self->get_db_file('applied-patches');
@@ -102,17 +102,17 @@ sub load_series {
 }
 
 sub series {
-    my ($self) = @_;
+    my $self = shift;
     return @{$self->{series}};
 }
 
 sub applied {
-    my ($self) = @_;
+    my $self = shift;
     return @{$self->{applied_patches}};
 }
 
 sub top {
-    my ($self) = @_;
+    my $self = shift;
     my $count = scalar @{$self->{applied_patches}};
     return $self->{applied_patches}[$count - 1] if $count;
     return;
@@ -155,7 +155,7 @@ sub unregister {
 }
 
 sub next {
-    my ($self) = @_;
+    my $self = shift;
     my $count_applied = scalar @{$self->{applied_patches}};
     my $count_series = scalar @{$self->{series}};
     return $self->{series}[$count_applied] if ($count_series > $count_applied);
@@ -226,7 +226,7 @@ sub pop {
 }
 
 sub get_db_version {
-    my ($self) = @_;
+    my $self = shift;
     my $pc_ver = $self->get_db_file('.version');
     if (-f $pc_ver) {
         open(my $ver_fh, '<', $pc_ver) or syserr(g_('cannot read %s'), $pc_ver);
@@ -239,7 +239,7 @@ sub get_db_version {
 }
 
 sub find_problems {
-    my ($self) = @_;
+    my $self = shift;
     my $patch_dir = $self->get_patch_file();
     if (-e $patch_dir and not -d _) {
         return sprintf(g_('%s should be a directory or non-existing'), $patch_dir);
@@ -252,7 +252,7 @@ sub find_problems {
 }
 
 sub get_series_file {
-    my ($self) = @_;
+    my $self = shift;
     my $vendor = lc(get_current_vendor() || 'debian');
     # Series files are stored alongside patches
     my $default_series = $self->get_patch_file('series');
@@ -267,7 +267,7 @@ sub get_db_file {
 }
 
 sub get_db_dir {
-    my ($self) = @_;
+    my $self = shift;
     return $self->get_db_file();
 }
 
@@ -277,7 +277,7 @@ sub get_patch_file {
 }
 
 sub get_patch_dir {
-    my ($self) = @_;
+    my $self = shift;
     return $self->get_patch_file();
 }
 

+ 1 - 1
scripts/Dpkg/Substvars.pm

@@ -251,7 +251,7 @@ This will never be warned about when unused.
 =cut
 
 sub set_arch_substvars {
-    my ($self) = @_;
+    my $self = shift;
 
     my $attr = SUBSTVAR_ATTR_USED | SUBSTVAR_ATTR_AUTO;
 

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

@@ -56,7 +56,7 @@ if they don't need any specific initialization at object creation time.
 =cut
 
 sub new {
-    my ($this) = @_;
+    my $this = shift;
     my $class = ref($this) || $this;
     my $self = {};
     bless $self, $class;

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

@@ -166,7 +166,7 @@ numbers in an array reference.
 =cut
 
 sub find_launchpad_closes {
-    my ($changes) = @_;
+    my $changes = shift;
     my %closes;
 
     while ($changes &&

+ 2 - 2
scripts/Dpkg/Version.pm

@@ -121,7 +121,7 @@ Returns true if the version is valid, false otherwise.
 =cut
 
 sub is_valid {
-    my ($self) = @_;
+    my $self = shift;
     return scalar version_check($self);
 }
 
@@ -313,7 +313,7 @@ of the character is used to sort between characters.
 =cut
 
 sub _version_order {
-    my ($x) = @_;
+    my $x = shift;
 
     if ($x eq '~') {
         return -1;

+ 1 - 1
scripts/dpkg-architecture.pl

@@ -166,7 +166,7 @@ my $action = 'list';
 my $force = 0;
 
 sub action_needs($) {
-  my ($bits) = @_;
+  my $bits = shift;
   return (($req_vars & $bits) == $bits);
 }
 

+ 3 - 3
scripts/dpkg-buildpackage.pl

@@ -671,7 +671,7 @@ sub run_hook {
     );
 
     my $subst_hook_var = sub {
-        my ($var) = @_;
+        my $var = shift;
 
         if (exists $hook_vars{$var}) {
             return $hook_vars{$var};
@@ -687,7 +687,7 @@ sub run_hook {
 }
 
 sub signfile {
-    my ($file) = @_;
+    my $file = shift;
 
     print { *STDERR } " signfile $file\n";
 
@@ -720,7 +720,7 @@ sub fileomitted {
 }
 
 sub describe_build {
-    my ($files) = @_;
+    my $files = shift;
     my $ext = compression_get_file_extension_regex();
 
     if (fileomitted($files, qr/\.deb/)) {

+ 3 - 3
scripts/dpkg-name.pl

@@ -67,7 +67,7 @@ according to the 'underscores convention'.
 
 sub fileexists($)
 {
-    my ($filename) = @_;
+    my $filename = shift;
 
     if (-f $filename) {
         return 1;
@@ -89,7 +89,7 @@ sub filesame($$)
 
 sub getfields($)
 {
-    my ($filename) = @_;
+    my $filename = shift;
 
     # Read the fields
     open(my $cdata_fh, '-|', 'dpkg-deb', '-f', '--', $filename)
@@ -165,7 +165,7 @@ sub getdir($$$)
 
 sub move($)
 {
-    my ($filename) = @_;
+    my $filename = shift;
 
     if (fileexists($filename)) {
         my $fields = getfields($filename);

+ 1 - 1
scripts/dpkg-source.pl

@@ -493,7 +493,7 @@ if ($options{opmode} =~ /^(build|print-format|(before|after)-build|commit)$/) {
 
 sub set_testsuite_field
 {
-    my ($fields) = @_;
+    my $fields = shift;
 
     my $testsuite_field = $fields->{'Testsuite'} // '';
     my %testsuite = map { $_ => 1 } split /\s*,\s*/, $testsuite_field;

+ 1 - 1
scripts/t/Dpkg_Compression.t

@@ -67,7 +67,7 @@ sub check_compressed {
 }
 
 sub test_read {
-    my ($filename) = @_;
+    my $filename = shift;
 
     $fh = Dpkg::Compression::FileHandle->new();
     open($fh, '<', $filename) or die 'open failed';

+ 1 - 1
scripts/t/Dpkg_Control.t

@@ -28,7 +28,7 @@ my $srcdir = $ENV{srcdir} || '.';
 my $datadir = $srcdir . '/t/Dpkg_Control';
 
 sub parse_dsc {
-    my ($path) = @_;
+    my $path = shift;
 
     my $dsc = Dpkg::Control->new(type => CTRL_PKG_SRC);
     eval {

+ 1 - 1
scripts/t/Dpkg_Deps.t

@@ -197,7 +197,7 @@ my $dep_iter = deps_parse('a, b:armel, c | d:armhf, d:mips (>> 1.2)');
 my %dep_arches;
 my %dep_pkgs;
 deps_iterate($dep_iter, sub {
-    my ($dep) = @_;
+    my $dep = shift;
 
     $dep_pkgs{$dep->{package}} = 1;
     if ($dep->{archqual}) {