summaryrefslogtreecommitdiffstats
path: root/urpme
diff options
context:
space:
mode:
authorMandrake <mandrake@mandriva.com>2006-12-08 18:15:32 +0000
committerMandrake <mandrake@mandriva.com>2006-12-08 18:15:32 +0000
commit7a49e24ff0763aabc817ff299c3921a8c471c89f (patch)
tree423aca07c24a0ef3ee08416986dc6acbd473881d /urpme
parent97e2b4eb7e8734208d686b30c09921f497009f2f (diff)
downloadurpmi-7a49e24ff0763aabc817ff299c3921a8c471c89f.tar
urpmi-7a49e24ff0763aabc817ff299c3921a8c471c89f.tar.gz
urpmi-7a49e24ff0763aabc817ff299c3921a8c471c89f.tar.bz2
urpmi-7a49e24ff0763aabc817ff299c3921a8c471c89f.tar.xz
urpmi-7a49e24ff0763aabc817ff299c3921a8c471c89f.zip
Copying release 1.5-2mdv2007.1 to pristine/ directory.
Diffstat (limited to 'urpme')
-rw-r--r--urpme33
1 files changed, 14 insertions, 19 deletions
diff --git a/urpme b/urpme
index be66c9f1..94a05d2f 100644
--- a/urpme
+++ b/urpme
@@ -23,15 +23,11 @@ use strict;
use urpm;
use urpm::args;
use urpm::msg;
-use urpm::install;
-use urpm::media;
-use urpm::select;
-
$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin";
delete @ENV{qw(ENV BASH_ENV IFS CDPATH)};
-our ($test, $parallel, $auto, $matches, $verbose, $force, $noscripts, $repackage, @l, $bundle, $restricted);
+our ($root, $test, $parallel, $auto, $matches, $verbose, $usedistrib, $force, $noscripts, $repackage, @l, $bundle, $restricted);
# Translator: Add here the keys which might be pressed in the "Yes"-case.
my $yesexpr = N("Yy");
@@ -48,12 +44,9 @@ usage:
") . N(" --parallel - distributed urpmi across machines of alias.
") . N(" --repackage - Re-package the files before erasing
") . N(" --root - use another root for rpm removal.
-") . N(" --urpmi-root - use another root for urpmi db & rpm installation.
") . N(" --noscripts - do not execute package scriptlet(s).
") . N(" --use-distrib - configure urpme on the fly from a distrib tree, useful
to (un)install a chroot with --root option.
-") . N(" --probe-synthesis - use synthesis file.
-") . N(" --probe-hdlist - use hdlist file.
") . N(" -v - verbose mode.
") . N(" -a - select all packages matching expression.
");
@@ -62,10 +55,10 @@ usage:
@ARGV or usage();
my @origARGV = @ARGV;
-my $urpm = new urpm;
-urpm::args::parse_cmdline(urpm => $urpm) or exit(1);
+urpm::args::parse_cmdline() or exit(1);
@l = @ARGV;
+my $urpm = new urpm;
my $state = {};
#- remove verbose if not asked.
@@ -77,7 +70,7 @@ if ($< && !$test) {
#- rurpme checks
if ($restricted) {
- urpm::error_restricted($urpm) if $urpm->{root} || $options{usedistrib} || $noscripts || $parallel;
+ urpm::error_restricted($urpm) if $root || $usedistrib || $noscripts || $parallel;
}
unless ($test) {
@@ -85,16 +78,15 @@ unless ($test) {
}
#- just configure parallel mode if available.
-my $_urpmi_lock = urpm::lock::urpmi_db($urpm);
-urpm::media::configure($urpm,
+$urpm->configure(
synthesis => ($parallel ? 'none' : ''),
+ root => $root,
parallel => $parallel,
- probe_with => $options{probe_with},
- usedistrib => $options{usedistrib},
+ usedistrib => $usedistrib,
);
#- examine packages...
-my @toremove = urpm::select::find_packages_to_remove($urpm,
+my @toremove = $urpm->find_packages_to_remove(
$state,
\@l,
matches => $matches,
@@ -117,9 +109,10 @@ my @toremove = urpm::select::find_packages_to_remove($urpm,
#- Warning : the following message is parsed in urpm::parallel_*
$urpm->{error}(N("removing package %s will break your system", $_));
} 0 },
+ root => $root,
) or $urpm->{fatal}(0, N("Nothing to remove"));
-my $list = urpm::select::translate_why_removed($urpm, $state, @toremove);
+my $list = $urpm->translate_why_removed($state, @toremove);
if ($test && $auto) {
#- Warning : the following message is parsed in urpm::parallel_*
my $msg = N("Checking to remove the following packages");
@@ -137,17 +130,19 @@ if ($test && $auto) {
#- Warning : the following message is parsed in urpm::parallel_*
print N("removing %s", join(' ', sort @toremove)) . "\n";
@l = $parallel
- ? urpm::parallel::remove($urpm,
+ ? $urpm->parallel_remove(
\@toremove,
test => $test,
force => $force,
+ translate_message => 1,
noscripts => $noscripts,
repackage => $repackage || $urpm->{options}{repackage},
)
- : urpm::install::install($urpm,
+ : $urpm->install(
\@toremove, {}, {},
test => $test,
force => $force,
+ translate_message => 1,
noscripts => $noscripts,
repackage => $repackage || $urpm->{options}{repackage},
);