This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=1918794cd85029445add5005dda55c524ba825ec commit 1918794cd85029445add5005dda55c524ba825ec Author: Guillem Jover <[email protected]> AuthorDate: Tue Aug 6 03:02:09 2024 +0200 scripts: Use %opts instead of %args for function and method options Use the same pattern as the rest of the code base. --- scripts/Dpkg/Compression/FileHandle.pm | 18 +++++++++--------- scripts/Dpkg/Compression/Process.pm | 6 +++--- scripts/Dpkg/Shlibs/Symbol.pm | 8 ++++---- scripts/Dpkg/Source/Package.pm | 14 +++++++------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/Dpkg/Compression/FileHandle.pm b/scripts/Dpkg/Compression/FileHandle.pm index c25220a92..efd71fef5 100644 --- a/scripts/Dpkg/Compression/FileHandle.pm +++ b/scripts/Dpkg/Compression/FileHandle.pm @@ -123,7 +123,7 @@ obviously incompatible with automatic detection of the compression method. # Class methods sub new { - my ($this, %args) = @_; + my ($this, %opts) = @_; my $class = ref($this) || $this; my $self = IO::File->new(); # Tying is required to overload the open functions and to auto-open @@ -133,17 +133,17 @@ sub new { # Initializations *$self->{compression} = 'auto'; *$self->{compressor} = Dpkg::Compression::Process->new(); - *$self->{add_comp_ext} = $args{add_compression_extension} || - $args{add_comp_ext} || 0; + *$self->{add_comp_ext} = $opts{add_compression_extension} || + $opts{add_comp_ext} || 0; *$self->{allow_sigpipe} = 0; - if (exists $args{filename}) { - $self->set_filename($args{filename}); + if (exists $opts{filename}) { + $self->set_filename($opts{filename}); } - if (exists $args{compression}) { - $self->set_compression($args{compression}); + if (exists $opts{compression}) { + $self->set_compression($opts{compression}); } - if (exists $args{compression_level}) { - $self->set_compression_level($args{compression_level}); + if (exists $opts{compression_level}) { + $self->set_compression_level($opts{compression_level}); } return $self; } diff --git a/scripts/Dpkg/Compression/Process.pm b/scripts/Dpkg/Compression/Process.pm index cf4c50403..23c4fd937 100644 --- a/scripts/Dpkg/Compression/Process.pm +++ b/scripts/Dpkg/Compression/Process.pm @@ -51,12 +51,12 @@ and "compression_level" (see corresponding set_* functions). =cut sub new { - my ($this, %args) = @_; + my ($this, %opts) = @_; my $class = ref($this) || $this; my $self = {}; bless $self, $class; - $self->set_compression($args{compression} || compression_get_default()); - $self->set_compression_level($args{compression_level} || + $self->set_compression($opts{compression} || compression_get_default()); + $self->set_compression_level($opts{compression_level} || compression_get_default_level()); return $self; } diff --git a/scripts/Dpkg/Shlibs/Symbol.pm b/scripts/Dpkg/Shlibs/Symbol.pm index 3b38a8c94..4d49c54f3 100644 --- a/scripts/Dpkg/Shlibs/Symbol.pm +++ b/scripts/Dpkg/Shlibs/Symbol.pm @@ -50,7 +50,7 @@ use constant ALIAS_TYPES => qw( ); sub new { - my ($this, %args) = @_; + my ($this, %opts) = @_; my $class = ref($this) || $this; my $self = bless { symbol => undef, @@ -61,15 +61,15 @@ sub new { tags => {}, tagorder => [], }, $class; - $self->{$_} = $args{$_} foreach keys %args; + $self->{$_} = $opts{$_} foreach keys %opts; return $self; } # Deep clone sub clone { - my ($self, %args) = @_; + my ($self, %opts) = @_; my $clone = Storable::dclone($self); - $clone->{$_} = $args{$_} foreach keys %args; + $clone->{$_} = $opts{$_} foreach keys %opts; return $clone; } diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm index 3d336a1a7..3167c57f7 100644 --- a/scripts/Dpkg/Source/Package.pm +++ b/scripts/Dpkg/Source/Package.pm @@ -206,7 +206,7 @@ source package after its extraction. # Class methods sub new { - my ($this, %args) = @_; + my ($this, %opts) = @_; my $class = ref($this) || $this; my $self = { fields => Dpkg::Control->new(type => CTRL_DSC), @@ -216,14 +216,14 @@ sub new { openpgp => Dpkg::OpenPGP->new(needs => { api => 'verify' }), }; bless $self, $class; - if (exists $args{options}) { - $self->{options} = $args{options}; + if (exists $opts{options}) { + $self->{options} = $opts{options}; } - if (exists $args{filename}) { - $self->initialize($args{filename}); + if (exists $opts{filename}) { + $self->initialize($opts{filename}); $self->init_options(); - } elsif ($args{format}) { - $self->{fields}{Format} = $args{format}; + } elsif ($opts{format}) { + $self->{fields}{Format} = $opts{format}; $self->upgrade_object_type(0); $self->init_options(); } -- Dpkg.Org's dpkg

