summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-04-04 09:44:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-04-04 09:44:16 +0000
commitd4054ac9f373ec8554dce250d2867adad6cab4ad (patch)
treee6d047f6eb7137a98e23c897c8865ec5e3404635
parent932b0d7197c6b9756d040c7aec08aea3b955c50e (diff)
downloadurpmi-d4054ac9f373ec8554dce250d2867adad6cab4ad.tar
urpmi-d4054ac9f373ec8554dce250d2867adad6cab4ad.tar.gz
urpmi-d4054ac9f373ec8554dce250d2867adad6cab4ad.tar.bz2
urpmi-d4054ac9f373ec8554dce250d2867adad6cab4ad.tar.xz
urpmi-d4054ac9f373ec8554dce250d2867adad6cab4ad.zip
no_comment
-rw-r--r--ChangeLog8
-rwxr-xr-xurpmi17
-rw-r--r--urpmi.spec5
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 <pixel@mandrakesoft.com>
+
+ * urpmi: add option --force to ignore errors
+
+2000-04-03 Pixel <pixel@mandrakesoft.com>
+
+ * urpmi (version_compare): bug fix
+
2000-03-26 Pixel <pixel@mandrakesoft.com>
* 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) ";
- <STDIN> =~ /n/i and exit 1;
+ $force or <STDIN> =~ /n/i and exit 1;
system("rpm", "-U", "--nodeps", @_);
if ($?) {
message(_("Installation failed"));
print SAVEOUT _("Try installation even more strongly (--force)?"), " (Y/n) ";
- <STDIN> =~ /n/i and exit 0;
+ $force or <STDIN> =~ /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 <pixel@mandrakesoft.com> 1.1-5mdk
+- urpmi: add option --force to ignore errors
+
* Sun Mar 26 2000 Pixel <pixel@mandrakesoft.com> 1.1-4mdk
- autoirpm.update: adapted to new hdlist format