summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-06-10 02:11:18 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-06-10 02:11:18 +0000
commit99c59fd0f670418b96b90d44a07c6cfa4cef5d66 (patch)
treeaef5b12e205ef6a0a70cb327a739180788e654ae /urpm.pm
parent68f62051f4b03410b931b1846b1cbe3fd9e86587 (diff)
downloadurpmi-99c59fd0f670418b96b90d44a07c6cfa4cef5d66.tar
urpmi-99c59fd0f670418b96b90d44a07c6cfa4cef5d66.tar.gz
urpmi-99c59fd0f670418b96b90d44a07c6cfa4cef5d66.tar.bz2
urpmi-99c59fd0f670418b96b90d44a07c6cfa4cef5d66.tar.xz
urpmi-99c59fd0f670418b96b90d44a07c6cfa4cef5d66.zip
- make urpmi.addmedia asking media by media if they should be installed
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index 5eb26eba..a9c673c8 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -822,16 +822,29 @@ sub add_distrib_media {
#- at this point, we have found a media.cfg file, so parse it
#- and create all necessary media according to it.
my $medium = $options{initial_number} || 1;
+ my @media_list_toadd;
+
foreach my $media ($distribconf->listmedia()) {
my $skip = 0;
- # if one of value is set, we skip the media
+ # if one of value is set, we skip the media by default
foreach (qw(suppl askmedia noauto)) {
$distribconf->getvalue($media, $_) and do {
$skip = 1;
last;
};
}
+ if ($options{ask_media}) {
+ if($options{ask_media}->(
+ $distribconf->getvalue($media, 'name'),
+ !$skip,
+ )) {
+ $skip = 0;
+ } else {
+ $skip = 1;
+ }
+ }
$skip and next;
+
my $media_name = $distribconf->getvalue($media, 'name') || '';
push @newnames, $urpm->add_medium(