summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-12-05 00:02:15 +0000
committerThierry Vignaud <tv@mageia.org>2011-12-05 00:02:15 +0000
commitd1213191f9beee0c14835aee80c8d3f669589250 (patch)
tree93ed493c96567d4c5c32087d68bbc9a9be1bbcfe
parenta767c1865f17749ccac1b27c95f23ac57ea26626 (diff)
downloadurpmi-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)
-rw-r--r--urpm/util.pm7
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";