From 1a37761af1afca35e066f985d65335acfd14d61f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 30 Jan 2008 16:34:54 +0000 Subject: changing the way --synthesis is done in urpm::media::configure. This is used by urpmi/urpmq/urpmf. --synthesis will now be more similar to using a virtual medium (a la --use-distrib), compared to really only using the given synthesis. --- NEWS | 2 +- urpm/media.pm | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 25afada1..fed99edb 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,7 @@ o enhance pkg list formatting for "The following packages contain %s: %s" error message (#29178) - urpmf: - o fix --synthesis + o fix --synthesis (it may break urpmq/urpmi --synthesis) - urpmq: o add --no-suggests diff --git a/urpm/media.pm b/urpm/media.pm index ad66b9ed..6c8c9f9e 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -452,12 +452,19 @@ sub configure { #- synthesis take precedence over media, update options. $options{media} || $options{excludemedia} || $options{sortmedia} || $options{update} || $options{usedistrib} || $options{parallel} and $urpm->{fatal}(1, N("--synthesis cannot be used with --media, --excludemedia, --sortmedia, --update, --use-distrib or --parallel")); - $urpm->parse_synthesis($options{synthesis}); - #- synthesis disables the split of transaction (too risky and not useful). - $urpm->{options}{'split-length'} = 0; + + my $synthesis = $options{synthesis}; + if ($synthesis !~ m!^/!) { + require Cwd; + $synthesis = Cwd::getcwd() . '/' . $synthesis; + } + my ($url, $with) = $synthesis =~ m!(.*)/+(media_info/+synthesis\.hdlist\.cz)$! ? ($1, $2) : + (dirname($synthesis), basename($synthesis)); + + $urpm->{media} = []; + add_medium($urpm, 'Virtual', $url, $with, %options, virtual => 1); } - } else { - if ($options{usedistrib}) { + } elsif ($options{usedistrib}) { $urpm->{media} = []; add_distrib_media($urpm, "Virtual", $options{usedistrib}, %options, 'virtual' => 1); } else { @@ -495,7 +502,7 @@ sub configure { $urpm->{media} = [ @sorted_media, @remaining ]; } _parse_media($urpm, \%options) if !$options{nodepslist}; - } + #- determine package to withdraw (from skip.list file) only if something should be withdrawn. if (!$options{nodepslist}) { _compute_flags_for_skiplist($urpm, $options{cmdline_skiplist}) if !$options{no_skiplist}; -- cgit v1.2.1