summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-27 16:23:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-27 16:23:16 +0000
commit7e54d47105159894a617398dd2ca4faa782fe587 (patch)
tree88cd58d16b733453d8fb0c6d74ef72ce93ef8037
parent8a9cc74642b417898fef83f621973a846f0b2608 (diff)
downloadurpmi-7e54d47105159894a617398dd2ca4faa782fe587.tar
urpmi-7e54d47105159894a617398dd2ca4faa782fe587.tar.gz
urpmi-7e54d47105159894a617398dd2ca4faa782fe587.tar.bz2
urpmi-7e54d47105159894a617398dd2ca4faa782fe587.tar.xz
urpmi-7e54d47105159894a617398dd2ca4faa782fe587.zip
- urpm::media::update_media:
o ensure a second pass is done even if media has not been modified (useful for the %trigger trick done in urpmi to rebuild synthesis with suggests) without it, file provides are not computed properly
-rw-r--r--NEWS4
-rw-r--r--urpm/media.pm22
2 files changed, 17 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index 9a74e0e6..3f269b1a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- urpm::media::update_media:
+ o ensure a second pass is done even if media has not been modified
+ (useful for the %trigger trick done in urpmi to rebuild synthesis with
+ suggests)
- urpmf
o fix -a and -o
diff --git a/urpm/media.pm b/urpm/media.pm
index 265ff667..3ff146f1 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1587,12 +1587,15 @@ sub _update_medium_first_pass {
file_size(statedir_synthesis($urpm, $medium)) >= 20
or $medium->{must_build_synthesis} = 1;
+ my @unresolved_before = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
+
unless ($medium->{modified}) {
#- the medium is not modified, but to compute dependencies,
#- we still need to read it and all synthesis will be written if
#- an unresolved provides is found.
#- to speed up the process, we only read the synthesis at the beginning.
_parse_hdlist_or_synthesis__when_not_modified($urpm, $medium);
+ compute_need_second_pass($urpm, $medium, \@unresolved_before);
return 1;
}
@@ -1606,8 +1609,6 @@ sub _update_medium_first_pass {
may_reconfig_urpmi($urpm, $medium);
}
- my @unresolved_before = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
-
{
my $rc =
file_from_local_url($medium->{url})
@@ -1686,17 +1687,20 @@ sub _update_medium_first_pass {
$medium->{must_build_synthesis} = !_synthesis_or_not($medium, 's');
}
- {
- my @unresolved_after = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
- if (@unresolved_before != @unresolved_after) {
+ compute_need_second_pass($urpm, $medium, \@unresolved_before);
+ 1;
+}
+
+sub compute_need_second_pass {
+ my ($urpm, $medium, $unresolved_before) = @_;
+
+ my @unresolved_after = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
+ if (@$unresolved_before != @unresolved_after) {
$medium->{need_second_pass} = 1;
$urpm->{debug} and $urpm->{debug}(sprintf qq(medium "%s" has unresolved dependencies: %s),
$medium->{name},
- join(' ', difference2(\@unresolved_after, \@unresolved_before)));
- }
+ join(' ', difference2(\@unresolved_after, $unresolved_before)));
}
-
- 1;
}
sub _update_medium_first_pass_failed {