summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-08 17:19:10 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-08 17:19:10 +0000
commit5b1cab90afd2f73a5ec6824284e2eb8b9a4a05f3 (patch)
tree17b641f6169e9bbda2354b447b9205bb2438ae3c
parent37d87d8e158fa78e7df0a3a100707d7daf17cfc9 (diff)
downloadurpmi-5b1cab90afd2f73a5ec6824284e2eb8b9a4a05f3.tar
urpmi-5b1cab90afd2f73a5ec6824284e2eb8b9a4a05f3.tar.gz
urpmi-5b1cab90afd2f73a5ec6824284e2eb8b9a4a05f3.tar.bz2
urpmi-5b1cab90afd2f73a5ec6824284e2eb8b9a4a05f3.tar.xz
urpmi-5b1cab90afd2f73a5ec6824284e2eb8b9a4a05f3.zip
Some urpme cleanup
-rw-r--r--urpm.pm79
-rw-r--r--urpm/args.pm1
-rw-r--r--urpme5
3 files changed, 47 insertions, 38 deletions
diff --git a/urpm.pm b/urpm.pm
index c93c8fb5..4684091c 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -3078,6 +3078,15 @@ sub parallel_install {
}
#- find packages to remove.
+#- options:
+#- bundle
+#- callback_base
+#- callback_fuzzy
+#- callback_notfound
+#- force
+#- matches
+#- root
+#- test
sub find_packages_to_remove {
my ($urpm, $state, $l, %options) = @_;
@@ -3094,50 +3103,50 @@ sub find_packages_to_remove {
foreach (@$l) {
my ($n, $found);
- #- check if name-version-release-architecture may have been given.
+ #- check if name-version-release-architecture was given.
if (($n) = /^(.*)-[^\-]*-[^\-]*\.[^\.\-]*$/) {
$db->traverse_tag('name', [ $n ], sub {
- my ($p) = @_;
- $p->fullname eq $_ or return;
- $urpm->resolve_rejected($db, $state, $p, removed => 1);
- push @m, scalar $p->fullname;
- $found = 1;
- });
+ my ($p) = @_;
+ $p->fullname eq $_ or return;
+ $urpm->resolve_rejected($db, $state, $p, removed => 1);
+ push @m, scalar $p->fullname;
+ $found = 1;
+ });
$found and next;
}
- #- check if name-version-release may have been given.
+ #- check if name-version-release was given.
if (($n) = /^(.*)-[^\-]*-[^\-]*$/) {
$db->traverse_tag('name', [ $n ], sub {
- my ($p) = @_;
- join('-', ($p->fullname)[0..2]) eq $_ or return;
- $urpm->resolve_rejected($db, $state, $p, removed => 1);
- push @m, scalar $p->fullname;
- $found = 1;
- });
+ my ($p) = @_;
+ join('-', ($p->fullname)[0..2]) eq $_ or return;
+ $urpm->resolve_rejected($db, $state, $p, removed => 1);
+ push @m, scalar $p->fullname;
+ $found = 1;
+ });
$found and next;
}
- #- check if name-version may have been given.
+ #- check if name-version was given.
if (($n) = /^(.*)-[^\-]*$/) {
$db->traverse_tag('name', [ $n ], sub {
- my ($p) = @_;
- join('-', ($p->fullname)[0..1]) eq $_ or return;
- $urpm->resolve_rejected($db, $state, $p, removed => 1);
- push @m, scalar $p->fullname;
- $found = 1;
- });
+ my ($p) = @_;
+ join('-', ($p->fullname)[0..1]) eq $_ or return;
+ $urpm->resolve_rejected($db, $state, $p, removed => 1);
+ push @m, scalar $p->fullname;
+ $found = 1;
+ });
$found and next;
}
- #- check if only name may have been given.
+ #- check if only name was given.
$db->traverse_tag('name', [ $_ ], sub {
- my ($p) = @_;
- $p->name eq $_ or return;
- $urpm->resolve_rejected($db, $state, $p, removed => 1);
- push @m, scalar $p->fullname;
- $found = 1;
- });
+ my ($p) = @_;
+ $p->name eq $_ or return;
+ $urpm->resolve_rejected($db, $state, $p, removed => 1);
+ push @m, scalar $p->fullname;
+ $found = 1;
+ });
$found and next;
push @notfound, $_;
@@ -3155,14 +3164,14 @@ sub find_packages_to_remove {
%$state = ();
@m = ();
- #- search for package that matches, and perform closure again.
+ #- search for packages that match, and perform closure again.
$db->traverse(sub {
- my ($p) = @_;
- my $f = scalar $p->fullname;
- $f =~ $qmatch or return;
- $urpm->resolve_rejected($db, $state, $p, removed => 1);
- push @m, $f;
- });
+ my ($p) = @_;
+ my $f = scalar $p->fullname;
+ $f =~ $qmatch or return;
+ $urpm->resolve_rejected($db, $state, $p, removed => 1);
+ push @m, $f;
+ });
if (!$options{force} && @notfound) {
if (@m) {
diff --git a/urpm/args.pm b/urpm/args.pm
index 9b3ddffa..fa6f1d83 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -151,6 +151,7 @@ my %options_spec = (
a => \$::matches,
noscripts => \$::noscripts,
repackage => \$::repackage,
+ 'bundle!' => sub { $::bundle = $_[1] },
},
#- see also below, autogenerated callbacks
diff --git a/urpme b/urpme
index ce70409b..65e0f03c 100644
--- a/urpme
+++ b/urpme
@@ -27,7 +27,7 @@ use urpm::msg;
$ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin";
delete @ENV{qw(ENV BASH_ENV IFS CDPATH)};
-our ($root, $test, $parallel, $auto, $matches, $verbose, $usedistrib, $force, $noscripts, $repackage, @l);
+our ($root, $test, $parallel, $auto, $matches, $verbose, $usedistrib, $force, $noscripts, $repackage, @l, $bundle);
# Translator: Add here the keys which might be pressed in the "No"-case.
my $noexpr = N("Nn");
# Translator: Add here the keys which might be pressed in the "Yes"-case.
@@ -86,10 +86,9 @@ $urpm->configure(
my @toremove = $urpm->find_packages_to_remove(
$state,
\@l,
- test => $test,
matches => $matches,
- auto => $auto,
force => $force,
+ bundle => $bundle,
callback_notfound => sub {
my $urpm = shift @_;
#- Warning : the following message is parsed in urpm::parallel_*