diff options
author | Francois Pons <fpons@mandriva.com> | 2003-04-23 12:46:41 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-04-23 12:46:41 +0000 |
commit | f781f1349f99779400f34836ea03ef7028188998 (patch) | |
tree | 421b57d53cf4a80ec4be793911f81b4f63383a0c | |
parent | c5492870ad725e27c6ce7ba7142dd69a30363d12 (diff) | |
download | urpmi-f781f1349f99779400f34836ea03ef7028188998.tar urpmi-f781f1349f99779400f34836ea03ef7028188998.tar.gz urpmi-f781f1349f99779400f34836ea03ef7028188998.tar.bz2 urpmi-f781f1349f99779400f34836ea03ef7028188998.tar.xz urpmi-f781f1349f99779400f34836ea03ef7028188998.zip |
4.3-6mdk
-rw-r--r-- | urpm.pm | 33 | ||||
-rwxr-xr-x | urpmf | 48 | ||||
-rw-r--r-- | urpmi.spec | 7 |
3 files changed, 66 insertions, 22 deletions
@@ -779,10 +779,12 @@ sub configure { } } #- determine package to withdraw (from skip.list file). - $urpm->compute_skip_flags($urpm->get_unwanted_packages($options{skip}), callback => sub { - my ($urpm, $pkg) = @_; - $urpm->{log}(N("skipping package %s", scalar($pkg->fullname))); - }); + unless ($options{noskipping}) { + $urpm->compute_skip_flags($urpm->get_unwanted_packages($options{skip}), callback => sub { + my ($urpm, $pkg) = @_; + $urpm->{log}(N("skipping package %s", scalar($pkg->fullname))); + }); + } if ($options{bug}) { #- and a dump of rpmdb itself as synthesis file. my $db = URPM::DB::open($options{root}); @@ -2547,20 +2549,35 @@ sub install { $db or $urpm->{fatal}(9, N("unable to open rpmdb")); my $trans = $db->create_transaction($urpm->{root}); + if ($trans) { + $urpm->{log}(N("created transaction for installing on %s (remove=%d, install=%d, upgrade=%d)", $urpm->{root} || '/', + scalar(@$remove), scalar(values %$install), scalar(values %$upgrade))); + } else { + return (N("unable to create transaction")); + } + my ($update, @l, %file2pkg) = 0; local *F; foreach (@$remove) { - $trans->remove($_) or $urpm->{error}(N("unable to remove package %s", $_)); + if ($trans->remove($_)) { + $urpm->{log}(N("removing package %s", $_)); + } else { + $urpm->{error}(N("unable to remove package %s", $_)); + } } foreach my $mode ($install, $upgrade) { foreach (keys %$mode) { my $pkg = $urpm->{depslist}[$_]; $file2pkg{$mode->{$_}} = $pkg; $pkg->update_header($mode->{$_}); - $trans->add($pkg, - update => $update, $options{excludepath} ? (excludepath => [ split ',', $options{excludepath} ]) : ()) - or $urpm->{error}(N("unable to install package %s", $mode->{$_})); + if ($trans->add($pkg, update => $update, + $options{excludepath} ? (excludepath => [ split ',', $options{excludepath} ]) : ())) { + $urpm->{log}(N("adding package %s (id=%d, eid=%d, update=%d, file=%s)", scalar($pkg->fullname), + $_, $pkg->id, $update, $mode->{$_})); + } else { + $urpm->{error}(N("unable to install package %s", $mode->{$_})); + } } ++$update; } @@ -32,6 +32,7 @@ usage: ") . N(" --verbose - verbose mode. ") . N(" --quiet - do not print tag name (default if no tag given on command line, incompatible with interactive mode). +") . N(" --uniq - do not print identical lines. ") . N(" --all - print all tags. ") . N(" --name - print tag name: rpm filename (assumed if no tag given on command line but without package name). @@ -40,11 +41,15 @@ usage: ") . N(" --epoch - print tag epoch: epoch. ") . N(" --summary - print tag summary: summary. ") . N(" --description - print tag description: description. -") . N(" --provides - print tag provides: all provides (multiple lines). -") . N(" --requires - print tag requires: all requires (multiple lines). -") . N(" --files - print tag files: all files (multiple lines). -") . N(" --conflicts - print tag conflicts: all conflicts (multiple lines). -") . N(" --obsoletes - print tag obsoletes: all obsoletes (multiple lines). +") . N(" --sourcerpm - print tag sourcerpm: source rpm. +") . N(" --packager - print tag packager: packager. +") . N(" --buildhost - print tag buildhost: build host. +") . N(" --url - print tag url: url. +") . N(" --provides - print tag provides: all provides. +") . N(" --requires - print tag requires: all requires. +") . N(" --files - print tag files: all files. +") . N(" --conflicts - print tag conflicts: all conflicts. +") . N(" --obsoletes - print tag obsoletes: all obsoletes. ") . N(" -i - ignore case distinctions in every pattern. ") . N(" -f - print version, release and arch with name. ") . N(" -e - include perl code directly as perl -e. @@ -63,9 +68,10 @@ my $media = ''; my $synthesis = ''; my $verbose = 0; my $quiet; +my $uniq = ''; my $pattern = ''; my $full = ''; -my %params; +my (%params, %uniq); #- parse arguments list. my $expr; @@ -79,10 +85,16 @@ while (defined($_ = shift @ARGV)) { /^--synthesis$/ and do { push @nextargv, \$synthesis; next }; /^--verbose$/ and do { $verbose = 1; next }; /^--quiet$/ and do { $quiet = 1; next }; + /^--uniq$/ and do { $uniq = 1; next }; /^--all$/ and do { $params{$_} = 1 - foreach qw(group size summary description provides requires files conflicts obsoletes); next }; - /^--(group|size|epoch|summary|description|provides|requires|files|conflicts|obsoletes)$/ and + foreach qw(filename group size summary description sourcerpm packager buildhost url + provides requires files conflicts obsoletes); next }; + /^--name$/ and do { $params{filename} = 1; next }; + /^--(group|size|epoch|summary|description|sourcerpm|packager|buildhost|url|provides|requires|files|conflicts|obsoletes)$/ and do { $params{$1} = 1; next }; + /^-v$/ and do { $verbose = 1; next }; + /^-q$/ and do { $quiet = 1; next }; + /^-u$/ and do { $uniq = 1; next }; /^-i$/ and do { $pattern = 'i'; next }; /^-f$/ and do { $full = 'full'; next }; /^-e$/ and do { $expr .= '('.$_.')'; next }; @@ -105,20 +117,30 @@ foreach (scalar(keys %params)) { #- build callback according expression. my $callback = 'sub { my ($urpm, $pkg) = @_; '; #- it is a good start for a sub, no ;-) -foreach (qw(group size epoch summary description provides requires files conflicts obsoletes)) { - $params{$_} and $callback .= 'foreach my $e ($pkg->'.$_.') { local $_ = $pkg->'.$full.'name."'.(!$quiet && ":$_").':$e"; '.$expr.' or next; print "$_\n" }'; +foreach (qw(filename group size epoch summary description sourcerpm packager buildhost url + provides requires files conflicts obsoletes)) { + $params{$_} and $callback .= ' + foreach my $e ($pkg->'.$_.') { + local $_ = $pkg->'.$full.'name."'.(!$quiet && ":$_").':$e"; + '.$expr.' or next; + '.($uniq && 'exists $uniq{$_} and next; $uniq{$_} = undef; + ').'print "$_\n"; + }'; } -$callback .= ' 1; }'; +$callback .= ' + 1; +}'; $urpm->{log}(N("callback is :\n%s\n", $callback)); $callback = eval $callback; $@ and usage; -$urpm->configure(nocheck_access => 1, +$urpm->configure(nocheck_access => 1, noskipping => 1, media => $media, synthesis => $synthesis, update => $update, callback => $callback, - hdlist => $params{summary} || $params{description} || $params{files}, + hdlist => ($params{summary} || $params{description} || $params{sourcerpm} || + $params{packager} || $params{buildhost} || $params{url} || $params{files}), ); #- that'all! all has been done by callback above. @@ -2,7 +2,7 @@ Name: urpmi Version: 4.3 -Release: 5mdk +Release: 6mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -199,6 +199,11 @@ $urpm->update_media; %changelog +* Wed Apr 23 2003 François Pons <fpons@mandrakesoft.com> 4.3-6mdk +- added more log when installing packages. +- urpmf: added --sourcerpm, --packager, --buildhost, --url, --uniq + and -v, -q, -u (as alias to --verbose, --quiet, --uniq). + * Tue Apr 22 2003 François Pons <fpons@mandrakesoft.com> 4.3-5mdk - improved output of urpmq -i (with packager, buildhost and url). - fixed output of download informations (without callback). |