diff options
author | Thierry Vignaud <tv@mageia.org> | 2011-12-05 00:02:15 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2011-12-05 00:02:15 +0000 |
commit | d1213191f9beee0c14835aee80c8d3f669589250 (patch) | |
tree | 93ed493c96567d4c5c32087d68bbc9a9be1bbcfe /urpm | |
parent | a767c1865f17749ccac1b27c95f23ac57ea26626 (diff) | |
download | urpmi-d1213191f9beee0c14835aee80c8d3f669589250.tar urpmi-d1213191f9beee0c14835aee80c8d3f669589250.tar.gz urpmi-d1213191f9beee0c14835aee80c8d3f669589250.tar.bz2 urpmi-d1213191f9beee0c14835aee80c8d3f669589250.tar.xz urpmi-d1213191f9beee0c14835aee80c8d3f669589250.zip |
(find) introduce it from MDK::Common
(needed for next commit)
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/util.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/urpm/util.pm b/urpm/util.pm index 26730a0d..58f15d12 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_ + find remove_internal_name reduce_pathname offset_pathname untaint @@ -181,6 +182,12 @@ sub output_safe { 1; } +sub find(&@) { + my $f = shift; + $f->($_) and return $_ foreach @_; + undef; +} + sub append_to_file { my $f = shift; open(my $F, '>>', $f) or die "writing to file $f failed: $!\n"; |