summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-18 15:47:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-18 15:47:43 +0000
commit48d17aecfbe7938e796fec388f5d357da761cba2 (patch)
treea50884815778c8b25039dc503e2664d8dcf8211d /urpm
parentb2acbfd301f16263d7d7b2a68042b24ff0209596 (diff)
downloadurpmi-48d17aecfbe7938e796fec388f5d357da761cba2.tar
urpmi-48d17aecfbe7938e796fec388f5d357da761cba2.tar.gz
urpmi-48d17aecfbe7938e796fec388f5d357da761cba2.tar.bz2
urpmi-48d17aecfbe7938e796fec388f5d357da761cba2.tar.xz
urpmi-48d17aecfbe7938e796fec388f5d357da761cba2.zip
- urpmi.addmedia --distrib, urpmi/urpme/urpmf/urpmq --use-distrib
o media.cfg per media field hdlist=hdlist_xxx.cz is not used anymore, xxx/media_info/hdlist.cz is used instead. To get previous behaviour, use option --use-copied-hdlist or use_copied_hdlist=1 in media.cfg beware: this modifies the behaviour of urpmi, especially for multi CDs media which were the only one really using the hdlist-copied-in-media/media_info feature
Diffstat (limited to 'urpm')
-rw-r--r--urpm/args.pm1
-rw-r--r--urpm/media.pm23
2 files changed, 15 insertions, 9 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index d6ae29f7..ecca014f 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -50,6 +50,7 @@ my %options_spec_all = (
$urpm->{debug} = $urpm->{debug_URPM} = sub { print STDERR "$_[0]\n" };
},
'urpmi-root=s' => sub { urpm::set_files($urpm, $_[1]) },
+ 'use-copied-hdlist' => sub { $urpm->{options}{use_copied_hdlist} = 1 },
);
my %options_spec = (
diff --git a/urpm/media.pm b/urpm/media.pm
index 601f1070..15614ea3 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -644,7 +644,7 @@ sub _compute_flags_for_instlist {
#- add a new medium, sync the config file accordingly.
#- returns the new medium's name. (might be different from the requested
#- name if index_name was specified)
-#- options: ignore, index_name, nolock, synthesis, update, virtual
+#- options: ignore, index_name, nolock, hdlist, synthesis, update, virtual, media_info_dir
sub add_medium {
my ($urpm, $name, $url, $with_hdlist, %options) = @_;
@@ -669,11 +669,11 @@ sub add_medium {
my $medium = { name => $name,
url => $url,
modified => !$options{ignore},
- downloader => $options{downloader},
- update => $options{update},
- ignore => $options{ignore},
- synthesis => $options{synthesis},
};
+ foreach (qw(downloader update ignore hdlist synthesis media_info_dir)) {
+ $medium->{$_} = $options{$_} if exists $options{$_};
+ }
+
if ($options{virtual}) {
file_from_file_url($url) or $urpm->{fatal}(1, N("virtual medium needs to be local"));
$medium->{virtual} = 1;
@@ -772,13 +772,18 @@ sub add_distrib_media {
my $is_update_media = $distribconf->getvalue($media, 'updates_for');
+ my $use_copied_hdlist = $urpm->{options}{use_copied_hdlist} || $distribconf->getvalue($media, 'use_copied_hdlist');
+ my $with_hdlist = $use_copied_hdlist && offset_pathname(
+ $url,
+ $distribconf->getpath($media, 'path'),
+ ) . '/' . $distribconf->getpath($media, $options{probe_with} eq 'synthesis' ? 'synthesis' : 'hdlist');
+
push @newnames, add_medium($urpm,
$name ? "$media_name ($name$medium_index)" : $media_name,
reduce_pathname($distribconf->getfullpath($media, 'path')),
- offset_pathname(
- $url,
- $distribconf->getpath($media, 'path'),
- ) . '/' . $distribconf->getpath($media, $options{probe_with} eq 'synthesis' ? 'synthesis' : 'hdlist'),
+ $with_hdlist,
+ !$use_copied_hdlist ? (media_info_dir => 'media_info') : (),
+ !$use_copied_hdlist && $options{probe_with} ? ($options{probe_with} => 1) : (),
index_name => $name ? undef : 0,
$add_by_default ? () : (ignore => 1),
%options,