summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-06-16 18:05:35 +0000
committerFrancois Pons <fpons@mandriva.com>2003-06-16 18:05:35 +0000
commit07f01970048de8314c51781c6a577191b258bbf7 (patch)
tree4ff13cffffafae22cfb19360933073c5aed8c1de
parent254d9d92ea1755216fa5f7bfdfe0ff5ee44f27a8 (diff)
downloadurpmi-07f01970048de8314c51781c6a577191b258bbf7.tar
urpmi-07f01970048de8314c51781c6a577191b258bbf7.tar.gz
urpmi-07f01970048de8314c51781c6a577191b258bbf7.tar.bz2
urpmi-07f01970048de8314c51781c6a577191b258bbf7.tar.xz
urpmi-07f01970048de8314c51781c6a577191b258bbf7.zip
4.4-1mdk
-rw-r--r--urpm.pm163
-rwxr-xr-xurpmi368
-rw-r--r--urpmi.spec10
3 files changed, 308 insertions, 233 deletions
diff --git a/urpm.pm b/urpm.pm
index 3e404655..bddda161 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -3,7 +3,7 @@ package urpm;
use strict;
use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '4.3';
+$VERSION = '4.4';
@ISA = qw(Exporter URPM);
@EXPORT = qw(*N);
@@ -784,10 +784,16 @@ sub configure {
}
#- determine package to withdraw (from skip.list file) only if something should be withdrawn.
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)));
- });
+ $urpm->compute_flags($urpm->get_packages_list($urpm->{skiplist}, $options{skip}), skip => 1, callback => sub {
+ my ($urpm, $pkg) = @_;
+ $urpm->{log}(N("skipping package %s", scalar($pkg->fullname)));
+ });
+ }
+ unless ($options{noinstalling}) {
+ $urpm->compute_flags($urpm->get_packages_list($urpm->{instlist}, $options{skip}), disable_obsolete => 1, callback => sub {
+ my ($urpm, $pkg) = @_;
+ $urpm->{log}(N("would install instead of upgrade package %s", scalar($pkg->fullname)));
+ });
}
if ($options{bug}) {
#- and a dump of rpmdb itself as synthesis file.
@@ -2150,32 +2156,41 @@ sub resolve_dependencies {
$options{auto_select} and $urpm->request_packages_to_upgrade($db, $state, $requested, requested => undef);
$urpm->resolve_requested($db, $state, $requested, %options);
+
+ #- build transaction set now...
+ $urpm->build_transaction_set($db, $state, %options);
}
}
#- get list of package that should not be upgraded.
-sub get_unwanted_packages {
- my ($urpm, $skip) = @_;
- my %skip;
+sub get_packages_list {
+ my ($urpm, $file, $extra) = @_;
+ my %val;
local ($_, *F);
- open F, $urpm->{skiplist};
+ open F, $file;
while (<F>) {
chomp; s/#.*$//; s/^\s*//; s/\s*$//;
if (my ($n, $s) = /^([^\s\[]+)(?:\[\*\])?\[?\s*([^\s\]]*\s*[^\s\]]*)/) {
- $skip{$n}{$s} = undef;
+ $val{$n}{$s} = undef;
}
}
close F;
#- additional skipping from given parameter.
- foreach (split ',', $skip) {
+ foreach (split ',', $extra) {
if (my ($n, $s) = /^([^\s\[]+)(?:\[\*\])?\[?\s*([^\s\]]*\s*[^\s\]]*)/) {
- $skip{$n}{$s} = undef;
+ $val{$n}{$s} = undef;
}
}
- \%skip;
+ \%val;
+}
+#- for compability...
+sub get_unwanted_packages {
+ my ($urpm, $skip) = @_;
+ print STDERR "calling obsoleted method urpm::get_unwanted_packages\n";
+ get_packages_list($urpm->{skiplist}, $skip);
}
#- select source for package selected.
@@ -2307,7 +2322,48 @@ sub get_source_packages {
#- return a list of package ready for rpm.
sub download_source_packages {
my ($urpm, $local_sources, $list, %options) = @_;
- my (%sources, %error_sources, %removables);
+ my %sources = %$local_sources;
+ my %error_sources;
+
+ print STDERR "calling obsoleted method urpm::download_source_packages\n";
+
+ $urpm->exlock_urpmi_db;
+ $urpm->copy_packages_of_removable_media($list, \%sources, %options) or return;
+ $urpm->download_packages_of_distant_media($list, \%sources, \%error_sources, %options);
+ $urpm->unlock_urpmi_db;
+
+ %sources, %error_sources;
+}
+
+sub exlock_urpmi_db {
+ my ($urpm) = @_;
+
+ #- avoid putting a require on Fcntl ':flock' (which is perl and not perl-base).
+ my $LOCK_EX = 2;
+
+ #- lock urpmi database, but keep lock to wait for an urpmi.update to finish.
+ open LOCK_FILE, $urpm->{statedir};
+ flock LOCK_FILE, $LOCK_EX or $urpm->{fatal}(7, N("urpmi database locked"));
+}
+
+sub unlock_urpmi_db {
+ my ($_urpm) = @_;
+
+ #- avoid putting a require on Fcntl ':flock' (which is perl and not perl-base).
+ my $LOCK_UN = 8;
+
+ #- now everything is finished.
+ system("sync");
+
+ #- release lock on database.
+ flock LOCK_FILE, $LOCK_UN;
+ close LOCK_FILE;
+
+}
+
+sub copy_packages_of_removable_media {
+ my ($urpm, $list, $sources, %options) = @_;
+ my %removables;
#- make sure everything is correct on input...
@{$urpm->{media} || []} == @$list or return;
@@ -2361,13 +2417,13 @@ sub download_source_packages {
#- now we can consider the file to be fine.
unlink "$urpm->{cachedir}/rpms/$filename";
rename "$urpm->{cachedir}/partial/$filename", "$urpm->{cachedir}/rpms/$filename";
- -r "$urpm->{cachedir}/rpms/$filename" and $sources{$i} = "$urpm->{cachedir}/rpms/$filename";
+ -r "$urpm->{cachedir}/rpms/$filename" and $sources->{$i} = "$urpm->{cachedir}/rpms/$filename";
}
} else {
- $sources{$i} = $filepath;
+ $sources->{$i} = $filepath;
}
}
- unless ($sources{$i}) {
+ unless ($sources->{$i}) {
#- fallback to use other method for retrieving the file later.
$urpm->{error}(N("unable to read rpm file [%s] from medium \"%s\"", $filepath, $medium->{name}));
}
@@ -2381,14 +2437,6 @@ sub download_source_packages {
}
};
- #- avoid putting a require on Fcntl ':flock' (which is perl and not perl-base).
- my ($LOCK_EX, $LOCK_UN) = (2, 8);
-
- #- lock urpmi database, but keep lock to wait for an urpmi.update to finish.
- local (*LOCK_FILE);
- open LOCK_FILE, $urpm->{statedir};
- flock LOCK_FILE, $LOCK_EX or $urpm->{fatal}(7, N("urpmi database locked"));
-
foreach (0..$#$list) {
values %{$list->[$_]} or next;
my $medium = $urpm->{media}[$_];
@@ -2428,6 +2476,12 @@ sub download_source_packages {
$examine_removable_medium->($removables{$device}[0], $device, $urpm->is_using_supermount($device) && 'copy');
}
+ 1;
+}
+
+sub download_packages_of_distant_media {
+ my ($urpm, $list, $sources, $error_sources, %options) = @_;
+
#- get back all ftp and http accessible rpms file into the local cache
#- if necessary (as used by checksig or any other reasons).
foreach (0..$#$list) {
@@ -2439,18 +2493,18 @@ sub download_source_packages {
#- examine all files to know what can be indexed on multiple media.
while (my ($i, $url) = each %{$list->[$_]}) {
#- it is trusted that the url given is acceptable, so the file can safely be ignored.
- defined $sources{$i} and next;
+ defined $sources->{$i} and next;
if ($url =~ /^(removable[^:]*|file):\/(.*\.rpm)$/) {
if (-r $2) {
- $sources{$i} = $2;
+ $sources->{$i} = $2;
} else {
- $error_sources{$i} = $2;
+ $error_sources->{$i} = $2;
}
} elsif ($url =~ /^([^:]*):\/(.*\/([^\/]*\.rpm))$/) {
if ($options{force_local} || $1 ne 'ftp' && $1 ne 'http') { #- only ftp and http protocol supported by grpmi.
$distant_sources{$i} = "$1:/$2";
} else {
- $sources{$i} = "$1:/$2";
+ $sources->{$i} = "$1:/$2";
}
} else {
$urpm->{error}(N("malformed input: [%s]", $url));
@@ -2484,51 +2538,44 @@ sub download_source_packages {
#- it seems the the file has been downloaded correctly and has been checked to be valid.
unlink "$urpm->{cachedir}/rpms/$filename";
rename "$urpm->{cachedir}/partial/$filename", "$urpm->{cachedir}/rpms/$filename";
- -r "$urpm->{cachedir}/rpms/$filename" and $sources{$i} = "$urpm->{cachedir}/rpms/$filename";
+ -r "$urpm->{cachedir}/rpms/$filename" and $sources->{$i} = "$urpm->{cachedir}/rpms/$filename";
}
- unless ($sources{$i}) {
- $error_sources{$i} = $distant_sources{$i};
+ unless ($sources->{$i}) {
+ $error_sources->{$i} = $distant_sources{$i};
}
}
}
}
#- clean failed download which have succeeded.
- delete @error_sources{keys %sources};
+ delete @{$error_sources}{keys %$sources};
- #- now everything is finished.
- system("sync");
+ 1;
+}
- #- release lock on database.
- flock LOCK_FILE, $LOCK_UN;
- close LOCK_FILE;
+#- prepare transaction.
+sub prepare_transaction {
+ my ($urpm, $set, $list, $sources, $transaction_list, $transaction_sources) = @_;
- #- return the hash of rpm file that have to be installed, they are all local now.
- %$local_sources, %sources, %error_sources;
+ foreach my $id (@{$set->{upgrade}}) {
+ my $pkg = $urpm->{depslist}[$id];
+ foreach (0..$#$list) {
+ exists $list->[$_]{$id} and $transaction_list->[$_]{$id} = $list->[$_]{$id};
+ }
+ exists $sources->{$id} and $transaction_sources->{$id} = $sources->{$id};
+ }
}
#- extract package that should be installed instead of upgraded,
#- sources is a hash of id -> source rpm filename.
sub extract_packages_to_install {
my ($urpm, $sources) = @_;
-
my %inst;
- local ($_, *F);
- open F, $urpm->{instlist};
- while (<F>) {
- chomp; s/#.*$//; s/^\s*//; s/\s*$//;
- foreach (keys %{$urpm->{provides}{$_} || {}}) {
- my $pkg = $urpm->{depslist}[$_] or next;
- #- some package with specific naming convention to avoid upgrade problem
- #- should not be taken into account here.
- #- these package have version=1 and release=1mdk, and name contains version and release.
- $pkg->version eq '1' && $pkg->release eq '1mdk' && $pkg->name =~ /^.*-[^\-]*mdk$/ and next;
-
- exists($sources->{$pkg->id}) and $inst{$pkg->id} = delete $sources->{$pkg->id};
- }
+ foreach (keys %$sources) {
+ my $pkg = $urpm->{depslist}[$_] or next;
+ $pkg->flag_disable_obsolete and $inst{$pkg->id} = delete $sources->{$pkg->id};
}
- close F;
\%inst;
}
@@ -2572,7 +2619,7 @@ sub install {
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)));
+ scalar(@{$remove || []}), scalar(values %$install), scalar(values %$upgrade)));
} else {
return (N("unable to create transaction"));
}
@@ -2792,7 +2839,7 @@ sub parallel_remove {
#- misc functions to help finding ask_unselect and ask_remove elements with their reasons translated.
sub unselected_packages {
- my ($urpm, $state, %options) = @_;
+ my ($urpm, $state) = @_;
grep { $state->{rejected}{$_}{backtrack} } keys %{$state->{rejected} || {}};
}
@@ -2808,7 +2855,7 @@ sub translate_why_unselected {
}
sub removed_packages {
- my ($urpm, $state, %options) = @_;
+ my ($urpm, $state) = @_;
grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} } keys %{$state->{rejected} || {}};
}
diff --git a/urpmi b/urpmi
index 75bf7e03..3c646583 100755
--- a/urpmi
+++ b/urpmi
@@ -386,6 +386,7 @@ $urpm->resolve_dependencies($state, \%requested,
callback_choices => \&ask_choice,
install_src => $install_src,
nodeps => $urpm->{options}{'allow-nodeps'} || $urpm->{options}{'allow-force'},
+ split_level => 1,
);
my @ask_unselect = $urpm->unselected_packages($state);
@@ -475,7 +476,8 @@ if (@root_only) {
#- if not root, the list become invisible and no download will be possible.
my ($local_sources, $list) = $urpm->get_source_packages($state->{selected},
- clean_all => $clean, clean_other => !$noclean && $urpm->{options}{'pre-clean'});
+ clean_all => $clean,
+ clean_other => !$noclean && $urpm->{options}{'pre-clean'});
unless ($local_sources || $list) {
$urpm->{fatal}(3, N("unable to get source packages, aborting"));
}
@@ -484,207 +486,229 @@ if ($X) {
require gurpm;
gurpm::init(N("Package installation..."), N("Initializing..."));
}
-my %sources = $urpm->download_source_packages($local_sources, $list,
+
+my %sources = %$local_sources;
+my %error_sources;
+
+$urpm->exlock_urpmi_db;
+$urpm->copy_packages_of_removable_media($list, \%sources,
+ verbose => $verbose > 0,
+ force_local => 1,
+ ask_for_medium => (!$auto || $allow_medium_change) && sub {
+ my $msg = N("Please insert the medium named \"%s\" on device [%s]", @_);
+ my $msg2 = N("Press Enter when ready...");
+ if ($X) {
+ $msg =~ s/"/\\"/g;
+ gmessage($msg);
+ !$?;
+ } else {
+ defined message_input("$msg\n$msg2 ");
+ }
+ });
+
+foreach my $set (@{$state->{transaction} || []}) {
+ my (@transaction_list, %transaction_sources);
+
+ #- prepare transaction...
+ $urpm->prepare_transaction($set, $list, \%sources, \@transaction_list, \%transaction_sources);
+
+ #- first, filter out what is really needed to download for this small transaction.
+ $urpm->download_packages_of_distant_media($list, \%transaction_sources, \%error_sources,
verbose => $verbose > 0,
limit_rate => $urpm->{options}{'limit-rate'},
+ force_local => 1,
callback => sub {
my ($mode, $file, $percent, $total, $eta, $speed) = @_;
- if ($X) {
- if ($mode eq 'start') {
- $file =~ s|/*\s*$||; $file =~ s|.*/||;
- gurpm::label(N("Downloading package `%s'...", $file));
- } elsif ($mode eq 'progress') {
- gurpm::progress($percent/100);
- } elsif ($mode eq 'end') {
- gurpm::progress(1);
- }
- } else {
- if ($mode eq 'start') {
- print STDERR " $file\n"; #- allow pass-protected url to be logged.
- } elsif ($mode eq 'progress') {
- if (defined $total && defined $eta) {
- print SAVEERR N(" %s%% of %s completed, ETA = %s, speed = %s",
- $percent, $total, $eta, $speed) . "\r";
- } else {
- print SAVEERR N(" %s%% completed, speed = %s",
- $percent, $speed) . "\r";
- }
- } elsif ($mode eq 'end') {
- print SAVEERR " " x 79, "\r";
- }
- }
- },
- force_local => 1,
- ask_for_medium => (!$auto || $allow_medium_change) && sub {
- my $msg = N("Please insert the medium named \"%s\" on device [%s]", @_);
- my $msg2 = N("Press Enter when ready...");
if ($X) {
- $msg =~ s/"/\\"/g;
- gmessage($msg);
- !$?;
+ if ($mode eq 'start') {
+ $file =~ s|/*\s*$||; $file =~ s|.*/||;
+ gurpm::label(N("Downloading package `%s'...", $file));
+ } elsif ($mode eq 'progress') {
+ gurpm::progress($percent/100);
+ } elsif ($mode eq 'end') {
+ gurpm::progress(1);
+ }
} else {
- defined message_input("$msg\n$msg2 ");
+ if ($mode eq 'start') {
+ print STDERR " $file\n"; #- allow pass-protected url to be logged.
+ } elsif ($mode eq 'progress') {
+ if (defined $total && defined $eta) {
+ print SAVEERR N(" %s%% of %s completed, ETA = %s, speed = %s",
+ $percent, $total, $eta, $speed) . "\r";
+ } else {
+ print SAVEERR N(" %s%% completed, speed = %s",
+ $percent, $speed) . "\r";
+ }
+ } elsif ($mode eq 'end') {
+ print SAVEERR " " x 79, "\r";
+ }
}
- });
-my %sources_install = %{$urpm->extract_packages_to_install(\%sources) || {}};
-
-if ($urpm->{options}{'verify-rpm'}) {
- my ($medium, %invalid_sources);
+ },
+ );
+ my %transaction_sources_install = %{$urpm->extract_packages_to_install(\%transaction_sources) || {}};
+
+ if ($urpm->{options}{'verify-rpm'}) {
+ my ($medium, %invalid_sources);
- foreach my $id (sort { $a <=> $b } keys %sources_install, keys %sources) {
- my $verif = URPM::verify_rpm($sources_install{$id} || $sources{$id});
+ foreach my $id (sort { $a <=> $b } keys %transaction_sources_install, keys %transaction_sources) {
+ my $verif = URPM::verify_rpm($transaction_sources_install{$id} || $transaction_sources{$id});
- if ($verif =~ /NOT OK/) {
- $invalid_sources{$sources_install{$id} || $sources{$id}} = N("Invalid signature (%s)", $verif);
- } else {
- unless ($medium && $medium->{start} <= $id && $id <= $medium->{end}) {
- $medium = undef;
- foreach (@{$urpm->{media}}) {
- $_->{start} <= $id && $id <= $_->{end} and $medium = $_, last;
+ if ($verif =~ /NOT OK/) {
+ $invalid_sources{$transaction_sources_install{$id} ||
+ $transaction_sources{$id}} = N("Invalid signature (%s)", $verif);
+ } else {
+ unless ($medium && $medium->{start} <= $id && $id <= $medium->{end}) {
+ $medium = undef;
+ foreach (@{$urpm->{media}}) {
+ $_->{start} <= $id && $id <= $_->{end} and $medium = $_, last;
+ }
}
- }
- my $key_ids = $medium && $medium->{key_ids} || $urpm->{options}{key_ids};
- #- check the key ids of the medium are matching (all) the given key id of the package.
- if ($key_ids) {
- my $valid_ids = 0;
- my $invalid_ids = 0;
-
- foreach my $key_id ($verif =~ /#(\S+)/g) {
- if (grep { hex($_) == hex($key_id) } split /[,\s]+/, $key_ids) {
- ++$valid_ids;
- } else {
- ++$invalid_ids;
+ my $key_ids = $medium && $medium->{key_ids} || $urpm->{options}{key_ids};
+ #- check the key ids of the medium are matching (all) the given key id of the package.
+ if ($key_ids) {
+ my $valid_ids = 0;
+ my $invalid_ids = 0;
+
+ foreach my $key_id ($verif =~ /#(\S+)/g) {
+ if (grep { hex($_) == hex($key_id) } split /[,\s]+/, $key_ids) {
+ ++$valid_ids;
+ } else {
+ ++$invalid_ids;
+ }
}
- }
- if ($invalid_ids) {
- $invalid_sources{$sources_install{$id} || $sources{$id}} = N("Invalid Key ID (%s)", $verif);
- } elsif (!$valid_ids) {
- $invalid_sources{$sources_install{$id} || $sources{$id}} = N("Missing signature (%s)", $verif);
+ if ($invalid_ids) {
+ $invalid_sources{$transaction_sources_install{$id} ||
+ $transaction_sources{$id}} = N("Invalid Key ID (%s)", $verif);
+ } elsif (!$valid_ids) {
+ $invalid_sources{$transaction_sources_install{$id} ||
+ $transaction_sources{$id}} = N("Missing signature (%s)", $verif);
+ }
}
}
}
- }
- if (%invalid_sources) {
- my $msg = N("The following packages have bad signatures");
- my $msg2 = N("Do you want to continue installation ?");
- my $p = join "\n", map { "$_: $invalid_sources{$_}"} sort { $a cmp $b} keys %invalid_sources;
- if ($auto) {
- message("$msg:\n$p\n", 'noX');
- exit 1;
- } else {
- if ($X) {
- gmessage("$msg:\n$p\n\n$msg2");
- $? and exit 1;
+ if (%invalid_sources) {
+ my $msg = N("The following packages have bad signatures");
+ my $msg2 = N("Do you want to continue installation ?");
+ my $p = join "\n", map { "$_: $invalid_sources{$_}"} sort { $a cmp $b} keys %invalid_sources;
+ if ($auto) {
+ message("$msg:\n$p\n", 'noX');
+ exit 1;
} else {
- $noexpr = N("Nn");
- $yesexpr = N("Yy");
- message_input("$msg:\n$p\n$msg2" . N(" (y/N) ")) =~ /[$yesexpr]/ or exit 1;
+ if ($X) {
+ gmessage("$msg:\n$p\n\n$msg2");
+ $? and exit 1;
+ } else {
+ $noexpr = N("Nn");
+ $yesexpr = N("Yy");
+ message_input("$msg:\n$p\n$msg2" . N(" (y/N) ")) =~ /[$yesexpr]/ or exit 1;
+ }
}
}
}
-}
-#- check for local files.
-if (my @missing = grep { m|^/| && ! -e $_ } values %sources_install, values %sources) {
- message(N("Installation failed, some files are missing:\n%s\nYou may want to update your urpmi database",
- join "\n", map { " $_" } @missing));
- exit 2;
-}
+ #- check for local files.
+ if (my @missing = grep { m|^/| && ! -e $_ } values %transaction_sources_install, values %transaction_sources) {
+ message(N("Installation failed, some files are missing:\n%s\nYou may want to update your urpmi database",
+ join "\n", map { " $_" } @missing));
+ exit 2;
+ }
-#- install source package only (whatever the user is root or not, but use rpm for that).
-if ($install_src) {
- if (my @l = grep { /\.src\.rpm$/ } values %sources_install, values %sources) {
- system("rpm", "-i$rpm_opt", @l, ($root ? ("--root", $root) : @{[]}));
- $? and message(N("Installation failed")), exit 1;
+ #- install source package only (whatever the user is root or not, but use rpm for that).
+ if ($install_src) {
+ if (my @l = grep { /\.src\.rpm$/ } values %transaction_sources_install, values %transaction_sources) {
+ system("rpm", "-i$rpm_opt", @l, ($root ? ("--root", $root) : @{[]}));
+ $? and message(N("Installation failed")), exit 1;
+ }
+ exit 0;
}
- exit 0;
-}
-#- clean to remove any src package now.
-foreach (\%sources_install, \%sources) {
- foreach my $id (keys %$_) {
- my $pkg = $urpm->{depslist}[$id] or next;
- $pkg->arch eq 'src' and delete $_->{$id};
+ #- clean to remove any src package now.
+ foreach (\%transaction_sources_install, \%transaction_sources) {
+ foreach my $id (keys %$_) {
+ my $pkg = $urpm->{depslist}[$id] or next;
+ $pkg->arch eq 'src' and delete $_->{$id};
+ }
}
-}
-if (%sources_install || %sources) {
- if ($parallel) {
- message(N("distributing %s\n", join(' ', values %sources_install, values %sources)), 'noX');
- #- no remove are handle here, automatically done by each distant node.
- $urpm->{log}("starting distributed install");
- $urpm->parallel_install([ keys %{$state->{rejected} || {}} ], \%sources_install, \%sources,
- test => $test,
- excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs});
+ if (%transaction_sources_install || %transaction_sources) {
+ if ($parallel) {
+ message(N("distributing %s\n", join(' ', values %transaction_sources_install, values %transaction_sources)), 'noX');
+ #- no remove are handle here, automatically done by each distant node.
+ $urpm->{log}("starting distributed install");
+ $urpm->parallel_install([ keys %{$state->{rejected} || {}} ], \%transaction_sources_install, \%transaction_sources,
+ test => $test,
+ excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs});
+ } else {
+ message(N("installing %s\n", join(' ', values %transaction_sources_install, values %transaction_sources)), 'noX');
+ log_it(scalar localtime, " ", join(' ', values %transaction_sources_install, values %transaction_sources), "\n");
+ $urpm->{log}("starting installing packages");
+ my $progress_nb;
+ my $total_nb = grep { m|^/| } values %transaction_sources_install, values %transaction_sources;
+ my $callback_inst = $X && sub {
+ my ($urpm, $type, $id, $subtype, $amount, $total) = @_;
+ my $pkg = defined $id && $urpm->{depslist}[$id];
+
+ if ($subtype eq 'start') {
+ if ($type eq 'trans') {
+ gurpm::label(N("Preparing..."));
+ } else {
+ gurpm::label(N("Installing package `%s' (%s/%s)...", $pkg->name, ++$progress_nb, $total_nb));
+ }
+ } elsif ($subtype eq 'progress') {
+ gurpm::progress($amount/$total);
+ }
+ };
+ my @l = $urpm->install($set->{remove} || [], \%transaction_sources_install, \%transaction_sources,
+ translate_message => 1,
+ oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
+ test => $test,
+ excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs},
+ callback_inst => $callback_inst, callback_trans => $callback_inst);
+ $X and gurpm::end();
+ if (@l) {
+ message(N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
+
+ m|^/| && !-e $_ and exit 2 foreach values %transaction_sources_install, values %transaction_sources; #- missing local file
+ $auto || !$urpm->{options}{'allow-nodeps'} && !$urpm->{options}{'allow-force'} and exit 1;
+
+ $noexpr = N("Nn");
+ $yesexpr = N("Yy");
+ message_input(N("Try installation without checking dependencies? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
+ or exit 1;
+ $urpm->{log}("starting installing packages without deps");
+ @l = $urpm->install($set->{remove} || [], \%transaction_sources_install, \%transaction_sources,
+ translate_message => 1, nodeps => 1,
+ oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
+ test => $test,
+ excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs});
+ if (@l) {
+ message(N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
+ !$urpm->{options}{'allow-force'} and exit 1;
+ message_input(N("Try installation even more strongly (--force)? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
+ or exit 1;
+ $urpm->{log}("starting force installing packages without deps");
+ @l = $urpm->install($set->{remove} || [], \%transaction_sources_install, \%transaction_sources,
+ translate_message => 1, nodeps => 1, force => 1,
+ oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
+ test => $test,
+ excludepath => $urpm->{options}{excludepath},
+ excludedocs => $urpm->{options}{excludedocs});
+ @l and $urpm->fatal(2, N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
+ }
+ } else {
+ $test and message(N("Installation is possible"));
+ }
+ }
+ } elsif ($test) {
+ message(N("Installation is possible"));
} else {
- message(N("installing %s\n", join(' ', values %sources_install, values %sources)), 'noX');
- log_it(scalar localtime, " ", join(' ', values %sources_install, values %sources), "\n");
- $urpm->{log}("starting installing packages");
- my $progress_nb;
- my $total_nb = grep { m|^/| } values %sources_install, values %sources;
- my $callback_inst = $X && sub {
- my ($urpm, $type, $id, $subtype, $amount, $total) = @_;
- my $pkg = defined $id && $urpm->{depslist}[$id];
-
- if ($subtype eq 'start') {
- if ($type eq 'trans') {
- gurpm::label(N("Preparing..."));
- } else {
- gurpm::label(N("Installing package `%s' (%s/%s)...", $pkg->name, ++$progress_nb, $total_nb));
- }
- } elsif ($subtype eq 'progress') {
- gurpm::progress($amount/$total);
- }
- };
- my @l = $urpm->install(\@ask_remove, \%sources_install, \%sources,
- translate_message => 1,
- oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
- test => $test,
- excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs},
- callback_inst => $callback_inst, callback_trans => $callback_inst);
- $X and gurpm::end();
- if (@l) {
- message(N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
-
- m|^/| && !-e $_ and exit 2 foreach values %sources_install, values %sources; #- missing local file
- $auto || !$urpm->{options}{'allow-nodeps'} && !$urpm->{options}{'allow-force'} and exit 1;
-
- $noexpr = N("Nn");
- $yesexpr = N("Yy");
- message_input(N("Try installation without checking dependencies? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
- or exit 1;
- $urpm->{log}("starting installing packages without deps");
- @l = $urpm->install(\@ask_remove, \%sources_install, \%sources,
- translate_message => 1, nodeps => 1,
- oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
- test => $test,
- excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs});
- if (@l) {
- message(N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
- !$urpm->{options}{'allow-force'} and exit 1;
- message_input(N("Try installation even more strongly (--force)? (y/N) "), $force && $yesexpr) =~ /[$yesexpr]/
- or exit 1;
- $urpm->{log}("starting force installing packages without deps");
- @l = $urpm->install(\@ask_remove, \%sources_install, \%sources,
- translate_message => 1, nodeps => 1, force => 1,
- oldpackage => $state->{oldpackage}, post_clean_cache => $urpm->{options}{'post-clean'},
- test => $test,
- excludepath => $urpm->{options}{excludepath},
- excludedocs => $urpm->{options}{excludedocs});
- @l and $urpm->fatal(2, N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
- }
- } else {
- $test and message(N("Installation is possible"));
- }
+ $verbose >= 0 and message(N("Everything already installed"), $auto);
}
-} elsif ($test) {
- message(N("Installation is possible"));
-} else {
- $verbose >= 0 and message(N("Everything already installed"), $auto);
}
+$urpm->unlock_urpmi_db;
#- try to umount removable device which may have been mounted.
$urpm->try_umounting_removables;
diff --git a/urpmi.spec b/urpmi.spec
index 234ed918..b8d4ac85 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -1,15 +1,15 @@
%define group System/Configuration/Packaging
Name: urpmi
-Version: 4.3
-Release: 15mdk
+Version: 4.4
+Release: 1mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
Summary: User mode rpm install
URL: http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/urpmi
Requires: eject webfetch perl-DateManip >= 5.40 gnupg
-PreReq: perl-Locale-gettext >= 1.01-7mdk rpmtools >= 4.3-6mdk perl-URPM >= 0.90-10mdk
+PreReq: perl-Locale-gettext >= 1.01-7mdk rpmtools >= 4.3-6mdk perl-URPM >= 0.91
BuildRequires: bzip2-devel gettext rpm-devel >= 4.0.3 perl-MDK-Common-devel
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch
@@ -202,6 +202,10 @@ $urpm->update_media;
%changelog
+* Mon Jun 16 2003 François Pons <fpons@mandrakesoft.com> 4.4-1mdk
+- added preliminary support for small transaction set.
+- internal library changes (compabilility should have been kept).
+
* Fri Jun 13 2003 François Pons <fpons@mandrakesoft.com> 4.3-15mdk
- fixed incorrect behaviour when no key_ids options are set.
- created retrieve methods and translation methods for packages