diff options
Diffstat (limited to 'URPM')
-rw-r--r-- | URPM/Build.pm | 8 | ||||
-rw-r--r-- | URPM/Resolve.pm | 16 |
2 files changed, 16 insertions, 8 deletions
diff --git a/URPM/Build.pm b/URPM/Build.pm index 0dd97ba..40eb49a 100644 --- a/URPM/Build.pm +++ b/URPM/Build.pm @@ -1,5 +1,7 @@ package URPM; +# $Id$ + use strict; sub _get_tmp_dir () { @@ -444,9 +446,7 @@ sub build_synthesis { my ($urpm, %options) = @_; my ($ratio, @idlist); - @idlist = @{$options{idlist} || []} > 0 ? @{$options{idlist}} : - ($options{start} || 0 .. $options{end} || $#{$urpm->{depslist}}); - @idlist or return; + @idlist = $urpm->build_listid($options{start}, $options{end}, $options{idlist}) or return; $ratio = $options{ratio} || 9; $options{synthesis} || defined $options{fd} or die "invalid parameters given"; @@ -485,6 +485,8 @@ sub build_synthesis { sub build_base_files { my ($urpm, %options) = @_; + my @idlist = $urpm->build_listid($options{start}, $options{end}, $options{idlist}) or return; + if ($options{depslist}) { open my $fh, ">$options{depslist}"; foreach (0 .. $#{$urpm->{depslist}}) { diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 67e9f55..0077bad 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1,5 +1,7 @@ package URPM; +# $Id$ + use strict; sub min { my $n = shift; $_ < $n and $n = $_ foreach @_; $n } @@ -980,10 +982,10 @@ sub request_packages_to_upgrade { my ($urpm, $db, $_state, $requested, %options) = @_; my (%provides, %names, %skip, %requested, %obsoletes, @obsoleters); + my @idlist = $urpm->build_listid($options{start}, $options{end}, $options{idlist}) or return; + #- build direct access to best package according to name. - foreach my $pkg (@{$urpm->{depslist}}) { - defined $options{start} && $pkg->id < $options{start} and next; - defined $options{end} && $pkg->id > $options{end} and next; + foreach my $pkg (@{$urpm->{depslist}}[@idlist]) { if ($pkg->is_arch_compat) { foreach ($pkg->provides) { @@ -1142,12 +1144,16 @@ sub build_transaction_set { #- clean transaction set. $state->{transaction} = []; + my %selected_id; + @selected_id{$urpm->build_listid($options{start}, $options{end}, $options{idlist})} = (); + if ($options{split_length}) { #- first step consists of sorting packages according to dependencies. my @sorted = sort { ($a <=> $b, -1, 1, 0)[($urpm->has_dependence($state, $a, $b) && 1) + ($urpm->has_dependence($state, $b, $a) && 2)] } - grep { (! defined $options{start} || $_ >= $options{start}) && - (! defined $options{end} || $_ <= $options{end}) } keys %{$state->{selected}}; + (keys(%selected_id) > 0 ? + (grep { exists($selected_id{$_}) } keys %{$state->{selected}}) : + keys %{$state->{selected}}); #- second step consists of re-applying resolve_requested in the same #- order computed in first step and to update a list of package to |