summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-07 11:00:59 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-07 11:00:59 +0000
commit218724a54c08f3dd28beae384842929022b92192 (patch)
tree73ce22373915fd795f7586ca8c677b193595871d
parent39f44504adbb492486856db74cb269f7ba85f66f (diff)
downloadurpmi-218724a54c08f3dd28beae384842929022b92192.tar
urpmi-218724a54c08f3dd28beae384842929022b92192.tar.gz
urpmi-218724a54c08f3dd28beae384842929022b92192.tar.bz2
urpmi-218724a54c08f3dd28beae384842929022b92192.tar.xz
urpmi-218724a54c08f3dd28beae384842929022b92192.zip
Move untaint() into urpm::util.
Fix a comment in urpmi.
-rw-r--r--urpm/util.pm8
-rwxr-xr-xurpmi9
2 files changed, 9 insertions, 8 deletions
diff --git a/urpm/util.pm b/urpm/util.pm
index 8abb816e..6e8e483f 100644
--- a/urpm/util.pm
+++ b/urpm/util.pm
@@ -6,7 +6,7 @@ our @ISA = 'Exporter';
our @EXPORT = qw(quotespace unquotespace
remove_internal_name
reduce_pathname offset_pathname
- md5sum
+ md5sum untaint
);
#- quoting/unquoting a string that may be containing space chars.
@@ -72,6 +72,12 @@ sub offset_pathname {
$result . join('/', reverse @corrections);
}
+sub untaint {
+ my @r;
+ foreach (@_) { /(.*)/; push @r, $1 }
+ @r == 1 ? $r[0] : @r;
+}
+
sub md5sum {
#- Use an external command to avoid depending on perl
my ($file) = @_;
diff --git a/urpmi b/urpmi
index 2194b27a..2cc90a7b 100755
--- a/urpmi
+++ b/urpmi
@@ -22,6 +22,7 @@ use strict;
use urpm;
use urpm::args;
use urpm::msg;
+use urpm::util qw/untaint/;
use MDK::Common;
#- contains informations to parse installed system.
@@ -170,12 +171,6 @@ foreach my $a (@ARGV) {
# Parse command line options
urpm::args::parse_cmdline(urpm => $urpm);
-sub untaint {
- my @r;
- foreach (@_) { /(.*)/, push @r, $1 }
- @r == 1 ? $r[0] : @r;
-}
-
# Process the rest of the arguments
while (defined($_ = shift @ARGV)) {
if (/\.rpm$/) {
@@ -306,7 +301,7 @@ if ($log) {
open SAVEERR, ">&STDERR"; select SAVEERR; $| = 1;
}
-#- remove verbose if not asked.
+#- log to SAVEERR instead of STDERR
unless ($bug) {
$urpm->{fatal} = sub { printf SAVEERR "%s\n", $_[1]; exit($_[0]) };
$urpm->{error} = sub { printf SAVEERR "%s\n", $_[0] };