From b7e56b30b8c4801b1d4d4a47c71d92de0e7bc438 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 8 Jun 2012 18:50:59 +0000 Subject: (any) introduce it from MDK::Common (needed for next commit) --- urpm/util.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/urpm/util.pm b/urpm/util.pm index 58f15d12..cdceb852 100644 --- a/urpm/util.pm +++ b/urpm/util.pm @@ -7,6 +7,7 @@ use Exporter; our @ISA = 'Exporter'; our @EXPORT = qw(min max quotespace unquotespace add2hash_ + any find remove_internal_name reduce_pathname offset_pathname @@ -188,6 +189,12 @@ sub find(&@) { undef; } +sub any(&@) { + my $f = shift; + $f->($_) and return 1 foreach @_; + 0; +} + sub append_to_file { my $f = shift; open(my $F, '>>', $f) or die "writing to file $f failed: $!\n"; -- cgit v1.2.1