[dpkg] 108/200: Dpkg: Call anonymous subs via -> operator instead of casting with &

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:17:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository dpkg.

commit 667b38f6a42647f49464b19cd6792a51aa238fd4
Author: Guillem Jover <guillem at debian.org>
Date:   Sun Jan 8 13:30:34 2017 +0100

    Dpkg: Call anonymous subs via -> operator instead of casting with &
    
    And fix the documentation while at it, which was incorrect code.
---
 debian/changelog          | 2 ++
 scripts/Dpkg/Conf.pm      | 4 ++--
 scripts/Dpkg/Substvars.pm | 4 ++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 259efec..6c27c88 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
     - Add new import tags for Dpkg::Arch.
     - Abort on EOF in patch name prompt in Dpkg::Source::Package::V2,
       instead of getting into an infinite loop. Closes: #851441
+    - Call anonymous subs via -> operator instead of casting with &, and fix
+      bogus POD documentation to match the code.
   * Documentation:
     - Cleanup software requirements in README.
     - Move control member file references from dpkg(1) to deb(5).
diff --git a/scripts/Dpkg/Conf.pm b/scripts/Dpkg/Conf.pm
index 2e27f34..ca98cd3 100644
--- a/scripts/Dpkg/Conf.pm
+++ b/scripts/Dpkg/Conf.pm
@@ -206,7 +206,7 @@ sub parse {
 =item $conf->filter(%opts)
 
 Filter the list of options, either removing or keeping all those that
-return true when &$opts{remove}($option) or &opts{keep}($option) is called.
+return true when $opts{remove}->($option) or $opts{keep}->($option) is called.
 
 =cut
 
@@ -217,7 +217,7 @@ sub filter {
 
     croak 'obsolete option format_argv' if exists $opts{format_argv};
 
-    @{$self->{options}} = grep { not &$remove($_) and &$keep($_) }
+    @{$self->{options}} = grep { not $remove->($_) and $keep->($_) }
                                @{$self->{options}};
 }
 
diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm
index 8f06d1f..9d52f32 100644
--- a/scripts/Dpkg/Substvars.pm
+++ b/scripts/Dpkg/Substvars.pm
@@ -370,7 +370,7 @@ sub set_msg_prefix {
 =item $s->filter(keep => $keepfun)
 
 Filter the substitution variables, either removing or keeping all those
-that return true when &$rmfunc($key) or &keepfunc($key) is called.
+that return true when $rmfunc->($key) or $keepfunc->($key) is called.
 
 =cut
 
@@ -381,7 +381,7 @@ sub filter {
     my $keep = $opts{keep} // sub { 1 };
 
     foreach my $vn (keys %{$self->{vars}}) {
-        $self->delete($vn) if &$remove($vn) or not &$keep($vn);
+        $self->delete($vn) if $remove->($vn) or not $keep->($vn);
     }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list