summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-02-24 17:51:05 +0000
committerThierry Vignaud <tv@mandriva.org>2010-02-24 17:51:05 +0000
commit50bd675340eaa74634b1d6d86162ec4d6b52dca1 (patch)
treee63e9963be616b0108d9a1d8276428d16c312a71
parent3f8bd36aabaab13339f4313999c3b085355811e2 (diff)
downloadurpmi-50bd675340eaa74634b1d6d86162ec4d6b52dca1.tar
urpmi-50bd675340eaa74634b1d6d86162ec4d6b52dca1.tar.gz
urpmi-50bd675340eaa74634b1d6d86162ec4d6b52dca1.tar.bz2
urpmi-50bd675340eaa74634b1d6d86162ec4d6b52dca1.tar.xz
urpmi-50bd675340eaa74634b1d6d86162ec4d6b52dca1.zip
(add_distrib_media) do not add non-free repository by default for Free edition (#40033)
-rw-r--r--NEWS3
-rw-r--r--urpm/media.pm11
2 files changed, 14 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8a4ae910..50b62d92 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- urpmi.addmedia:
+ o do not add non-free repository by default for Free edition (#40033)
+
Version 6.34 - 25 January 2010
- don't crash when parsing an invalid media.cfg file in
diff --git a/urpm/media.pm b/urpm/media.pm
index ecec63e4..b2cbf192 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -929,9 +929,20 @@ sub add_distrib_media {
#- and create all necessary media according to it.
my $medium_index = $options{initial_number} || 1;
+ require urpm::mirrors;
+ my $product_id = urpm::mirrors::parse_LDAP_namespace_structure(cat_('/etc/product.id'));
+
foreach my $media ($distribconf->listmedia) {
my $media_name = $distribconf->getvalue($media, 'name') || '';
+ my @media_types = split(':', $distribconf->getvalue($media, 'media_type'));
+ if ($product_id->{product} eq 'Free') {
+ if (member('non-free', @media_types)) {
+ $urpm->{log}(N("skipping non-free medium `%s'", $media));
+ next;
+ }
+ }
+
if (my $media_arch = $distribconf->getvalue($media, 'arch')) {
if (!URPM::archscore($media_arch)) {
$urpm->{log}(N("skipping non compatible media `%s' (for %s)",