diff options
Diffstat (limited to 'scripts/Dpkg/Source')
-rw-r--r-- | scripts/Dpkg/Source/Package.pm | 4 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V2.pm | 4 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V3/quilt.pm | 2 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Patch.pm | 2 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Quilt.pm | 12 |
5 files changed, 12 insertions, 12 deletions
diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm index 8ea7c0a19..3de9afbed 100644 --- a/scripts/Dpkg/Source/Package.pm +++ b/scripts/Dpkg/Source/Package.pm @@ -216,7 +216,7 @@ sub initialize { sub upgrade_object_type { my ($self, $update_format) = @_; - $update_format = 1 unless defined $update_format; + $update_format //= 1; $self->{'fields'}{'Format'} = '1.0' unless exists $self->{'fields'}{'Format'}; my $format = $self->{'fields'}{'Format'}; @@ -227,7 +227,7 @@ sub upgrade_object_type { my $module = "Dpkg::Source::Package::V$major"; $module .= "::$variant" if defined $variant; eval "require $module; \$minor = \$${module}::CURRENT_MINOR_VERSION;"; - $minor = 0 unless defined $minor; + $minor //= 0; if ($update_format) { $self->{'fields'}{'Format'} = "$major.$minor"; $self->{'fields'}{'Format'} .= " ($variant)" if defined $variant; diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index 9a164ccf8..c05d9895d 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/scripts/Dpkg/Source/Package/V2.pm @@ -195,7 +195,7 @@ sub get_autopatch_name { sub get_patches { my ($self, $dir, %opts) = @_; - $opts{"skip_auto"} = 0 unless defined($opts{"skip_auto"}); + $opts{"skip_auto"} //= 0; my @patches; my $pd = "$dir/debian/patches"; my $auto_patch = $self->get_autopatch_name(); @@ -214,7 +214,7 @@ sub get_patches { sub apply_patches { my ($self, $dir, %opts) = @_; - $opts{"skip_auto"} = 0 unless defined($opts{"skip_auto"}); + $opts{"skip_auto"} //= 0; my @patches = $self->get_patches($dir, %opts); return unless scalar(@patches); my $applied = File::Spec->catfile($dir, "debian", "patches", ".dpkg-source-applied"); diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm index f32a49909..b41c64d1b 100644 --- a/scripts/Dpkg/Source/Package/V3/quilt.pm +++ b/scripts/Dpkg/Source/Package/V3/quilt.pm @@ -144,7 +144,7 @@ sub unapply_patches { my $quilt = $self->build_quilt_object($dir); - $opts{'verbose'} = 1 unless defined $opts{'verbose'}; + $opts{'verbose'} //= 1; my $pc_applied = $quilt->get_db_file("applied-patches"); my @applied = $quilt->applied(); diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm index 104bde6d8..2aa11ab1c 100644 --- a/scripts/Dpkg/Source/Patch.pm +++ b/scripts/Dpkg/Source/Patch.pm @@ -371,7 +371,7 @@ sub _intuit_file_patched { sub analyze { my ($self, $destdir, %opts) = @_; - $opts{"verbose"} = 1 if not defined $opts{"verbose"}; + $opts{"verbose"} //= 1; my $diff = $self->get_filename(); my %filepatched; my %dirtocreate; diff --git a/scripts/Dpkg/Source/Quilt.pm b/scripts/Dpkg/Source/Quilt.pm index a0c98f63a..6c0d43942 100644 --- a/scripts/Dpkg/Source/Quilt.pm +++ b/scripts/Dpkg/Source/Quilt.pm @@ -132,8 +132,8 @@ sub next { sub push { my ($self, %opts) = @_; - $opts{"verbose"} = 0 unless defined($opts{"verbose"}); - $opts{"timestamp"} = fs_time($self->{'dir'}) unless defined($opts{"timestamp"}); + $opts{"verbose"} //= 0; + $opts{"timestamp"} //= fs_time($self->{'dir'}); my $patch = $self->next(); return unless defined $patch; @@ -164,9 +164,9 @@ sub push { sub pop { my ($self, %opts) = @_; - $opts{"verbose"} = 0 unless defined($opts{"verbose"}); - $opts{"timestamp"} = fs_time($self->{'dir'}) unless defined($opts{"timestamp"}); - $opts{"reverse_apply"} = 0 unless defined($opts{"reverse_apply"}); + $opts{"verbose"} //= 0; + $opts{"timestamp"} //= fs_time($self->{'dir'}); + $opts{"reverse_apply"} //= 0; my $patch = $self->top(); return unless defined $patch; @@ -254,7 +254,7 @@ sub get_patch_dir { sub read_patch_list { my ($self, $file, %opts) = @_; return () if not defined $file or not -f $file; - $opts{"warn_options"} = 0 unless defined($opts{"warn_options"}); + $opts{"warn_options"} //= 0; my @patches; open(my $series_fh, "<" , $file) || syserr(_g("cannot read %s"), $file); while (defined($_ = <$series_fh>)) { |