diff options
author | Francois Pons <fpons@mandriva.com> | 2001-11-09 16:44:06 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-11-09 16:44:06 +0000 |
commit | 597069152fc641228b378502682051293ce2b6f3 (patch) | |
tree | 0a62a05f953d893bb775ba3f941156b344b89cd3 /urpmi | |
parent | b9659b79e4119f72dee7c4aecf898fc838922e1b (diff) | |
download | urpmi-597069152fc641228b378502682051293ce2b6f3.tar urpmi-597069152fc641228b378502682051293ce2b6f3.tar.gz urpmi-597069152fc641228b378502682051293ce2b6f3.tar.bz2 urpmi-597069152fc641228b378502682051293ce2b6f3.tar.xz urpmi-597069152fc641228b378502682051293ce2b6f3.zip |
small fixes.
Diffstat (limited to 'urpmi')
-rwxr-xr-x | urpmi | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -97,6 +97,9 @@ for (@ARGV) { /v/ and do { $verbose = 1; next }; die _("urpmi: unknown option \"-%s\", check usage with --help\n", $1); } next }; @nextargv and do { my $r = shift @nextargv; $r and $$r = $_; next }; + #- only superuser by default can install packages, + #- TODO check for source package, to download but not to install ? + $uid == 0 or $urpm->fatal(1, _("Only superuser is allowed to install packages")); /\.rpm$/ and do { push @files, untaint($_); next }; push @names, $_; } @@ -295,17 +298,18 @@ close STDERR; close STDOUT; sub install { - @_ or return; + my @l = grep { $_ !~ /\.src.\.rpm/ } @_; + @l or return; - printf SAVEOUT _("installing %s\n", join(' ', @_)); + printf SAVEOUT _("installing %s\n", join(' ', @l)); log_it(scalar localtime, " @_\n"); $urpm->{log}("starting installing packages"); - system($X ? ("grpmi", $WID ? ("--WID=$WID") : ()) : ("rpm", $rpm_opt), @_); + system($X ? ("grpmi", $WID ? ("--WID=$WID") : ()) : ("rpm", $rpm_opt), @l); if ($?) { message(_("Installation failed")); $X and exit(($? >> 8) + 32); #- grpmi handles --nodeps and --force by itself, forward grpmi error + 32 - m|^/| && !-e $_ and exit 2 foreach @_; #- missing local file + m|^/| && !-e $_ and exit 2 foreach @l; #- missing local file $noexpr = _("Nn"); $yesexpr = _("Yy"); @@ -313,14 +317,14 @@ sub install { $auto and exit 1; #- if auto has been set, avoid asking user. $force or <STDIN> =~ /[$yesexpr]/ or exit 1; $urpm->{log}("starting installing packages without deps"); - system("rpm", $rpm_opt, "--nodeps", @_); + system("rpm", $rpm_opt, "--nodeps", @l); if ($?) { message(_("Installation failed")); print SAVEOUT _("Try installation even more strongly (--force)? (y/N) "); $force or <STDIN> =~ /[$yesexpr]/ or exit 1; $urpm->{log}("starting force installing packages without deps"); - system("rpm", $rpm_opt, "--nodeps", "--force", @_); + system("rpm", $rpm_opt, "--nodeps", "--force", @l); } } } |