summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm7
-rwxr-xr-xurpmf7
-rwxr-xr-xurpmi12
-rw-r--r--urpmi.spec9
4 files changed, 26 insertions, 9 deletions
diff --git a/urpm.pm b/urpm.pm
index e7850b67..8adaadbf 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -663,6 +663,8 @@ sub configure {
local $SIG{INT} = $sig_handler;
local $SIG{QUIT} = $sig_handler;
local *RPMDB;
+
+ $db or $urpm->{fatal}(_"unable to open rpmdb");
open RPMDB, "| " . ($ENV{LD_LOADER} || '') . " gzip -9 >'$options{bug}/rpmdb.cz'";
$db->traverse(sub{
my ($p) = @_;
@@ -1802,6 +1804,7 @@ sub resolve_dependencies {
$db->parse_synthesis($options{rpmdb});
} else {
$db = URPM::DB::open($urpm->{root});
+ $db or $urpm->{fatal}(_"unable to open rpmdb");
}
my $sig_handler = sub { undef $db; exit 3 };
@@ -2218,6 +2221,8 @@ sub install {
my ($update, @l, %file2pkg) = (0);
local *F;
+ $db or $urpm->{fatal}(_"unable to open rpmdb");
+
foreach (@$remove) {
$trans->remove($_) or $urpm->{error}(_("unable to remove package %s", $_));
}
@@ -2296,6 +2301,8 @@ sub find_packages_to_remove {
my $db = URPM::DB::open($options{root});
my (@m, @notfound);
+ $db or $urpm->{fatal}(_"unable to open rpmdb");
+
if (!$options{matches}) {
foreach (@$l) {
my ($n, $found);
diff --git a/urpmf b/urpmf
index c0777aee..37ee9df0 100755
--- a/urpmf
+++ b/urpmf
@@ -48,6 +48,7 @@ usage:
") . _(" --files - print tag files: all files (multiple lines).
") . _(" --conflicts - print tag conflicts: all conflicts (multiple lines).
") . _(" --obsoletes - print tag obsoletes: all obsoletes (multiple lines).
+") . _(" -i - ignore case distinctions in any pattern.
") . _(" -f - print version, release and arch with name.
") . _(" -e - include perl code directly as perl -e.
") . _(" -a - binary AND operator, true if both expression are true.
@@ -65,7 +66,8 @@ my $media = '';
my $synthesis = '';
my $verbose = 0;
my $quiet = undef;
-my $fullname = '';
+my $pattern = '';
+my $full = '';
my %params;
#- parse arguments list.
@@ -84,13 +86,14 @@ while (defined($_ = shift @ARGV)) {
foreach qw(group size summary description provides requires files conflicts obsoletes); next };
/^--(group|size|epoch|summary|description|provides|requires|files|conflicts|obsoletes)$/ and
do { $params{$1} = 1; next };
+ /^-i$/ and do { $pattern = 'i'; next };
/^-f$/ and do { $full = 'full'; next };
/^-e$/ and do { $expr .= '('.$_.')'; next };
/^-a$/ and do { $expr .= ' && '; next };
/^-o$/ and do { $expr .= ' || '; next };
/^[!\(\)]$/ and do { $expr .= $_; next };
#- assume a regex directly
- $expr .= 'm{'.$_.'}';
+ $expr .= 'm{'.$_.'}'.$pattern;
}
my $urpm = new urpm;
diff --git a/urpmi b/urpmi
index de77fde9..f55a2732 100755
--- a/urpmi
+++ b/urpmi
@@ -114,7 +114,7 @@ usage:
") . _(" -s - next package is a source package (same as --src).
") . _(" -q - quiet mode.
") . _(" -v - verbose mode.
-") . "\n" . _(" names or rpm files given on command line are installed.
+") . "\n" . _(" names or rpm files given on command line will be installed.
");
exit(0);
}
@@ -181,12 +181,12 @@ while (defined($_ = shift @ARGV)) {
/c/ and do { next };
/m/ and do { next };
/M/ and do { next }; #- nop
- /q/ and do { $rpm_opt = ""; next };
+ /q/ and do { --$verbose; $rpm_opt = ""; next };
/p/ and do { $use_provides = 1; next };
/P/ and do { $use_provides = 0; next };
/y/ and do { $fuzzy = 1; next };
/s/ and do { $src = 1; next };
- /v/ and do { $verbose = 1; next };
+ /v/ and do { ++$verbose; $rpm_opt = "vh"; next };
die _("urpmi: unknown option \"-%s\", check usage with --help\n", $1); } next };
@nextargv and do { my $r = shift @nextargv; $r and $$r = $_; next };
if (/\.rpm$/) {
@@ -295,7 +295,7 @@ unless ($bug) {
$urpm->{error} = sub { printf SAVEERR "%s\n", $_[0] };
$urpm->{log} = sub { printf SAVEERR "%s\n", $_[0] };
}
-$verbose or $urpm->{log} = sub {};
+$verbose > 0 or $urpm->{log} = sub {};
$urpm->configure(nocheck_access => $env || $uid > 0,
media => $media,
@@ -457,7 +457,7 @@ unless ($local_sources || $list) {
}
my %sources = $urpm->download_source_packages($local_sources, $list,
- verbose => $verbose,
+ verbose => $verbose > 0,
force_local => !$X, ask_for_medium => (!$auto || $allow_medium_change) && sub {
my $msg = _("Please insert the medium named \"%s\" on device [%s]", @_);
my $msg2 = _("Press Enter when ready...");
@@ -585,7 +585,7 @@ if (%sources_install || %sources) {
}
}
} else {
- message(_("everything already installed"), $auto);
+ $verbose >= 0 and message(_("everything already installed"), $auto);
}
#- try to umount removable device which may have been mounted.
diff --git a/urpmi.spec b/urpmi.spec
index b035747c..307ecd09 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 4.2
-Release: 2mdk
+Release: 3mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -204,6 +204,13 @@ fi
%changelog
+* Mon Jan 6 2003 François Pons <fpons@mandrakesoft.com> 4.2-3mdk
+- fixed -q to avoid a message.
+- made -q and -v opposite.
+- added -i to urpmf.
+- check rpmdb open status (should never fails unless...) in order
+ to give a better error message.
+
* Thu Dec 19 2002 François Pons <fpons@mandrakesoft.com> 4.2-2mdk
- added log for package download if verbose.
- fixed using hdlist if no synthesis available or invalid.