summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-08-06 13:25:34 +0000
committerFrancois Pons <fpons@mandriva.com>2002-08-06 13:25:34 +0000
commitf862a58daaf68fbe718c062452897a95cb8b485a (patch)
tree26ebcc44810aa556303718fa7ae70323f6ccae51
parentb6f89cac2475192362cc9325427957b7616d3a95 (diff)
downloadurpmi-f862a58daaf68fbe718c062452897a95cb8b485a.tar
urpmi-f862a58daaf68fbe718c062452897a95cb8b485a.tar.gz
urpmi-f862a58daaf68fbe718c062452897a95cb8b485a.tar.bz2
urpmi-f862a58daaf68fbe718c062452897a95cb8b485a.tar.xz
urpmi-f862a58daaf68fbe718c062452897a95cb8b485a.zip
3.9-6mdk
-rw-r--r--urpm.pm8
-rwxr-xr-xurpmi42
-rw-r--r--urpmi.spec9
3 files changed, 48 insertions, 11 deletions
diff --git a/urpm.pm b/urpm.pm
index 6928a35b..fecec1e6 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -711,8 +711,12 @@ sub select_media {
} elsif (@found == 0 && @foundi == 0) {
$urpm->{error}(_("trying to select inexistent medium \"%s\"", $_));
} else { #- multiple element in found or foundi list.
- $urpm->{error}(_("trying to select multiple media: %s", join(", ", map { _("\"%s\"", $_->{name}) }
- (@found ? @found : @foundi))));
+ $urpm->{log}(_("selecting multiple media: %s", join(", ", map { _("\"%s\"", $_->{name}) }
+ (@found ? @found : @foundi))));
+ #- changed behaviour to select all occurence by default.
+ foreach (@found ? @found : @foundi) {
+ $_->{modified} = 1;
+ }
}
}
}
diff --git a/urpmi b/urpmi
index 685d4f13..76a4dd38 100755
--- a/urpmi
+++ b/urpmi
@@ -29,6 +29,9 @@ my $auto = 0;
my $allow_medium_change = 0;
my $auto_select = 0;
my $force = 0;
+my $allow_nodeps = 0;
+my $allow_force = 0;
+my $force = 0;
my $sync = undef;
my $X = 0;
my $WID = 0;
@@ -69,6 +72,10 @@ usage:
") . _(" --src - next package is a source package (same as -s).
") . _(" --noclean - keep rpm not used in cache.
") . _(" --force - force invocation even if some packages do not exist.
+") . _(" --allow-nodeps - allow asking user to install packages without
+ dependencies checking.
+") . _(" --allow-force - allow asking user to install packages without
+ dependencies checking and integrity.
") . _(" --wget - use wget to retrieve distant files.
") . _(" --curl - use curl to retrieve distant files.
") . _(" --proxy - use specified HTTP proxy, the port number is assumed
@@ -106,6 +113,8 @@ while (defined($_ = shift @ARGV)) {
/^--src$/ and do { $src = 1; next };
/^--noclean$/ and do { $noclean = 1; next };
/^--force$/ and do { $force = 1; next };
+ /^--allow-nodeps$/ and do { $allow_nodeps = 1; next };
+ /^--allow-force$/ and do { $allow_force = 1; next };
/^--wget$/ and do { $sync = sub { my $options = shift @_;
if (ref $options) { $options->{prefer} = 'wget' }
else { $options = { dir => $options, prefer => 'wget' } }
@@ -358,16 +367,32 @@ sub ask_choice {
if (%{$state->{ask_unselect} || {}}) {
my $list = join "\n", map { scalar $urpm->{depslist}[$_]->fullname } keys %{$state->{ask_unselect}};
- $noexpr = _("Nn");
- $yesexpr = _("Yy");
- message_input(_("Some package requested cannot be installed:\n%s\ndo you agree ?", $list) . _(" (Y/n) ")) =~ /[$noexpr]/ and exit 0;
- delete @{$state->{selected}}{keys %{$state->{ask_unselect}}};
+ my $msg = _("Some package requested cannot be installed:\n%s\ndo you agree ?", $list);
+ if ($X) {
+ my $ok = _("Ok");
+ my $cancel = _("Cancel");
+ `gmessage -default $ok -buttons "$ok:0,$cancel:2" "$msg"`;
+ $? and exit 0;
+ } else {
+ $noexpr = _("Nn");
+ $yesexpr = _("Yy");
+ message_input($msg . _(" (Y/n) ")) =~ /[$noexpr]/ and exit 0;
+ delete @{$state->{selected}}{keys %{$state->{ask_unselect}}};
+ }
}
if (%{$state->{ask_remove} || {}}) {
my $list = join "\n", sort { $a cmp $b } keys %{$state->{ask_remove}};
- $noexpr = _("Nn");
- $yesexpr = _("Yy");
- message_input(_("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list) . _(" (Y/n) ")) =~ /[$noexpr]/ and $state->{ask_remove} = {};
+ my $msg = _("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list);
+ if ($X) {
+ my $ok = _("Ok");
+ my $cancel = _("Cancel");
+ `gmessage -default $ok -buttons "$ok:0,$cancel:2" "$msg"`;
+ $? and exit 0;
+ } else {
+ $noexpr = _("Nn");
+ $yesexpr = _("Yy");
+ message_input($msg . _(" (Y/n) ")) =~ /[$noexpr]/ and exit 0;
+ }
}
#- get out of package that should not be upgraded.
@@ -479,7 +504,7 @@ if (%sources_install || %sources) {
message(_("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
m|^/| && !-e $_ and exit 2 foreach values %sources_install, values %sources; #- missing local file
- $auto and exit 1; #- if auto has been set, avoid asking user.
+ $auto || !$allow_nodeps && !$allow_force and exit 1; #- if auto has been set, avoid asking user.
$noexpr = _("Nn");
$yesexpr = _("Yy");
@@ -490,6 +515,7 @@ if (%sources_install || %sources) {
translate_message => 1, nodeps => 1);
if (@l) {
message(_("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
+ !$allow_force and exit 1;
message_input(_("Try installation even more strongly (--force)? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
or exit 1;
$urpm->{log}("starting force installing packages without deps");
diff --git a/urpmi.spec b/urpmi.spec
index 56766683..f6c707cf 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 3.9
-Release: 5mdk
+Release: 6mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -144,6 +144,13 @@ fi
%changelog
+* Tue Aug 6 2002 François Pons <fpons@mandrakesoft.com> 3.9-6mdk
+- added --allow-nodeps and --allow-force option to urpmi.
+- globing multiple media name select them all instead of error.
+- answering no to remove package cause urpmi to exit immediately.
+- added support for X for asking user to unselect package or to
+ remove package.
+
* Fri Jul 26 2002 François Pons <fpons@mandrakesoft.com> 3.9-5mdk
- fixed man pages typo.
- sorted package to remove list.