[gentoo-portage-dev] Portage Feature Request: making thirdpartymirrors easier to manage

2014-01-06 Thread Robin H. Johnson
This is a small feature request, but it will require a modification to
PMS, so I describe it here.

The present thirdpartymirrors file is unwieldy, and difficult to manage
due to it's format with very long lines. It also doesn't permit easy
comments. Presently commits to it look very ugly, because diffs are
line-based, and we pack a lot into each line.

I would like to make it a directory instead of a single file, and extend
the internal syntax.

1. New location: $PROFILEDIR/thirdpartymirrors/$MIRRORNAME
1.1. The name of the mirror is now the name of the file.
1.2. We can have a file extension of .mirrors if somebody would like
 that.

2. New format (for directory-mode):
2.1. Comments permitted, shell-style.
2.2. Blank lines ignored
2.3. One URL per line, optionally prefixed with - or +
2.4. For stack repos/overlays:
2.4.1. No prefix: replace all prior mirrors from masters with new URLS in this 
file.
2.4.2. - prefix: remove this URL from the list from masters.
2.4.2. + prefix: append this URL to the list from masters.

3. New format (for file-mode):
3.1. This is for cases where thirdpartymirrors is still a file.
3.2. The first token on a line remains the name of the mirror.
3.3. Each subsequent token may be prefixed with + or -, and impacts
 prior lines/masters.

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Infrastructure Lead
E-Mail : robb...@gentoo.org
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85



[gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed

2014-01-06 Thread SebastianLuther
From: Sebastian Luther sebastianlut...@gmx.de

---
 pym/portage/tests/resolver/ResolverPlayground.py | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py 
b/pym/portage/tests/resolver/ResolverPlayground.py
index e09e265..8487b9c 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -302,6 +302,13 @@ class ResolverPlayground(object):
#Create $profile_dir/eclass (we fail to digest the 
ebuilds if it's not there)
os.makedirs(os.path.join(repo_dir, eclass))
 
+   # Set masters key in layout.conf for all repos except 
'main-repo'
+   if repo != test_repo and (not repo_config or 
layout.conf not in repo_config):
+   layout_conf_path = os.path.join(repo_dir, 
metadata, layout.conf)
+   f = open(layout_conf_path, w)
+   f.write(masters = test_repo\n)
+   f.close()
+
if repo == test_repo:
#Create a minimal profile in /usr/portage
sub_profile_dir = os.path.join(profile_dir, 
default, linux, x86, test_profile)
-- 
1.8.3.2




[gentoo-portage-dev] [PATCH 2/2] Fix unecessary rebuild caused by equal versions in different repos

2014-01-06 Thread SebastianLuther
From: Sebastian Luther sebastianlut...@gmx.de

Fixes bug 497238.
---
 pym/_emerge/depgraph.py|  2 +-
 .../tests/resolver/test_slot_conflict_rebuild.py   | 42 ++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 763f3fd..2f01a56 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1376,7 +1376,7 @@ class depgraph(object):
selective and \
dep.parent.installed and \
dep.child.installed and \
-   dep.parent.cpv == 
replacement_parent.cpv and \
+   dep.parent = 
replacement_parent and \
dep.child.cpv == pkg.cpv:
# Then can happen if the 
child's sub-slot changed
# without a revision bump. The 
sub-slot change is
diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py 
b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
index 5acdadb..714ef8e 100644
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -364,3 +364,45 @@ class SlotConflictRebuildTestCase(TestCase):
self.assertEqual(test_case.test_success, True, 
test_case.fail_msg)
finally:
playground.cleanup()
+
+
+   def testSlotConflictMultiRepo(self):
+   
+   Bug 497238
+   Different repositories contain the same cpv with different 
sub-slots for
+   a slot operator child.
+   Downgrading the slot operator parent would result in a sub-slot 
change of
+   the installed package by changing the source repository.
+   Make sure we don't perform this undesirable rebuild.
+   
+   ebuilds = {
+   net-firewall/iptables-1.4.21::overlay : { EAPI: 
5, SLOT: 0/10 },
+   sys-apps/iproute2-3.11.0::overlay : { EAPI: 5, 
RDEPEND: net-firewall/iptables:= },
+
+   net-firewall/iptables-1.4.21 : { EAPI: 5, SLOT: 
0 },
+   sys-apps/iproute2-3.12.0: { EAPI: 5, RDEPEND: 
net-firewall/iptables:= },
+   }
+
+   installed = {
+   net-firewall/iptables-1.4.21::overlay : { EAPI: 
5, SLOT: 0/10 },
+   sys-apps/iproute2-3.12.0: { EAPI: 5, RDEPEND: 
net-firewall/iptables:0/10= },
+   }
+
+   world = [sys-apps/iproute2]
+
+   test_cases = (
+   ResolverPlaygroundTestCase(
+   [@world],
+   options = {--deep: True, --update: True, 
--verbose: True},
+   success = True,
+   mergelist = []),
+   )
+
+   playground = ResolverPlayground(ebuilds=ebuilds,
+   installed=installed, world=world, debug=False)
+   try:
+   for test_case in test_cases:
+   playground.run_TestCase(test_case)
+   self.assertEqual(test_case.test_success, True, 
test_case.fail_msg)
+   finally:
+   playground.cleanup()
-- 
1.8.3.2




[gentoo-portage-dev] [PATCH] ResolverPlayground: Write layout.conf if needed

2014-01-06 Thread SebastianLuther
From: Sebastian Luther sebastianlut...@gmx.de

---
 pym/portage/tests/resolver/ResolverPlayground.py | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py 
b/pym/portage/tests/resolver/ResolverPlayground.py
index e09e265..d066428 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -302,6 +302,12 @@ class ResolverPlayground(object):
#Create $profile_dir/eclass (we fail to digest the 
ebuilds if it's not there)
os.makedirs(os.path.join(repo_dir, eclass))
 
+   # Set masters key in layout.conf for all repos except 
'main-repo'
+   if repo != test_repo and (not repo_config or 
layout.conf not in repo_config):
+   layout_conf_path = os.path.join(repo_dir, 
metadata, layout.conf)
+   with open(layout_conf_path, w) as f:
+   f.write(masters = test_repo\n)
+
if repo == test_repo:
#Create a minimal profile in /usr/portage
sub_profile_dir = os.path.join(profile_dir, 
default, linux, x86, test_profile)
-- 
1.8.3.2




Re: [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed

2014-01-06 Thread Sebastian Luther
Am 06.01.2014 22:38, schrieb Mike Frysinger:
 On Monday 06 January 2014 16:04:16 sebastianlut...@gmx.de wrote:
 +f = open(layout_conf_path, w) +   
 f.write(masters =
 test_repo\n) +  f.close()
 
 please use with in your code with open(layout_conf_path, 'w') as
 f: f.write('masters = test_repo\n') -mike
 
Arfrever pointed this out on IRC and I already send a new version of
this patch that uses with.