* [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed
@ 2014-01-06 21:04 SebastianLuther
2014-01-06 21:04 ` [gentoo-portage-dev] [PATCH 2/2] Fix unecessary rebuild caused by equal versions in different repos SebastianLuther
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: SebastianLuther @ 2014-01-06 21:04 UTC (permalink / raw
To: gentoo-portage-dev
From: Sebastian Luther <SebastianLuther@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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-portage-dev] [PATCH 2/2] Fix unecessary rebuild caused by equal versions in different repos
2014-01-06 21:04 [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed SebastianLuther
@ 2014-01-06 21:04 ` SebastianLuther
2014-01-06 21:18 ` [gentoo-portage-dev] [PATCH] ResolverPlayground: Write layout.conf if needed SebastianLuther
2014-01-06 21:38 ` [gentoo-portage-dev] [PATCH 1/2] " Mike Frysinger
2 siblings, 0 replies; 5+ messages in thread
From: SebastianLuther @ 2014-01-06 21:04 UTC (permalink / raw
To: gentoo-portage-dev
From: Sebastian Luther <SebastianLuther@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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-portage-dev] [PATCH] ResolverPlayground: Write layout.conf if needed
2014-01-06 21:04 [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed SebastianLuther
2014-01-06 21:04 ` [gentoo-portage-dev] [PATCH 2/2] Fix unecessary rebuild caused by equal versions in different repos SebastianLuther
@ 2014-01-06 21:18 ` SebastianLuther
2014-01-06 21:38 ` [gentoo-portage-dev] [PATCH 1/2] " Mike Frysinger
2 siblings, 0 replies; 5+ messages in thread
From: SebastianLuther @ 2014-01-06 21:18 UTC (permalink / raw
To: gentoo-portage-dev
From: Sebastian Luther <SebastianLuther@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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed
2014-01-06 21:04 [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed SebastianLuther
2014-01-06 21:04 ` [gentoo-portage-dev] [PATCH 2/2] Fix unecessary rebuild caused by equal versions in different repos SebastianLuther
2014-01-06 21:18 ` [gentoo-portage-dev] [PATCH] ResolverPlayground: Write layout.conf if needed SebastianLuther
@ 2014-01-06 21:38 ` Mike Frysinger
2014-01-06 21:49 ` Sebastian Luther
2 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2014-01-06 21:38 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: SebastianLuther
[-- Attachment #1: Type: Text/Plain, Size: 274 bytes --]
On Monday 06 January 2014 16:04:16 SebastianLuther@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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed
2014-01-06 21:38 ` [gentoo-portage-dev] [PATCH 1/2] " Mike Frysinger
@ 2014-01-06 21:49 ` Sebastian Luther
0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Luther @ 2014-01-06 21:49 UTC (permalink / raw
To: gentoo-portage-dev
Am 06.01.2014 22:38, schrieb Mike Frysinger:
> On Monday 06 January 2014 16:04:16 SebastianLuther@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".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-01-06 21:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 21:04 [gentoo-portage-dev] [PATCH 1/2] ResolverPlayground: Write layout.conf if needed SebastianLuther
2014-01-06 21:04 ` [gentoo-portage-dev] [PATCH 2/2] Fix unecessary rebuild caused by equal versions in different repos SebastianLuther
2014-01-06 21:18 ` [gentoo-portage-dev] [PATCH] ResolverPlayground: Write layout.conf if needed SebastianLuther
2014-01-06 21:38 ` [gentoo-portage-dev] [PATCH 1/2] " Mike Frysinger
2014-01-06 21:49 ` Sebastian Luther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox