From d4054ac9f373ec8554dce250d2867adad6cab4ad Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 4 Apr 2000 09:44:16 +0000 Subject: no_comment --- ChangeLog | 8 ++++++++ urpmi | 17 +++++++++++------ urpmi.spec | 5 ++++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb789a2f..98e2f6a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-04-04 Pixel + + * urpmi: add option --force to ignore errors + +2000-04-03 Pixel + + * urpmi (version_compare): bug fix + 2000-03-26 Pixel * autoirpm.update: adapted to new hdlist format. diff --git a/urpmi b/urpmi index 8d962214..2cc8a2b4 100755 --- a/urpmi +++ b/urpmi @@ -16,6 +16,11 @@ if (@ARGV and $ARGV[0] eq '--auto') { shift @ARGV; } +if (@ARGV and $ARGV[0] eq '--force') { + $force = 1; + shift @ARGV; +} + if (@ARGV and $ARGV[0] eq '--X') { $X = 1; shift @ARGV; @@ -31,7 +36,7 @@ while (@ARGV and $ARGV[0] eq '--comment') { shift @ARGV; } -@ARGV or die(_("usage: urpmi [-h] [--auto] [-a] package_name [package_names...]\n")); +@ARGV or die(_("usage: urpmi [-h] [--auto] [--force] [-a] package_name [package_names...]\n")); log_it(scalar localtime, " urpmi called with @ARGV\n"); @@ -80,9 +85,9 @@ foreach (@ARGV) { } else { my $l = $found{$_} || $foundi{$_}; if (@$l == 0) { - warn(_("no package named %s\n", $_)); $ok = 0; + warn(_("no package named %s\n", $_)); $ok = $force; } elsif (@$l > 1 && !$all) { - warn(_("The following packages contain %s: %s\n", $_, join(' ', @$l))); $ok = 0; + warn(_("The following packages contain %s: %s\n", $_, join(' ', @$l))); $ok = $force; } else { push @packages, @$l; } @@ -184,13 +189,13 @@ sub install { m|^/| && !-e $_ and exit 1 foreach @_; #- missing local file print SAVEOUT _("Try installation without cheking dependencies?"), " (Y/n) "; - =~ /n/i and exit 1; + $force or =~ /n/i and exit 1; system("rpm", "-U", "--nodeps", @_); if ($?) { message(_("Installation failed")); print SAVEOUT _("Try installation even more strongly (--force)?"), " (Y/n) "; - =~ /n/i and exit 0; + $force or =~ /n/i and exit 0; system("rpm", "-U", "--nodeps", "--force", @_); } } @@ -255,7 +260,7 @@ sub version_compare { my ($a, $b) = @_; local $_; - while ($a && $b) { + while ($a || $b) { my ($sb, $sa) = map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D+)// } ($b, $a); $_ = length($sa) cmp length($sb) || $sa cmp $sb and return $_; } diff --git a/urpmi.spec b/urpmi.spec index 02343e39..4511bef7 100644 --- a/urpmi.spec +++ b/urpmi.spec @@ -2,7 +2,7 @@ Name: urpmi Version: 1.1 -Release: 4mdk +Release: 5mdk License: GPL Source0: %{name}.tar.bz2 Summary: User mode rpm install @@ -89,6 +89,9 @@ autoirpm.uninstall %changelog +* Tue Apr 4 2000 Pixel 1.1-5mdk +- urpmi: add option --force to ignore errors + * Sun Mar 26 2000 Pixel 1.1-4mdk - autoirpm.update: adapted to new hdlist format -- cgit v1.2.1