summaryrefslogtreecommitdiffstats
path: root/urpm/util.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-07 18:22:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-07 18:22:35 +0000
commit0ca6719f421a9c5ac971f30fcd9a20782f38435a (patch)
treec246022b5b8688d3a4444945d093fdcfc82a440d /urpm/util.pm
parent8a79470e525a0c0523953cafa526e7c56647ddaf (diff)
downloadurpmi-0ca6719f421a9c5ac971f30fcd9a20782f38435a.tar
urpmi-0ca6719f421a9c5ac971f30fcd9a20782f38435a.tar.gz
urpmi-0ca6719f421a9c5ac971f30fcd9a20782f38435a.tar.bz2
urpmi-0ca6719f421a9c5ac971f30fcd9a20782f38435a.tar.xz
urpmi-0ca6719f421a9c5ac971f30fcd9a20782f38435a.zip
- urpmi
o prefer best architecture over exact name (eg: urpmi libfoo-devel prefers lib64foo-devel over libfoo-devel) - add function min()
Diffstat (limited to 'urpm/util.pm')
-rw-r--r--urpm/util.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/urpm/util.pm b/urpm/util.pm
index 47a89f08..321902b4 100644
--- a/urpm/util.pm
+++ b/urpm/util.pm
@@ -5,7 +5,7 @@ package urpm::util;
use strict;
use Exporter;
our @ISA = 'Exporter';
-our @EXPORT = qw(quotespace unquotespace
+our @EXPORT = qw(min quotespace unquotespace
remove_internal_name
reduce_pathname offset_pathname
untaint
@@ -17,6 +17,8 @@ our @EXPORT = qw(quotespace unquotespace
(our $VERSION) = q($Revision$) =~ /(\d+)/;
+sub min { my $n = shift; $_ < $n and $n = $_ foreach @_; $n }
+
#- quoting/unquoting a string that may be containing space chars.
sub quotespace { my $x = $_[0] || ''; $x =~ s/(\s)/\\$1/g; $x }
sub unquotespace { my $x = $_[0] || ''; $x =~ s/\\(\s)/$1/g; $x }