public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-02-13 11:35 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-02-13 11:35 UTC (permalink / raw
  To: gentoo-commits

commit:     cb23a2b4a53fb4847ca1c89492bed3fd7e408923
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 13 11:34:32 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 13 11:34:32 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cb23a2b4

ResolverDepthTestCase: add more cases

---
 pym/portage/tests/resolver/test_depth.py |   31 ++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/pym/portage/tests/resolver/test_depth.py b/pym/portage/tests/resolver/test_depth.py
index 5a30941..dc67005 100644
--- a/pym/portage/tests/resolver/test_depth.py
+++ b/pym/portage/tests/resolver/test_depth.py
@@ -24,6 +24,8 @@ class ResolverDepthTestCase(TestCase):
 			"dev-libs/C-1": {},
 			}
 
+		world = ["dev-libs/A"]
+
 		test_cases = (
 			ResolverPlaygroundTestCase(
 				["dev-libs/A"],
@@ -39,12 +41,37 @@ class ResolverDepthTestCase(TestCase):
 
 			ResolverPlaygroundTestCase(
 				["dev-libs/A"],
-				options = {"--update": True, "--deep": 3},
+				options = {"--update": True, "--deep": 2},
+				success = True,
+				mergelist = ["dev-libs/C-2", "dev-libs/B-2", "dev-libs/A-2"]),
+
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success = True,
+				mergelist = ["dev-libs/C-2", "dev-libs/B-2", "dev-libs/A-2"]),
+
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--emptytree": True},
 				success = True,
 				mergelist = ["dev-libs/C-2", "dev-libs/B-2", "dev-libs/A-2"]),
+
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--selective": True, "--deep": True},
+				success = True,
+				mergelist = []),
+
+			ResolverPlaygroundTestCase(
+				["dev-libs/A"],
+				options = {"--deep": 2},
+				success = True,
+				mergelist = ["dev-libs/A-2"]),
 			)
 
-		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
+		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed,
+			world=world)
 		try:
 			for test_case in test_cases:
 				playground.run_TestCase(test_case)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-02-13 13:01 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-02-13 13:01 UTC (permalink / raw
  To: gentoo-commits

commit:     47bd6967b23e94431e717d57588714f772a6309d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 13 13:00:28 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 13 13:00:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=47bd6967

ResolverDepthTestCase: test new-style virtuals

---
 pym/portage/tests/resolver/test_depth.py |   90 ++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_depth.py b/pym/portage/tests/resolver/test_depth.py
index dc67005..cecdd37 100644
--- a/pym/portage/tests/resolver/test_depth.py
+++ b/pym/portage/tests/resolver/test_depth.py
@@ -16,12 +16,39 @@ class ResolverDepthTestCase(TestCase):
 			"dev-libs/B-2": {"RDEPEND" : "dev-libs/C"},
 			"dev-libs/C-1": {},
 			"dev-libs/C-2": {},
+
+			"virtual/jre-1.5.0"        : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.5.0* =virtual/jdk-1.5.0* )"},
+			"virtual/jre-1.5.0-r1"     : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.5.0* =virtual/jdk-1.5.0* )"},
+			"virtual/jre-1.6.0"        : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.6.0* =virtual/jdk-1.6.0* )"},
+			"virtual/jre-1.6.0-r1"     : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.6.0* =virtual/jdk-1.6.0* )"},
+			"virtual/jdk-1.5.0"        : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jdk-1.5.0* dev-java/gcj-jdk )"},
+			"virtual/jdk-1.5.0-r1"     : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jdk-1.5.0* dev-java/gcj-jdk )"},
+			"virtual/jdk-1.6.0"        : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+			"virtual/jdk-1.6.0-r1"     : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+			"dev-java/gcj-jdk-4.5"     : {},
+			"dev-java/gcj-jdk-4.5-r1"  : {},
+			"dev-java/icedtea-6.1"     : {},
+			"dev-java/icedtea-6.1-r1"  : {},
+			"dev-java/sun-jdk-1.5"     : {"SLOT" : "1.5"},
+			"dev-java/sun-jdk-1.6"     : {"SLOT" : "1.6"},
+			"dev-java/sun-jre-bin-1.5" : {"SLOT" : "1.5"},
+			"dev-java/sun-jre-bin-1.6" : {"SLOT" : "1.6"},
+
+			"dev-java/ant-core-1.8"   : {"DEPEND"  : ">=virtual/jdk-1.4"},
+			"dev-db/hsqldb-1.8"       : {"RDEPEND" : ">=virtual/jre-1.6"},
 			}
 
 		installed = {
 			"dev-libs/A-1": {"RDEPEND" : "dev-libs/B"},
 			"dev-libs/B-1": {"RDEPEND" : "dev-libs/C"},
 			"dev-libs/C-1": {},
+
+			"virtual/jre-1.5.0"       : {"SLOT" : "1.5", "RDEPEND" : "|| ( =virtual/jdk-1.5.0* =dev-java/sun-jre-bin-1.5.0* )"},
+			"virtual/jre-1.6.0"       : {"SLOT" : "1.6", "RDEPEND" : "|| ( =virtual/jdk-1.6.0* =dev-java/sun-jre-bin-1.6.0* )"},
+			"virtual/jdk-1.5.0"       : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jdk-1.5.0* dev-java/gcj-jdk )"},
+			"virtual/jdk-1.6.0"       : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+			"dev-java/gcj-jdk-4.5"    : {},
+			"dev-java/icedtea-6.1"    : {},
 			}
 
 		world = ["dev-libs/A"]
@@ -68,6 +95,69 @@ class ResolverDepthTestCase(TestCase):
 				options = {"--deep": 2},
 				success = True,
 				mergelist = ["dev-libs/A-2"]),
+
+			ResolverPlaygroundTestCase(
+				["virtual/jre"],
+				options = {},
+				success = True,
+				mergelist = ['virtual/jre-1.6.0-r1']),
+
+			ResolverPlaygroundTestCase(
+				["virtual/jre"],
+				options = {"--deep" : True},
+				success = True,
+				mergelist = ['virtual/jre-1.6.0-r1']),
+
+			# Test bug #141118, where we avoid pulling in
+			# redundant deps, satisfying nested virtuals
+			# as efficiently as possible.
+			ResolverPlaygroundTestCase(
+				["virtual/jre"],
+				options = {"--selective" : True, "--deep" : True},
+				success = True,
+				mergelist = []),
+
+			# Test bug #150361, where depgraph._greedy_slots()
+			# is triggered by --update with AtomArg.
+			ResolverPlaygroundTestCase(
+				["virtual/jre"],
+				options = {"--update" : True},
+				success = True,
+				mergelist = ['dev-java/icedtea-6.1-r1', 'dev-java/gcj-jdk-4.5-r1', 'virtual/jdk-1.6.0-r1', 'virtual/jdk-1.5.0-r1', 'virtual/jre-1.6.0-r1', 'virtual/jre-1.5.0-r1']),
+
+			ResolverPlaygroundTestCase(
+				["virtual/jre:1.5"],
+				options = {"--update" : True},
+				success = True,
+				mergelist = ['dev-java/gcj-jdk-4.5-r1', 'virtual/jdk-1.5.0-r1', 'virtual/jre-1.5.0-r1']),
+
+			ResolverPlaygroundTestCase(
+				["virtual/jre:1.6"],
+				options = {"--update" : True},
+				success = True,
+				mergelist = ['dev-java/icedtea-6.1-r1', 'virtual/jdk-1.6.0-r1', 'virtual/jre-1.6.0-r1']),
+
+			# Test that we don't pull in any unnecessary updates
+			# when --update is not specified, even though we
+			# specified --deep.
+			ResolverPlaygroundTestCase(
+				["dev-java/ant-core"],
+				options = {"--deep" : True},
+				success = True,
+				mergelist = ["dev-java/ant-core-1.8"]),
+
+			# FIXME: pulls in unwanted updates without --deep: ['dev-java/icedtea-6.1-r1', 'virtual/jdk-1.6.0-r1', 'dev-java/ant-core-1.8']
+			#ResolverPlaygroundTestCase(
+			#	["dev-java/ant-core"],
+			#	options = {"--update" : True},
+			#	success = True,
+			#	mergelist = ["dev-java/ant-core-1.8"]),
+
+			ResolverPlaygroundTestCase(
+				["dev-db/hsqldb"],
+				options = {"--deep" : True},
+				success = True,
+				mergelist = ["dev-db/hsqldb-1.8"]),
 			)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed,



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-02-13 17:35 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-02-13 17:35 UTC (permalink / raw
  To: gentoo-commits

commit:     04da1ea51947b171f5994d0cc054769442d48cdf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 13 17:35:07 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 13 17:35:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=04da1ea5

ResolverDepthTestCase: add more cases

---
 pym/portage/tests/resolver/test_depth.py |   46 ++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_depth.py b/pym/portage/tests/resolver/test_depth.py
index 65cfac6..f070167 100644
--- a/pym/portage/tests/resolver/test_depth.py
+++ b/pym/portage/tests/resolver/test_depth.py
@@ -17,6 +17,15 @@ class ResolverDepthTestCase(TestCase):
 			"dev-libs/C-1": {},
 			"dev-libs/C-2": {},
 
+			"virtual/libusb-0"         : {"EAPI" :"2", "SLOT" : "0", "RDEPEND" : "|| ( >=dev-libs/libusb-0.1.12-r1:0 dev-libs/libusb-compat >=sys-freebsd/freebsd-lib-8.0[usb] )"},
+			"virtual/libusb-1"         : {"EAPI" :"2", "SLOT" : "1", "RDEPEND" : ">=dev-libs/libusb-1.0.4:1"},
+			"dev-libs/libusb-0.1.13"   : {},
+			"dev-libs/libusb-1.0.5"    : {"SLOT":"1"},
+			"dev-libs/libusb-compat-1" : {},
+			"sys-freebsd/freebsd-lib-8": {"IUSE" : "+usb"},
+
+			"sys-fs/udev-164"          : {"EAPI" : "1", "RDEPEND" : "virtual/libusb:0"},
+
 			"virtual/jre-1.5.0"        : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.5.0* =virtual/jdk-1.5.0* )"},
 			"virtual/jre-1.5.0-r1"     : {"SLOT" : "1.5", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.5.0* =virtual/jdk-1.5.0* )"},
 			"virtual/jre-1.6.0"        : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/sun-jre-bin-1.6.0* =virtual/jdk-1.6.0* )"},
@@ -49,6 +58,8 @@ class ResolverDepthTestCase(TestCase):
 			"virtual/jdk-1.6.0"       : {"SLOT" : "1.6", "RDEPEND" : "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
 			"dev-java/gcj-jdk-4.5"    : {},
 			"dev-java/icedtea-6.1"    : {},
+
+			"virtual/libusb-0"         : {"EAPI" :"2", "SLOT" : "0", "RDEPEND" : "|| ( >=dev-libs/libusb-0.1.12-r1:0 dev-libs/libusb-compat >=sys-freebsd/freebsd-lib-8.0[usb] )"},
 			}
 
 		world = ["dev-libs/A"]
@@ -175,6 +186,41 @@ class ResolverDepthTestCase(TestCase):
 				options = {"--deep" : True},
 				success = True,
 				mergelist = ["dev-db/hsqldb-1.8"]),
+
+			# Pull in direct dep of virtual, even with --deep=0.
+			ResolverPlaygroundTestCase(
+				["sys-fs/udev"],
+				options = {"--deep" : 0},
+				success = True,
+				mergelist = ['dev-libs/libusb-0.1.13', 'sys-fs/udev-164']),
+
+			# Test --nodeps with direct virtual deps.
+			ResolverPlaygroundTestCase(
+				["sys-fs/udev"],
+				options = {"--nodeps" : True},
+				success = True,
+				mergelist = ["sys-fs/udev-164"]),
+
+			# Test that --nodeps overrides --deep.
+			ResolverPlaygroundTestCase(
+				["sys-fs/udev"],
+				options = {"--nodeps" : True, "--deep" : True},
+				success = True,
+				mergelist = ["sys-fs/udev-164"]),
+
+			# Test that --nodeps overrides --emptytree.
+			ResolverPlaygroundTestCase(
+				["sys-fs/udev"],
+				options = {"--nodeps" : True, "--emptytree" : True},
+				success = True,
+				mergelist = ["sys-fs/udev-164"]),
+
+			# Test --emptytree with virtuals.
+			ResolverPlaygroundTestCase(
+				["sys-fs/udev"],
+				options = {"--emptytree" : True},
+				success = True,
+				mergelist = ['dev-libs/libusb-0.1.13', 'virtual/libusb-0', 'sys-fs/udev-164']),
 			)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed,



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-02-17 10:43 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-02-17 10:43 UTC (permalink / raw
  To: gentoo-commits

commit:     ad4b1c9df3eb00382b03fbc9c24f2a3a8eab58f4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 17 10:43:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 17 10:43:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ad4b1c9d

ResolverDepthTestCase: test --selective more

---
 pym/portage/tests/resolver/test_depth.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_depth.py b/pym/portage/tests/resolver/test_depth.py
index f070167..ec3e238 100644
--- a/pym/portage/tests/resolver/test_depth.py
+++ b/pym/portage/tests/resolver/test_depth.py
@@ -187,6 +187,21 @@ class ResolverDepthTestCase(TestCase):
 				success = True,
 				mergelist = ["dev-db/hsqldb-1.8"]),
 
+			# Don't traverse deps of an installed package with --deep=0,
+			# even if it's a virtual.
+			ResolverPlaygroundTestCase(
+				["virtual/libusb:0"],
+				options = {"--selective" : True, "--deep" : 0},
+				success = True,
+				mergelist = []),
+
+			# Satisfy unsatisfied dep of installed package with --deep=1.
+			ResolverPlaygroundTestCase(
+				["virtual/libusb:0"],
+				options = {"--selective" : True, "--deep" : 1},
+				success = True,
+				mergelist = ['dev-libs/libusb-0.1.13']),
+
 			# Pull in direct dep of virtual, even with --deep=0.
 			ResolverPlaygroundTestCase(
 				["sys-fs/udev"],



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-04 17:36 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-04 17:36 UTC (permalink / raw
  To: gentoo-commits

commit:     9b697efa947ef88effc15ee86f766af68ec6097a
Author:     David James <davidjames <AT> chromium <DOT> org>
AuthorDate: Wed May  4 17:35:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  4 17:35:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9b697efa

test_rebuild: test --rebuild-if-new-rev more

---
 pym/portage/tests/resolver/test_rebuild.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_rebuild.py b/pym/portage/tests/resolver/test_rebuild.py
index 1f4b6ae..b9c4d6d 100644
--- a/pym/portage/tests/resolver/test_rebuild.py
+++ b/pym/portage/tests/resolver/test_rebuild.py
@@ -110,6 +110,21 @@ class RebuildTestCase(TestCase):
 						'sys-apps/b-2', 'sys-apps/e-2', 'sys-apps/g-2'],
 					ignore_mergelist_order = True,
 					success = True),
+
+				ResolverPlaygroundTestCase(
+					["=sys-libs/x-1"],
+					options = {"--rebuild-if-new-rev" : True},
+					mergelist = ['sys-libs/x-1'],
+					ignore_mergelist_order = True,
+					success = True),
+
+				ResolverPlaygroundTestCase(
+					["=sys-libs/x-1"],
+					options = {"--rebuild-if-unbuilt" : True},
+					mergelist = ['sys-libs/x-1', 'sys-apps/a-2',
+						'sys-apps/b-2', 'sys-apps/e-2', 'sys-apps/g-2'],
+					ignore_mergelist_order = True,
+					success = True),
 			)
 
 		playground = ResolverPlayground(ebuilds=ebuilds,



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-17 20:34 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-17 20:34 UTC (permalink / raw
  To: gentoo-commits

commit:     82da4172fbd61106e3c960cb67aae7b02e27c13a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 20:33:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 17 20:33:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=82da4172

test_autounmask: test missing keyword

---
 pym/portage/tests/resolver/test_autounmask.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_autounmask.py b/pym/portage/tests/resolver/test_autounmask.py
index 6ffdaaf..54c435f 100644
--- a/pym/portage/tests/resolver/test_autounmask.py
+++ b/pym/portage/tests/resolver/test_autounmask.py
@@ -232,12 +232,20 @@ class AutounmaskTestCase(TestCase):
 					mergelist = ["app-text/C-1"],
 					unstable_keywords = ["app-text/C-1"],
 					needed_p_mask_changes = ["app-text/C-1"]),
+				#Make sure unstable keyword is preferred over missing keyword
 				ResolverPlaygroundTestCase(
 					["app-text/D"],
 					options = {"--autounmask": True},
 					success = False,
 					mergelist = ["app-text/D-1"],
-					unstable_keywords = ["app-text/D-1"])
+					unstable_keywords = ["app-text/D-1"]),
+				#Test missing keyword
+				ResolverPlaygroundTestCase(
+					["=app-text/D-2"],
+					options = {"--autounmask": True},
+					success = False,
+					mergelist = ["app-text/D-2"],
+					unstable_keywords = ["app-text/D-2"])
 			)
 
 		profile = {



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  0:51 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  0:51 UTC (permalink / raw
  To: gentoo-commits

commit:     286326e79fcc3b7246863f12c4d7376c9e06a673
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 00:51:09 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 00:51:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=286326e7

ResolverPlayground: support ambigous_merge_order

---
 pym/portage/tests/resolver/ResolverPlayground.py |   49 ++++++++++++++++++++-
 pym/portage/tests/resolver/test_merge_order.py   |   45 ++++++++++++++++++++
 2 files changed, 91 insertions(+), 3 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 2020cf3..5d1c1b3 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -3,6 +3,7 @@
 
 from itertools import permutations
 import shutil
+import sys
 import tempfile
 import portage
 from portage import os
@@ -24,6 +25,9 @@ from _emerge.create_depgraph_params import create_depgraph_params
 from _emerge.depgraph import backtrack_depgraph
 from _emerge.RootConfig import RootConfig
 
+if sys.hexversion >= 0x3000000:
+	basestring = str
+
 class ResolverPlayground(object):
 	"""
 	This class helps to create the necessary files on disk and
@@ -470,6 +474,7 @@ class ResolverPlaygroundTestCase(object):
 	def __init__(self, request, **kwargs):
 		self.all_permutations = kwargs.pop("all_permutations", False)
 		self.ignore_mergelist_order = kwargs.pop("ignore_mergelist_order", False)
+		self.ambigous_merge_order = kwargs.pop("ambigous_merge_order", False)
 		self.check_repo_names = kwargs.pop("check_repo_names", False)
 
 		if self.all_permutations:
@@ -509,13 +514,51 @@ class ResolverPlaygroundTestCase(object):
 						got = new_got
 					if expected:
 						new_expected = []
-						for cpv in expected:
-							a = Atom("="+cpv, allow_repo=True)
-							new_expected.append(a.cpv)
+						for obj in expected:
+							if isinstance(obj, basestring):
+								a = Atom("="+obj, allow_repo=True)
+								new_expected.append(a.cpv)
+								continue
+							new_expected.append(set())
+							for cpv in obj:
+								a = Atom("="+cpv, allow_repo=True)
+								new_expected[-1].add(a.cpv)
 						expected = new_expected
 				if self.ignore_mergelist_order and got is not None:
 					got = set(got)
 					expected = set(expected)
+
+				if self.ambigous_merge_order and got:
+					expected_stack = list(reversed(expected))
+					got_stack = list(reversed(got))
+					new_expected = []
+					while got_stack and expected_stack:
+						got_token = got_stack.pop()
+						expected_obj = expected_stack.pop()
+						if isinstance(expected_obj, basestring):
+							new_expected.append(got_token)
+							continue
+						expected_obj = set(expected_obj)
+						try:
+							expected_obj.remove(got_token)
+						except KeyError:
+							# result doesn't match, so stop early
+							break
+						new_expected.append(got_token)
+						match = True
+						while got_stack and expected_obj:
+							got_token = got_stack.pop()
+							try:
+								expected_obj.remove(got_token)
+							except KeyError:
+								match = False
+								break
+							new_expected.append(got_token)
+						if not match:
+							# result doesn't match, so stop early
+							break
+					expected = new_expected
+
 			elif key in ("unstable_keywords", "needed_p_mask_changes") and expected is not None:
 				expected = set(expected)
 

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
new file mode 100644
index 0000000..ada9e73
--- /dev/null
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -0,0 +1,45 @@
+# Copyright 2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class MergeOrderTestCase(TestCase):
+
+	def testMergeOrder(self):
+		ebuilds = {
+			"app-misc/circ-runtime-a-1": {
+				"RDEPEND": "app-misc/circ-runtime-b",
+			},
+			"app-misc/circ-runtime-b-1": {
+				"RDEPEND": "app-misc/circ-runtime-a",
+			},
+			"app-misc/some-app-a-1": {
+				"RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
+			},
+		}
+
+		installed = {
+		}
+
+		test_cases = (
+			ResolverPlaygroundTestCase(
+				["app-misc/some-app-a"],
+				success = True,
+				ambigous_merge_order = True,
+				mergelist = [("app-misc/circ-runtime-a-1", "app-misc/circ-runtime-b-1"), "app-misc/some-app-a-1"]),
+			ResolverPlaygroundTestCase(
+				["app-misc/some-app-a"],
+				success = True,
+				ambigous_merge_order = True,
+				mergelist = [("app-misc/circ-runtime-b-1", "app-misc/circ-runtime-a-1"), "app-misc/some-app-a-1"]),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
+		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()



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  1:01 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  1:01 UTC (permalink / raw
  To: gentoo-commits

commit:     50a1fcfffbc27df8dfec733a351fbbdee6d8db11
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 01:00:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 01:00:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=50a1fcff

test_merge_order: test circular RDEPEND + PDEPEND

---
 pym/portage/tests/resolver/test_merge_order.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index ada9e73..9c5d1fe 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -9,6 +9,12 @@ class MergeOrderTestCase(TestCase):
 
 	def testMergeOrder(self):
 		ebuilds = {
+			"app-misc/circ-post-runtime-a-1": {
+				"PDEPEND": "app-misc/circ-post-runtime-b",
+			},
+			"app-misc/circ-post-runtime-b-1": {
+				"RDEPEND": "app-misc/circ-post-runtime-a",
+			},
 			"app-misc/circ-runtime-a-1": {
 				"RDEPEND": "app-misc/circ-runtime-b",
 			},
@@ -18,6 +24,9 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/some-app-a-1": {
 				"RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
 			},
+			"app-misc/some-app-b-1": {
+				"RDEPEND": "app-misc/circ-post-runtime-a app-misc/circ-post-runtime-b",
+			},
 		}
 
 		installed = {
@@ -34,6 +43,13 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				ambigous_merge_order = True,
 				mergelist = [("app-misc/circ-runtime-b-1", "app-misc/circ-runtime-a-1"), "app-misc/some-app-a-1"]),
+			# Test optimal merge order for a circular dep that is
+			# RDEPEND in one direction and PDEPEND in the other.
+			ResolverPlaygroundTestCase(
+				["app-misc/some-app-a"],
+				success = True,
+				ambigous_merge_order = True,
+				mergelist = ["app-misc/circ-post-runtime-a-1", "app-misc/circ-post-runtime-b-1", "app-misc/some-app-b-1"]),
 		)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  1:13 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  1:13 UTC (permalink / raw
  To: gentoo-commits

commit:     a3d40cef65ee8b0cef21e19c7e235ec5e36a58ea
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 01:11:56 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 01:11:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3d40cef

test_merge_order: fix ambigous_merge_order bug

---
 pym/portage/tests/resolver/ResolverPlayground.py |    7 +++++--
 pym/portage/tests/resolver/test_merge_order.py   |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 5d1c1b3..298107c 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -536,8 +536,11 @@ class ResolverPlaygroundTestCase(object):
 						got_token = got_stack.pop()
 						expected_obj = expected_stack.pop()
 						if isinstance(expected_obj, basestring):
-							new_expected.append(got_token)
-							continue
+							new_expected.append(expected_obj)
+							if got_token == expected_obj:
+								continue
+							# result doesn't match, so stop early
+							break
 						expected_obj = set(expected_obj)
 						try:
 							expected_obj.remove(got_token)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 9c5d1fe..f51d14f 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -46,7 +46,7 @@ class MergeOrderTestCase(TestCase):
 			# Test optimal merge order for a circular dep that is
 			# RDEPEND in one direction and PDEPEND in the other.
 			ResolverPlaygroundTestCase(
-				["app-misc/some-app-a"],
+				["app-misc/some-app-b"],
 				success = True,
 				ambigous_merge_order = True,
 				mergelist = ["app-misc/circ-post-runtime-a-1", "app-misc/circ-post-runtime-b-1", "app-misc/some-app-b-1"]),



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  1:17 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  1:17 UTC (permalink / raw
  To: gentoo-commits

commit:     e2c6a1f0438701bbcbd49f69bf4549cbfed3c0cd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 01:16:46 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 01:16:46 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e2c6a1f0

test_merge_order: remove uneeded ambigous flag

---
 pym/portage/tests/resolver/test_merge_order.py |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index f51d14f..a59a678 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -48,7 +48,6 @@ class MergeOrderTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				["app-misc/some-app-b"],
 				success = True,
-				ambigous_merge_order = True,
 				mergelist = ["app-misc/circ-post-runtime-a-1", "app-misc/circ-post-runtime-b-1", "app-misc/some-app-b-1"]),
 		)
 



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  3:30 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  3:30 UTC (permalink / raw
  To: gentoo-commits

commit:     cf3d92869b4e7371aed6171d1bf77fc2150bf016
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 03:30:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 03:30:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cf3d9286

test_merge_order: test blocker resolution

---
 pym/portage/tests/resolver/ResolverPlayground.py |    6 +++++
 pym/portage/tests/resolver/test_merge_order.py   |   23 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 298107c..4f42b67 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -509,6 +509,9 @@ class ResolverPlaygroundTestCase(object):
 					if got:
 						new_got = []
 						for cpv in got:
+							if cpv[:1] == "!":
+								new_got.append(cpv)
+								continue
 							a = Atom("="+cpv, allow_repo=True)
 							new_got.append(a.cpv)
 						got = new_got
@@ -516,6 +519,9 @@ class ResolverPlaygroundTestCase(object):
 						new_expected = []
 						for obj in expected:
 							if isinstance(obj, basestring):
+								if obj[:1] == "!":
+									new_expected.append(obj)
+									continue
 								a = Atom("="+obj, allow_repo=True)
 								new_expected.append(a.cpv)
 								continue

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index a59a678..6c929f7 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -9,6 +9,8 @@ class MergeOrderTestCase(TestCase):
 
 	def testMergeOrder(self):
 		ebuilds = {
+			"app-misc/blocker-buildtime-a-1" : {},
+			"app-misc/blocker-runtime-a-1" : {},
 			"app-misc/circ-post-runtime-a-1": {
 				"PDEPEND": "app-misc/circ-post-runtime-b",
 			},
@@ -21,6 +23,10 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/circ-runtime-b-1": {
 				"RDEPEND": "app-misc/circ-runtime-a",
 			},
+			"app-misc/installed-blocker-a-1" : {
+				"DEPEND" : "!app-misc/blocker-buildtime-a",
+				"RDEPEND" : "!app-misc/blocker-runtime-a",
+			},
 			"app-misc/some-app-a-1": {
 				"RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
 			},
@@ -30,6 +36,10 @@ class MergeOrderTestCase(TestCase):
 		}
 
 		installed = {
+			"app-misc/installed-blocker-a-1" : {
+				"DEPEND" : "!app-misc/blocker-buildtime-a",
+				"RDEPEND" : "!app-misc/blocker-runtime-a",
+			}
 		}
 
 		test_cases = (
@@ -49,6 +59,19 @@ class MergeOrderTestCase(TestCase):
 				["app-misc/some-app-b"],
 				success = True,
 				mergelist = ["app-misc/circ-post-runtime-a-1", "app-misc/circ-post-runtime-b-1", "app-misc/some-app-b-1"]),
+			# installed package has buildtime-only blocker
+			# that should be ignored
+			ResolverPlaygroundTestCase(
+				["app-misc/blocker-buildtime-a"],
+				success = True,
+				mergelist = ["app-misc/blocker-buildtime-a-1"]),
+			# installed package has runtime blocker that
+			# should cause it to be uninstalled
+			# TODO: distinguish between install/uninstall tasks in mergelist
+			ResolverPlaygroundTestCase(
+				["app-misc/blocker-runtime-a"],
+				success = True,
+				mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]),
 		)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  4:02 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  4:02 UTC (permalink / raw
  To: gentoo-commits

commit:     3f32a07536575e7dab97d4ab3e3233b09b3c2cdc
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 04:01:31 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 04:01:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3f32a075

test_merge_order: test hard buildtime blockers

---
 pym/portage/tests/resolver/test_merge_order.py |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index e7f1aa4..45890af 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -10,6 +10,13 @@ class MergeOrderTestCase(TestCase):
 	def testMergeOrder(self):
 		ebuilds = {
 			"app-misc/blocker-buildtime-a-1" : {},
+			"app-misc/blocker-buildtime-unbuilt-a-1" : {
+				"DEPEND" : "!app-misc/installed-blocker-a",
+			},
+			"app-misc/blocker-buildtime-unbuilt-hard-a-1" : {
+				"EAPI"   : "2",
+				"DEPEND" : "!!app-misc/installed-blocker-a",
+			},
 			"app-misc/blocker-runtime-a-1" : {},
 			"app-misc/blocker-runtime-hard-a-1" : {},
 			"app-misc/circ-post-runtime-a-1": {
@@ -75,6 +82,20 @@ class MergeOrderTestCase(TestCase):
 				["app-misc/blocker-runtime-a"],
 				success = True,
 				mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]),
+			# We have a soft buildtime blocker against an installed
+			# package that should cause it to be uninstalled.
+			# TODO: distinguish between install/uninstall tasks in mergelist
+			ResolverPlaygroundTestCase(
+				["app-misc/blocker-buildtime-unbuilt-a"],
+				success = True,
+				mergelist = ["app-misc/blocker-buildtime-unbuilt-a-1", "app-misc/installed-blocker-a-1", "!app-misc/installed-blocker-a"]),
+			# We have a hard buildtime blocker against an installed
+			# package that will not resolve automatically (unless
+			# the option requested in bug 250286 is implemented).
+			ResolverPlaygroundTestCase(
+				["app-misc/blocker-buildtime-unbuilt-hard-a"],
+				success = False,
+				mergelist = ['app-misc/blocker-buildtime-unbuilt-hard-a-1', '!!app-misc/installed-blocker-a']),
 			# An installed package has a hard runtime blocker that
 			# will not resolve automatically (unless the option
 			# requested in bug 250286 is implemented).



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  4:15 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  4:15 UTC (permalink / raw
  To: gentoo-commits

commit:     8f636333825fa8f134f1a1d84f7e054bbde571ee
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 04:14:49 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 04:14:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8f636333

ambigous_merge_order: handle more failure modes

---
 pym/portage/tests/resolver/ResolverPlayground.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 4f42b67..2fc37dc 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -566,6 +566,14 @@ class ResolverPlaygroundTestCase(object):
 						if not match:
 							# result doesn't match, so stop early
 							break
+						if expected_obj:
+							# result does not match, so stop early
+							new_expected.append(tuple(expected_obj))
+							break
+					if expected_stack:
+						# result does not match, add leftovers to new_expected
+						expected_stack.reverse()
+						new_expected.extend(expected_stack)
 					expected = new_expected
 
 			elif key in ("unstable_keywords", "needed_p_mask_changes") and expected is not None:



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  8:47 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  8:47 UTC (permalink / raw
  To: gentoo-commits

commit:     7d43393760af0bce280214c1350c06dd4c586f69
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 08:47:13 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 08:47:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d433937

test_merge_order: make cycles indirect

---
 pym/portage/tests/resolver/test_merge_order.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 45890af..5ec569a 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -23,12 +23,18 @@ class MergeOrderTestCase(TestCase):
 				"PDEPEND": "app-misc/circ-post-runtime-b",
 			},
 			"app-misc/circ-post-runtime-b-1": {
+				"RDEPEND": "app-misc/circ-post-runtime-c",
+			},
+			"app-misc/circ-post-runtime-c-1": {
 				"RDEPEND": "app-misc/circ-post-runtime-a",
 			},
 			"app-misc/circ-runtime-a-1": {
 				"RDEPEND": "app-misc/circ-runtime-b",
 			},
 			"app-misc/circ-runtime-b-1": {
+				"RDEPEND": "app-misc/circ-runtime-c",
+			},
+			"app-misc/circ-runtime-c-1": {
 				"RDEPEND": "app-misc/circ-runtime-a",
 			},
 			"app-misc/installed-blocker-a-1" : {
@@ -57,18 +63,19 @@ class MergeOrderTestCase(TestCase):
 				["app-misc/some-app-a"],
 				success = True,
 				ambigous_merge_order = True,
-				mergelist = [("app-misc/circ-runtime-a-1", "app-misc/circ-runtime-b-1"), "app-misc/some-app-a-1"]),
+				mergelist = [("app-misc/circ-runtime-a-1", "app-misc/circ-runtime-b-1", "app-misc/circ-runtime-c-1"), "app-misc/some-app-a-1"]),
 			ResolverPlaygroundTestCase(
 				["app-misc/some-app-a"],
 				success = True,
 				ambigous_merge_order = True,
-				mergelist = [("app-misc/circ-runtime-b-1", "app-misc/circ-runtime-a-1"), "app-misc/some-app-a-1"]),
+				mergelist = [("app-misc/circ-runtime-c-1", "app-misc/circ-runtime-b-1", "app-misc/circ-runtime-a-1"), "app-misc/some-app-a-1"]),
 			# Test optimal merge order for a circular dep that is
 			# RDEPEND in one direction and PDEPEND in the other.
 			ResolverPlaygroundTestCase(
 				["app-misc/some-app-b"],
 				success = True,
-				mergelist = ["app-misc/circ-post-runtime-a-1", "app-misc/circ-post-runtime-b-1", "app-misc/some-app-b-1"]),
+				ambigous_merge_order = True,
+				mergelist = ["app-misc/circ-post-runtime-a-1", ("app-misc/circ-post-runtime-b-1", "app-misc/circ-post-runtime-c-1"), "app-misc/some-app-b-1"]),
 			# installed package has buildtime-only blocker
 			# that should be ignored
 			ResolverPlaygroundTestCase(



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  9:11 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  9:11 UTC (permalink / raw
  To: gentoo-commits

commit:     8e09dda2ad6afe35bce7d374044a37fd91fafe6e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 09:10:57 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 09:10:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8e09dda2

test_merge_order: test circular RDEPEND + DEPEND

---
 pym/portage/tests/resolver/test_merge_order.py |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 5ec569a..df0c3f1 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -19,6 +19,16 @@ class MergeOrderTestCase(TestCase):
 			},
 			"app-misc/blocker-runtime-a-1" : {},
 			"app-misc/blocker-runtime-hard-a-1" : {},
+			"app-misc/circ-buildtime-a-0": {},
+			"app-misc/circ-buildtime-a-1": {
+				"RDEPEND": "app-misc/circ-buildtime-b",
+			},
+			"app-misc/circ-buildtime-b-1": {
+				"RDEPEND": "app-misc/circ-buildtime-c",
+			},
+			"app-misc/circ-buildtime-c-1": {
+				"DEPEND": "app-misc/circ-buildtime-a",
+			},
 			"app-misc/circ-post-runtime-a-1": {
 				"PDEPEND": "app-misc/circ-post-runtime-b",
 			},
@@ -48,9 +58,13 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/some-app-b-1": {
 				"RDEPEND": "app-misc/circ-post-runtime-a app-misc/circ-post-runtime-b",
 			},
+			"app-misc/some-app-c-1": {
+				"RDEPEND": "app-misc/circ-buildtime-a app-misc/circ-buildtime-b",
+			},
 		}
 
 		installed = {
+			"app-misc/circ-buildtime-a-0": {},
 			"app-misc/installed-blocker-a-1" : {
 				"EAPI"   : "2",
 				"DEPEND" : "!app-misc/blocker-buildtime-a",
@@ -70,6 +84,15 @@ class MergeOrderTestCase(TestCase):
 				ambigous_merge_order = True,
 				mergelist = [("app-misc/circ-runtime-c-1", "app-misc/circ-runtime-b-1", "app-misc/circ-runtime-a-1"), "app-misc/some-app-a-1"]),
 			# Test optimal merge order for a circular dep that is
+			# RDEPEND in one direction and DEPEND in the other.
+			# This requires an installed instance of the DEPEND
+			# package in order to be solvable.
+			ResolverPlaygroundTestCase(
+				["app-misc/some-app-c", "app-misc/circ-buildtime-a"],
+				success = True,
+				ambigous_merge_order = True,
+				mergelist = [("app-misc/circ-buildtime-b-1", "app-misc/circ-buildtime-c-1"), "app-misc/circ-buildtime-a-1", "app-misc/some-app-c-1"]),
+			# Test optimal merge order for a circular dep that is
 			# RDEPEND in one direction and PDEPEND in the other.
 			ResolverPlaygroundTestCase(
 				["app-misc/some-app-b"],



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21  9:21 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21  9:21 UTC (permalink / raw
  To: gentoo-commits

commit:     fc3997483120e4003991dabd5d1e58b339579adb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 09:20:55 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 09:20:55 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fc399748

test_merge_order: test unsolvable buildtime cycle

---
 pym/portage/tests/resolver/test_merge_order.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index df0c3f1..be41f82 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -29,6 +29,15 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/circ-buildtime-c-1": {
 				"DEPEND": "app-misc/circ-buildtime-a",
 			},
+			"app-misc/circ-buildtime-unsolvable-a-1": {
+				"RDEPEND": "app-misc/circ-buildtime-unsolvable-b",
+			},
+			"app-misc/circ-buildtime-unsolvable-b-1": {
+				"RDEPEND": "app-misc/circ-buildtime-unsolvable-c",
+			},
+			"app-misc/circ-buildtime-unsolvable-c-1": {
+				"DEPEND": "app-misc/circ-buildtime-unsolvable-a",
+			},
 			"app-misc/circ-post-runtime-a-1": {
 				"PDEPEND": "app-misc/circ-post-runtime-b",
 			},
@@ -83,6 +92,12 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				ambigous_merge_order = True,
 				mergelist = [("app-misc/circ-runtime-c-1", "app-misc/circ-runtime-b-1", "app-misc/circ-runtime-a-1"), "app-misc/some-app-a-1"]),
+			# Test unsolvable circular dep that is RDEPEND in one
+			# direction and DEPEND in the other.
+			ResolverPlaygroundTestCase(
+				["app-misc/circ-buildtime-unsolvable-a"],
+				success = False,
+				circular_dependency_solutions = {}),
 			# Test optimal merge order for a circular dep that is
 			# RDEPEND in one direction and DEPEND in the other.
 			# This requires an installed instance of the DEPEND



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21 10:30 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21 10:30 UTC (permalink / raw
  To: gentoo-commits

commit:     ffd08be66d09bf98b25957ac8b99d414f4549d17
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 10:30:05 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 10:30:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ffd08be6

test_merge_order: test satisfied circular DEPEND

---
 pym/portage/tests/resolver/ResolverPlayground.py |   13 ++++++-
 pym/portage/tests/resolver/test_merge_order.py   |   43 ++++++++++++++++++++++
 2 files changed, 55 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 2fc37dc..dd3a944 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -476,6 +476,7 @@ class ResolverPlaygroundTestCase(object):
 		self.ignore_mergelist_order = kwargs.pop("ignore_mergelist_order", False)
 		self.ambigous_merge_order = kwargs.pop("ambigous_merge_order", False)
 		self.check_repo_names = kwargs.pop("check_repo_names", False)
+		self.merge_order_assertions = kwargs.pop("merge_order_assertions", False)
 
 		if self.all_permutations:
 			self.requests = list(permutations(request))
@@ -538,6 +539,7 @@ class ResolverPlaygroundTestCase(object):
 					expected_stack = list(reversed(expected))
 					got_stack = list(reversed(got))
 					new_expected = []
+					match = True
 					while got_stack and expected_stack:
 						got_token = got_stack.pop()
 						expected_obj = expected_stack.pop()
@@ -554,7 +556,6 @@ class ResolverPlaygroundTestCase(object):
 							# result doesn't match, so stop early
 							break
 						new_expected.append(got_token)
-						match = True
 						while got_stack and expected_obj:
 							got_token = got_stack.pop()
 							try:
@@ -568,14 +569,24 @@ class ResolverPlaygroundTestCase(object):
 							break
 						if expected_obj:
 							# result does not match, so stop early
+							match = False
 							new_expected.append(tuple(expected_obj))
 							break
 					if expected_stack:
 						# result does not match, add leftovers to new_expected
+						match = False
 						expected_stack.reverse()
 						new_expected.extend(expected_stack)
 					expected = new_expected
 
+					if match and self.merge_order_assertions:
+						for node1, node2 in self.merge_order_assertions:
+							if not (got.index(node1) < got.index(node2)):
+								fail_msgs.append("atoms: (" + \
+									", ".join(result.atoms) + "), key: " + \
+									("merge_order_assertions, expected: %s" % \
+									(node1, node2)) + ", got: " + str(got))
+
 			elif key in ("unstable_keywords", "needed_p_mask_changes") and expected is not None:
 				expected = set(expected)
 

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index be41f82..62d16d9 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -56,6 +56,26 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/circ-runtime-c-1": {
 				"RDEPEND": "app-misc/circ-runtime-a",
 			},
+			"app-misc/circ-satisfied-a-0": {
+				"RDEPEND": "app-misc/circ-satisfied-b",
+			},
+			"app-misc/circ-satisfied-a-1": {
+				"RDEPEND": "app-misc/circ-satisfied-b",
+			},
+			"app-misc/circ-satisfied-b-0": {
+				"RDEPEND": "app-misc/circ-satisfied-c",
+			},
+			"app-misc/circ-satisfied-b-1": {
+				"RDEPEND": "app-misc/circ-satisfied-c",
+			},
+			"app-misc/circ-satisfied-c-0": {
+				"DEPEND": "app-misc/circ-satisfied-a",
+				"RDEPEND": "app-misc/circ-satisfied-a",
+			},
+			"app-misc/circ-satisfied-c-1": {
+				"DEPEND": "app-misc/circ-satisfied-a",
+				"RDEPEND": "app-misc/circ-satisfied-a",
+			},
 			"app-misc/installed-blocker-a-1" : {
 				"EAPI"   : "2",
 				"DEPEND" : "!app-misc/blocker-buildtime-a",
@@ -74,6 +94,16 @@ class MergeOrderTestCase(TestCase):
 
 		installed = {
 			"app-misc/circ-buildtime-a-0": {},
+			"app-misc/circ-satisfied-a-0": {
+				"RDEPEND": "app-misc/circ-satisfied-b",
+			},
+			"app-misc/circ-satisfied-b-0": {
+				"RDEPEND": "app-misc/circ-satisfied-c",
+			},
+			"app-misc/circ-satisfied-c-0": {
+				"DEPEND": "app-misc/circ-satisfied-a",
+				"RDEPEND": "app-misc/circ-satisfied-a",
+			},
 			"app-misc/installed-blocker-a-1" : {
 				"EAPI"   : "2",
 				"DEPEND" : "!app-misc/blocker-buildtime-a",
@@ -114,6 +144,19 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				ambigous_merge_order = True,
 				mergelist = ["app-misc/circ-post-runtime-a-1", ("app-misc/circ-post-runtime-b-1", "app-misc/circ-post-runtime-c-1"), "app-misc/some-app-b-1"]),
+			# Test optimal merge order for a circular dep that is
+			# RDEPEND in one direction and DEPEND in the other,
+			# with all dependencies initially satisfied. Optimally,
+			# the DEPEND/buildtime dep should be updated before the
+			# package that depends on it, even though it's feasible
+			# to update it later since it is already satisfied.
+			ResolverPlaygroundTestCase(
+				["app-misc/circ-satisfied-a", "app-misc/circ-satisfied-b", "app-misc/circ-satisfied-c"],
+				success = True,
+				all_permutations = True,
+				ambigous_merge_order = True,
+				merge_order_assertions = (("app-misc/circ-satisfied-a-1", "app-misc/circ-satisfied-c-1"),),
+				mergelist = [("app-misc/circ-satisfied-a-1", "app-misc/circ-satisfied-b-1", "app-misc/circ-satisfied-c-1")]),
 			# installed package has buildtime-only blocker
 			# that should be ignored
 			ResolverPlaygroundTestCase(



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21 10:34 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21 10:34 UTC (permalink / raw
  To: gentoo-commits

commit:     080bc3b13611e126a41fa2c30545c2ec21e94998
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 10:34:30 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 10:34:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=080bc3b1

merge_order_assertions: fix string format error

---
 pym/portage/tests/resolver/ResolverPlayground.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index dd3a944..8e7f600 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -585,7 +585,8 @@ class ResolverPlaygroundTestCase(object):
 								fail_msgs.append("atoms: (" + \
 									", ".join(result.atoms) + "), key: " + \
 									("merge_order_assertions, expected: %s" % \
-									(node1, node2)) + ", got: " + str(got))
+									str((node1, node2))) + \
+									", got: " + str(got))
 
 			elif key in ("unstable_keywords", "needed_p_mask_changes") and expected is not None:
 				expected = set(expected)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21 22:17 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21 22:17 UTC (permalink / raw
  To: gentoo-commits

commit:     db3521bdd5c57a20a8f3bf04a84fcd65430e39c9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 22:15:42 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 22:15:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=db3521bd

test_merge_order: test solve blocker no-overlap

---
 pym/portage/tests/resolver/test_merge_order.py |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 62d16d9..bae9bca 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -17,6 +17,9 @@ class MergeOrderTestCase(TestCase):
 				"EAPI"   : "2",
 				"DEPEND" : "!!app-misc/installed-blocker-a",
 			},
+			"app-misc/blocker-update-order-a-1" : {
+				"RDEPEND" : ">=app-misc/installed-old-version-blocks-a-2"
+			},
 			"app-misc/blocker-runtime-a-1" : {},
 			"app-misc/blocker-runtime-hard-a-1" : {},
 			"app-misc/circ-buildtime-a-0": {},
@@ -81,6 +84,10 @@ class MergeOrderTestCase(TestCase):
 				"DEPEND" : "!app-misc/blocker-buildtime-a",
 				"RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
 			},
+			"app-misc/installed-old-version-blocks-a-1" : {
+				"RDEPEND" : "!app-misc/installed-old-version-blocks-a",
+			},
+			"app-misc/installed-old-version-blocks-a-2" : {},
 			"app-misc/some-app-a-1": {
 				"RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
 			},
@@ -109,6 +116,9 @@ class MergeOrderTestCase(TestCase):
 				"DEPEND" : "!app-misc/blocker-buildtime-a",
 				"RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
 			},
+			"app-misc/installed-old-version-blocks-a-1" : {
+				"RDEPEND" : "!app-misc/installed-old-version-blocks-a",
+			},
 		}
 
 		test_cases = (
@@ -163,6 +173,15 @@ class MergeOrderTestCase(TestCase):
 				["app-misc/blocker-buildtime-a"],
 				success = True,
 				mergelist = ["app-misc/blocker-buildtime-a-1"]),
+			# We're installing a package that an old version of
+			# an installed package blocks. However, an update is
+			# available to the old package. The old package should
+			# be updated first, in order to solve the blocker without
+			# any need for blocking packages to temporarily overlap.
+			ResolverPlaygroundTestCase(
+				["app-misc/blocker-update-order-a"],
+				success = True,
+				mergelist = ["app-misc/installed-old-version-blocks-a-2", "app-misc/blocker-update-order-a-1"]),
 			# installed package has runtime blocker that
 			# should cause it to be uninstalled
 			# TODO: distinguish between install/uninstall tasks in mergelist
@@ -171,7 +190,10 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]),
 			# We have a soft buildtime blocker against an installed
-			# package that should cause it to be uninstalled.
+			# package that should cause it to be uninstalled. Note that with
+			# soft blockers, the blocking packages are allowed to temporarily
+			# overlap. This allows any essential programs/libraries provided
+			# by both packages to be available at all times.
 			# TODO: distinguish between install/uninstall tasks in mergelist
 			ResolverPlaygroundTestCase(
 				["app-misc/blocker-buildtime-unbuilt-a"],



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-21 22:37 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-21 22:37 UTC (permalink / raw
  To: gentoo-commits

commit:     5933561be0ed3a6d46ba9608edff79bbeb8cd7f1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 22:36:41 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 21 22:36:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5933561b

test_merge_order: fix bugs in previous commit

---
 pym/portage/tests/resolver/test_merge_order.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index bae9bca..548f203 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -17,9 +17,7 @@ class MergeOrderTestCase(TestCase):
 				"EAPI"   : "2",
 				"DEPEND" : "!!app-misc/installed-blocker-a",
 			},
-			"app-misc/blocker-update-order-a-1" : {
-				"RDEPEND" : ">=app-misc/installed-old-version-blocks-a-2"
-			},
+			"app-misc/blocker-update-order-a-1" : {},
 			"app-misc/blocker-runtime-a-1" : {},
 			"app-misc/blocker-runtime-hard-a-1" : {},
 			"app-misc/circ-buildtime-a-0": {},
@@ -85,7 +83,7 @@ class MergeOrderTestCase(TestCase):
 				"RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
 			},
 			"app-misc/installed-old-version-blocks-a-1" : {
-				"RDEPEND" : "!app-misc/installed-old-version-blocks-a",
+				"RDEPEND" : "!app-misc/blocker-update-order-a",
 			},
 			"app-misc/installed-old-version-blocks-a-2" : {},
 			"app-misc/some-app-a-1": {
@@ -117,7 +115,7 @@ class MergeOrderTestCase(TestCase):
 				"RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
 			},
 			"app-misc/installed-old-version-blocks-a-1" : {
-				"RDEPEND" : "!app-misc/installed-old-version-blocks-a",
+				"RDEPEND" : "!app-misc/blocker-update-order-a",
 			},
 		}
 
@@ -179,8 +177,9 @@ class MergeOrderTestCase(TestCase):
 			# be updated first, in order to solve the blocker without
 			# any need for blocking packages to temporarily overlap.
 			ResolverPlaygroundTestCase(
-				["app-misc/blocker-update-order-a"],
+				["app-misc/blocker-update-order-a", "app-misc/installed-old-version-blocks-a"],
 				success = True,
+				all_permutations = True,
 				mergelist = ["app-misc/installed-old-version-blocks-a-2", "app-misc/blocker-update-order-a-1"]),
 			# installed package has runtime blocker that
 			# should cause it to be uninstalled



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-22  9:05 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-22  9:05 UTC (permalink / raw
  To: gentoo-commits

commit:     85e39abd03c2d3d272d2cc5bfdb08d50aa10e445
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 09:05:15 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 22 09:05:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=85e39abd

ambiguous_merge_order: set match = False more

---
 pym/portage/tests/resolver/ResolverPlayground.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 48ce6e7..39576f1 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -548,12 +548,14 @@ class ResolverPlaygroundTestCase(object):
 							if got_token == expected_obj:
 								continue
 							# result doesn't match, so stop early
+							match = False
 							break
 						expected_obj = set(expected_obj)
 						try:
 							expected_obj.remove(got_token)
 						except KeyError:
 							# result doesn't match, so stop early
+							match = False
 							break
 						new_expected.append(got_token)
 						while got_stack and expected_obj:



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-22 17:03 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-22 17:03 UTC (permalink / raw
  To: gentoo-commits

commit:     9f4e7fa99017888ffed7414a6238961165b6d4e6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 17:03:05 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 22 17:03:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f4e7fa9

test_depth: use ambiguous_merge_order

---
 pym/portage/tests/resolver/test_depth.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/portage/tests/resolver/test_depth.py b/pym/portage/tests/resolver/test_depth.py
index ec3e238..8772acb 100644
--- a/pym/portage/tests/resolver/test_depth.py
+++ b/pym/portage/tests/resolver/test_depth.py
@@ -134,7 +134,8 @@ class ResolverDepthTestCase(TestCase):
 				["virtual/jre"],
 				options = {"--update" : True},
 				success = True,
-				mergelist = ['virtual/jre-1.6.0-r1', 'virtual/jre-1.5.0-r1']),
+				ambiguous_merge_order = True,
+				mergelist = [('virtual/jre-1.6.0-r1', 'virtual/jre-1.5.0-r1')]),
 
 			# Recursively traversed virtual dependencies, and their
 			# direct dependencies, are considered to have the same
@@ -143,7 +144,8 @@ class ResolverDepthTestCase(TestCase):
 				["virtual/jre"],
 				options = {"--update" : True, "--deep" : 1},
 				success = True,
-				mergelist = ['dev-java/icedtea-6.1-r1', 'dev-java/gcj-jdk-4.5-r1', 'virtual/jdk-1.6.0-r1', 'virtual/jdk-1.5.0-r1', 'virtual/jre-1.6.0-r1', 'virtual/jre-1.5.0-r1']),
+				ambiguous_merge_order = True,
+				mergelist = [('dev-java/icedtea-6.1-r1', 'dev-java/gcj-jdk-4.5-r1'), ('virtual/jdk-1.6.0-r1', 'virtual/jdk-1.5.0-r1', 'virtual/jre-1.6.0-r1', 'virtual/jre-1.5.0-r1')]),
 
 			ResolverPlaygroundTestCase(
 				["virtual/jre:1.5"],



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-22 19:44 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-22 19:44 UTC (permalink / raw
  To: gentoo-commits

commit:     480d1104c6deacb4ae19aefffebb7db51b992391
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 19:43:03 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 22 19:43:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=480d1104

test_merge_order: test many-to-one blocks

---
 pym/portage/tests/resolver/ResolverPlayground.py |    5 +++--
 pym/portage/tests/resolver/test_merge_order.py   |   17 +++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 39576f1..6a8e3c1 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -528,8 +528,9 @@ class ResolverPlaygroundTestCase(object):
 								continue
 							new_expected.append(set())
 							for cpv in obj:
-								a = Atom("="+cpv, allow_repo=True)
-								new_expected[-1].add(a.cpv)
+								if cpv[:1] != "!":
+									cpv = Atom("="+cpv, allow_repo=True).cpv
+								new_expected[-1].add(cpv)
 						expected = new_expected
 				if self.ignore_mergelist_order and got is not None:
 					got = set(got)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index fdbfcb5..2df3a99 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -19,6 +19,7 @@ class MergeOrderTestCase(TestCase):
 			},
 			"app-misc/blocker-update-order-a-1" : {},
 			"app-misc/blocker-runtime-a-1" : {},
+			"app-misc/blocker-runtime-b-1" : {},
 			"app-misc/blocker-runtime-hard-a-1" : {},
 			"app-misc/circ-buildtime-a-0": {},
 			"app-misc/circ-buildtime-a-1": {
@@ -80,7 +81,7 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/installed-blocker-a-1" : {
 				"EAPI"   : "2",
 				"DEPEND" : "!app-misc/blocker-buildtime-a",
-				"RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
+				"RDEPEND" : "!app-misc/blocker-runtime-a !app-misc/blocker-runtime-b !!app-misc/blocker-runtime-hard-a",
 			},
 			"app-misc/installed-old-version-blocks-a-1" : {
 				"RDEPEND" : "!app-misc/blocker-update-order-a",
@@ -112,7 +113,7 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/installed-blocker-a-1" : {
 				"EAPI"   : "2",
 				"DEPEND" : "!app-misc/blocker-buildtime-a",
-				"RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
+				"RDEPEND" : "!app-misc/blocker-runtime-a !app-misc/blocker-runtime-b !!app-misc/blocker-runtime-hard-a",
 			},
 			"app-misc/installed-old-version-blocks-a-1" : {
 				"RDEPEND" : "!app-misc/blocker-update-order-a",
@@ -181,13 +182,17 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				all_permutations = True,
 				mergelist = ["app-misc/installed-old-version-blocks-a-2", "app-misc/blocker-update-order-a-1"]),
-			# installed package has runtime blocker that
-			# should cause it to be uninstalled
+			# The installed package has runtime blockers that
+			# should cause it to be uninstalled. The uninstall
+			# task is executed only after blocking packages have
+			# been merged.
 			# TODO: distinguish between install/uninstall tasks in mergelist
 			ResolverPlaygroundTestCase(
-				["app-misc/blocker-runtime-a"],
+				["app-misc/blocker-runtime-a", "app-misc/blocker-runtime-b"],
 				success = True,
-				mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]),
+				all_permutations = True,
+				ambiguous_merge_order = True,
+				mergelist = [("app-misc/blocker-runtime-a-1", "app-misc/blocker-runtime-b-1"), "app-misc/installed-blocker-a-1", ("!app-misc/blocker-runtime-a", "!app-misc/blocker-runtime-b")]),
 			# We have a soft buildtime blocker against an installed
 			# package that should cause it to be uninstalled. Note that with
 			# soft blockers, the blocking packages are allowed to temporarily



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-22 20:03 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-22 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     f2ea798f3f22be9a9801382aef235ee1af49b1a1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 20:02:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 22 20:02:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f2ea798f

test_merge_order: test hard block resolution

---
 pym/portage/tests/resolver/test_merge_order.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 2df3a99..1904d5c 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -18,6 +18,7 @@ class MergeOrderTestCase(TestCase):
 				"DEPEND" : "!!app-misc/installed-blocker-a",
 			},
 			"app-misc/blocker-update-order-a-1" : {},
+			"app-misc/blocker-update-order-hard-a-1" : {},
 			"app-misc/blocker-runtime-a-1" : {},
 			"app-misc/blocker-runtime-b-1" : {},
 			"app-misc/blocker-runtime-hard-a-1" : {},
@@ -87,6 +88,11 @@ class MergeOrderTestCase(TestCase):
 				"RDEPEND" : "!app-misc/blocker-update-order-a",
 			},
 			"app-misc/installed-old-version-blocks-a-2" : {},
+			"app-misc/installed-old-version-blocks-hard-a-1" : {
+				"EAPI"    : "2",
+				"RDEPEND" : "!!app-misc/blocker-update-order-hard-a",
+			},
+			"app-misc/installed-old-version-blocks-hard-a-2" : {},
 			"app-misc/some-app-a-1": {
 				"RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
 			},
@@ -118,6 +124,10 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/installed-old-version-blocks-a-1" : {
 				"RDEPEND" : "!app-misc/blocker-update-order-a",
 			},
+			"app-misc/installed-old-version-blocks-hard-a-1" : {
+				"EAPI"    : "2",
+				"RDEPEND" : "!!app-misc/blocker-update-order-hard-a",
+			},
 		}
 
 		test_cases = (
@@ -182,6 +192,14 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				all_permutations = True,
 				mergelist = ["app-misc/installed-old-version-blocks-a-2", "app-misc/blocker-update-order-a-1"]),
+			# This is the same as above but with a hard blocker. The hard
+			# blocker is solved automatically since the update makes it
+			# irrelevant.
+			ResolverPlaygroundTestCase(
+				["app-misc/blocker-update-order-hard-a", "app-misc/installed-old-version-blocks-hard-a"],
+				success = True,
+				all_permutations = True,
+				mergelist = ["app-misc/installed-old-version-blocks-hard-a-2", "app-misc/blocker-update-order-hard-a-1"]),
 			# The installed package has runtime blockers that
 			# should cause it to be uninstalled. The uninstall
 			# task is executed only after blocking packages have



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-22 20:36 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-22 20:36 UTC (permalink / raw
  To: gentoo-commits

commit:     652d1ff477c39c077c37ed249ed2d0f4fcbc75af
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 20:36:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 22 20:36:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=652d1ff4

test_merge_order: test case for bug 250286

---
 pym/portage/tests/resolver/test_merge_order.py |   28 ++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 1904d5c..105f869 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -19,6 +19,7 @@ class MergeOrderTestCase(TestCase):
 			},
 			"app-misc/blocker-update-order-a-1" : {},
 			"app-misc/blocker-update-order-hard-a-1" : {},
+			"app-misc/blocker-update-order-hard-unsolvable-a-1" : {},
 			"app-misc/blocker-runtime-a-1" : {},
 			"app-misc/blocker-runtime-b-1" : {},
 			"app-misc/blocker-runtime-hard-a-1" : {},
@@ -93,6 +94,14 @@ class MergeOrderTestCase(TestCase):
 				"RDEPEND" : "!!app-misc/blocker-update-order-hard-a",
 			},
 			"app-misc/installed-old-version-blocks-hard-a-2" : {},
+			"app-misc/installed-old-version-blocks-hard-unsolvable-a-1" : {
+				"EAPI"    : "2",
+				"RDEPEND" : "!!app-misc/blocker-update-order-hard-unsolvable-a",
+			},
+			"app-misc/installed-old-version-blocks-hard-unsolvable-a-2" : {
+				"DEPEND"  : "app-misc/blocker-update-order-hard-unsolvable-a",
+				"RDEPEND" : "",
+			},
 			"app-misc/some-app-a-1": {
 				"RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
 			},
@@ -128,6 +137,10 @@ class MergeOrderTestCase(TestCase):
 				"EAPI"    : "2",
 				"RDEPEND" : "!!app-misc/blocker-update-order-hard-a",
 			},
+			"app-misc/installed-old-version-blocks-hard-unsolvable-a-1" : {
+				"EAPI"    : "2",
+				"RDEPEND" : "!!app-misc/blocker-update-order-hard-unsolvable-a",
+			},
 		}
 
 		test_cases = (
@@ -200,6 +213,21 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				all_permutations = True,
 				mergelist = ["app-misc/installed-old-version-blocks-hard-a-2", "app-misc/blocker-update-order-hard-a-1"]),
+			# This is similar to the above case except that it's unsolvable
+			# due to merge order, unless bug 250286 is implemented so that
+			# the installed blocker will be unmerged before installation
+			# of the package it blocks (rather than after like a soft blocker
+			# would be handled). The "unmerge before" behavior requested
+			# in bug 250286 must be optional since essential programs or
+			# libraries may be temporarily unavailable during a
+			# non-overlapping update like this.
+			ResolverPlaygroundTestCase(
+				["app-misc/blocker-update-order-hard-unsolvable-a", "app-misc/installed-old-version-blocks-hard-unsolvable-a"],
+				success = False,
+				all_permutations = True,
+				ambiguous_merge_order = True,
+				merge_order_assertions = (('app-misc/blocker-update-order-hard-unsolvable-a-1', 'app-misc/installed-old-version-blocks-hard-unsolvable-a-2'),),
+				mergelist = [('app-misc/blocker-update-order-hard-unsolvable-a-1', 'app-misc/installed-old-version-blocks-hard-unsolvable-a-2', '!!app-misc/blocker-update-order-hard-unsolvable-a')]),
 			# The installed package has runtime blockers that
 			# should cause it to be uninstalled. The uninstall
 			# task is executed only after blocking packages have



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-22 21:01 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-22 21:01 UTC (permalink / raw
  To: gentoo-commits

commit:     fabc1017c5d1c5273e63f0acf47d9589ff982d2d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 21:01:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 22 21:01:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fabc1017

test_merge_order: test asap PORTAGE_PACKAGE_ATOM

---
 pym/portage/tests/resolver/test_merge_order.py |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 105f869..2a4dbc3 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -1,6 +1,7 @@
 # Copyright 2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import portage
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
 	ResolverPlaygroundTestCase)
@@ -111,6 +112,16 @@ class MergeOrderTestCase(TestCase):
 			"app-misc/some-app-c-1": {
 				"RDEPEND": "app-misc/circ-buildtime-a app-misc/circ-buildtime-b",
 			},
+			"sys-apps/portage-2.1.9.42" : {
+				"DEPEND"  : "dev-lang/python",
+				"RDEPEND" : "dev-lang/python",
+			},
+			"sys-apps/portage-2.1.9.49" : {
+				"DEPEND"  : "dev-lang/python",
+				"RDEPEND" : "dev-lang/python",
+			},
+			"dev-lang/python-3.1" : {},
+			"dev-lang/python-3.2" : {},
 		}
 
 		installed = {
@@ -141,6 +152,11 @@ class MergeOrderTestCase(TestCase):
 				"EAPI"    : "2",
 				"RDEPEND" : "!!app-misc/blocker-update-order-hard-unsolvable-a",
 			},
+			"sys-apps/portage-2.1.9.42" : {
+				"DEPEND"  : "dev-lang/python",
+				"RDEPEND" : "dev-lang/python",
+			},
+			"dev-lang/python-3.1" : {},
 		}
 
 		test_cases = (
@@ -263,6 +279,12 @@ class MergeOrderTestCase(TestCase):
 				["app-misc/blocker-runtime-hard-a"],
 				success = False,
 				mergelist = ['app-misc/blocker-runtime-hard-a-1', '!!app-misc/blocker-runtime-hard-a']),
+			# Test that PORTAGE_PACKAGE_ATOM is merged asap.
+			ResolverPlaygroundTestCase(
+				["dev-lang/python", portage.const.PORTAGE_PACKAGE_ATOM],
+				success = True,
+				all_permutations = True,
+				mergelist = ['sys-apps/portage-2.1.9.49', 'dev-lang/python-3.2']),
 		)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-22 22:01 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-22 22:01 UTC (permalink / raw
  To: gentoo-commits

commit:     666fe9ab262e0c1307eeecc08e204966aefdf0c0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 22:01:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 22 22:01:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=666fe9ab

test_merge_order: test asap LIBC_PACKAGE_ATOM

---
 pym/portage/tests/resolver/test_merge_order.py |   44 ++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 2a4dbc3..1b7cddd 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -122,6 +122,26 @@ class MergeOrderTestCase(TestCase):
 			},
 			"dev-lang/python-3.1" : {},
 			"dev-lang/python-3.2" : {},
+			"virtual/libc-0" : {
+				"RDEPEND" : "sys-libs/glibc",
+			},
+			"sys-libs/glibc-2.11" : {
+				"DEPEND" : "virtual/os-headers",
+			},
+			"sys-libs/glibc-2.13" : {
+				"DEPEND" : "virtual/os-headers",
+			},
+			"virtual/os-headers-0" : {
+				"RDEPEND" : "sys-kernel/linux-headers",
+			},
+			"sys-kernel/linux-headers-2.6.38": {
+				"DEPEND" : "app-arch/xz-utils",
+			},
+			"sys-kernel/linux-headers-2.6.39": {
+				"DEPEND" : "app-arch/xz-utils",
+			},
+			"app-arch/xz-utils-5.0.1" : {},
+			"app-arch/xz-utils-5.0.2" : {},
 		}
 
 		installed = {
@@ -157,6 +177,19 @@ class MergeOrderTestCase(TestCase):
 				"RDEPEND" : "dev-lang/python",
 			},
 			"dev-lang/python-3.1" : {},
+			"virtual/libc-0" : {
+				"RDEPEND" : "sys-libs/glibc",
+			},
+			"sys-libs/glibc-2.11" : {
+				"DEPEND" : "virtual/os-headers",
+			},
+			"virtual/os-headers-0" : {
+				"RDEPEND" : "sys-kernel/linux-headers",
+			},
+			"sys-kernel/linux-headers-2.6.38": {
+				"DEPEND" : "app-arch/xz-utils",
+			},
+			"app-arch/xz-utils-5.0.1" : {},
 		}
 
 		test_cases = (
@@ -285,6 +318,17 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				all_permutations = True,
 				mergelist = ['sys-apps/portage-2.1.9.49', 'dev-lang/python-3.2']),
+			# Test that OS_HEADERS_PACKAGE_ATOM and LIBC_PACKAGE_ATOM
+			# are merged asap, in order to account for implicit
+			# dependencies. See bug #303567.
+			# TODO: optimize this to ensure that glibc comes before xz-utils
+			ResolverPlaygroundTestCase(
+				["app-arch/xz-utils", "sys-kernel/linux-headers", "sys-libs/glibc"],
+				options = {"--complete-graph" : True},
+				success = True,
+				all_permutations = True,
+				ambiguous_merge_order = True,
+				mergelist = ['sys-kernel/linux-headers-2.6.39', ('app-arch/xz-utils-5.0.2', 'sys-libs/glibc-2.13')]),
 		)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-23  0:46 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-23  0:46 UTC (permalink / raw
  To: gentoo-commits

commit:     436a3cea2e56d57fdae788a4fdaf49438a10b4e5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 00:44:49 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 23 00:44:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=436a3cea

test_depth: use merge_order_assertions

---
 pym/portage/tests/resolver/test_depth.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_depth.py b/pym/portage/tests/resolver/test_depth.py
index 8772acb..cb1e2dd 100644
--- a/pym/portage/tests/resolver/test_depth.py
+++ b/pym/portage/tests/resolver/test_depth.py
@@ -145,7 +145,9 @@ class ResolverDepthTestCase(TestCase):
 				options = {"--update" : True, "--deep" : 1},
 				success = True,
 				ambiguous_merge_order = True,
-				mergelist = [('dev-java/icedtea-6.1-r1', 'dev-java/gcj-jdk-4.5-r1'), ('virtual/jdk-1.6.0-r1', 'virtual/jdk-1.5.0-r1', 'virtual/jre-1.6.0-r1', 'virtual/jre-1.5.0-r1')]),
+				merge_order_assertions=(('dev-java/icedtea-6.1-r1', 'virtual/jdk-1.6.0-r1'), ('virtual/jdk-1.6.0-r1', 'virtual/jre-1.6.0-r1'),
+					('dev-java/gcj-jdk-4.5-r1', 'virtual/jdk-1.5.0-r1'), ('virtual/jdk-1.5.0-r1', 'virtual/jre-1.5.0-r1')),
+				mergelist = [('dev-java/icedtea-6.1-r1', 'dev-java/gcj-jdk-4.5-r1', 'virtual/jdk-1.6.0-r1', 'virtual/jdk-1.5.0-r1', 'virtual/jre-1.6.0-r1', 'virtual/jre-1.5.0-r1')]),
 
 			ResolverPlaygroundTestCase(
 				["virtual/jre:1.5"],



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-23  5:59 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-23  5:59 UTC (permalink / raw
  To: gentoo-commits

commit:     83e979f8e6bacc611e3e6b6b09142572b0df70d8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 05:59:16 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 23 05:59:16 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=83e979f8

test_merge_order: add more asap libc deps

---
 pym/portage/tests/resolver/test_merge_order.py |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 1057300..ba3d9b4 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -126,12 +126,15 @@ class MergeOrderTestCase(TestCase):
 			"virtual/libc-0" : {
 				"RDEPEND" : "sys-libs/glibc",
 			},
+			"sys-devel/gcc-4.5.2" : {},
+			"sys-devel/binutils-2.18" : {},
+			"sys-devel/binutils-2.20.1" : {},
 			"sys-libs/glibc-2.11" : {
-				"DEPEND" : "virtual/os-headers",
+				"DEPEND" : "virtual/os-headers sys-devel/gcc sys-devel/binutils",
 				"RDEPEND": "",
 			},
 			"sys-libs/glibc-2.13" : {
-				"DEPEND" : "virtual/os-headers",
+				"DEPEND" : "virtual/os-headers sys-devel/gcc sys-devel/binutils",
 				"RDEPEND": "",
 			},
 			"virtual/os-headers-0" : {
@@ -185,8 +188,9 @@ class MergeOrderTestCase(TestCase):
 			"virtual/libc-0" : {
 				"RDEPEND" : "sys-libs/glibc",
 			},
+			"sys-devel/binutils-2.18" : {},
 			"sys-libs/glibc-2.11" : {
-				"DEPEND" : "virtual/os-headers",
+				"DEPEND" : "virtual/os-headers sys-devel/gcc sys-devel/binutils",
 				"RDEPEND": "",
 			},
 			"virtual/os-headers-0" : {
@@ -329,13 +333,15 @@ class MergeOrderTestCase(TestCase):
 				mergelist = ['app-admin/eselect-python-20100321', 'sys-apps/portage-2.1.9.49', 'dev-lang/python-3.2']),
 			# Test that OS_HEADERS_PACKAGE_ATOM and LIBC_PACKAGE_ATOM
 			# are merged asap, in order to account for implicit
-			# dependencies. See bug #303567.
+			# dependencies. See bug #303567. Optimally, satisfied deps
+			# are always merged after the asap nodes that depend on them.
 			ResolverPlaygroundTestCase(
-				["app-arch/xz-utils", "sys-kernel/linux-headers", "sys-libs/glibc"],
+				["app-arch/xz-utils", "sys-kernel/linux-headers", "sys-devel/binutils", "sys-libs/glibc"],
 				options = {"--complete-graph" : True},
 				success = True,
 				all_permutations = True,
-				mergelist = ['sys-kernel/linux-headers-2.6.39', 'sys-libs/glibc-2.13', 'app-arch/xz-utils-5.0.2']),
+				ambiguous_merge_order = True,
+				mergelist = ['sys-kernel/linux-headers-2.6.39', 'sys-devel/gcc-4.5.2', 'sys-libs/glibc-2.13', ('app-arch/xz-utils-5.0.2', 'sys-devel/binutils-2.20.1')]),
 		)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-30 22:58 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-30 22:58 UTC (permalink / raw
  To: gentoo-commits

commit:     fffbc6bc2a186bf0b09b791dcb260506875e66ce
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 30 22:56:29 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 30 22:56:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fffbc6bc

test_merge_order: test bug #264434 with virtual

---
 pym/portage/tests/resolver/test_merge_order.py |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index e00f820..6aa19c0 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -169,7 +169,14 @@ class MergeOrderTestCase(TestCase):
 			"kde-base/kmines-3.5.7" : {
 				"DEPEND"  : "kde-base/libkdegames",
 				"RDEPEND" : "kde-base/libkdegames",
-			}
+			},
+			"media-video/ffmpeg-0.7_rc1" : {},
+			"media-video/libav-0.7_pre20110327" : {
+				"RDEPEND" : "!media-video/ffmpeg",
+			},
+			"virtual/ffmpeg-0.6.90" : {
+				"RDEPEND" : "|| ( >=media-video/ffmpeg-0.6.90_rc0-r2 >=media-video/libav-0.6.90_rc )",
+			},
 		}
 
 		installed = {
@@ -221,6 +228,10 @@ class MergeOrderTestCase(TestCase):
 				"RDEPEND": "",
 			},
 			"app-arch/xz-utils-5.0.1" : {},
+			"media-video/ffmpeg-0.7_rc1" : {},
+			"virtual/ffmpeg-0.6.90" : {
+				"RDEPEND" : "|| ( >=media-video/ffmpeg-0.6.90_rc0-r2 >=media-video/libav-0.6.90_rc )",
+			},
 		}
 
 		test_cases = (
@@ -343,6 +354,15 @@ class MergeOrderTestCase(TestCase):
 				["app-misc/blocker-runtime-hard-a"],
 				success = False,
 				mergelist = ['app-misc/blocker-runtime-hard-a-1', '!!app-misc/blocker-runtime-hard-a']),
+			# Test swapping of providers for a new-style virtual package,
+			# which relies on delayed evaluation of disjunctive (virtual
+			# and ||) deps as required to solve bug #264434. Note that
+			# this behavior is not suppored for old-style PROVIDE virtuals,
+			# as reported in bug #339164.
+			ResolverPlaygroundTestCase(
+				["media-video/libav"],
+				success=True,
+				mergelist = ['media-video/libav-0.7_pre20110327', 'media-video/ffmpeg-0.7_rc1', '!media-video/ffmpeg']),
 			# Test that PORTAGE_PACKAGE_ATOM is merged asap. Optimally,
 			# satisfied deps are always merged after the asap nodes that
 			# depend on them.



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-05-30 23:44 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-05-30 23:44 UTC (permalink / raw
  To: gentoo-commits

commit:     f67dfd2c24aa127f5d596b3d1f051df8d8cbf5fb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 30 23:43:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 30 23:43:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f67dfd2c

test_merge_order: add USE deps to bug 264434 test

---
 pym/portage/tests/resolver/test_merge_order.py |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index 6aa19c0..e42b772 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -170,12 +170,19 @@ class MergeOrderTestCase(TestCase):
 				"DEPEND"  : "kde-base/libkdegames",
 				"RDEPEND" : "kde-base/libkdegames",
 			},
-			"media-video/ffmpeg-0.7_rc1" : {},
 			"media-video/libav-0.7_pre20110327" : {
+				"EAPI" : "2",
+				"IUSE" : "X +encode",
 				"RDEPEND" : "!media-video/ffmpeg",
 			},
+			"media-video/ffmpeg-0.7_rc1" : {
+				"EAPI" : "2",
+				"IUSE" : "X +encode",
+			},
 			"virtual/ffmpeg-0.6.90" : {
-				"RDEPEND" : "|| ( >=media-video/ffmpeg-0.6.90_rc0-r2 >=media-video/libav-0.6.90_rc )",
+				"EAPI" : "2",
+				"IUSE" : "X +encode",
+				"RDEPEND" : "|| ( >=media-video/ffmpeg-0.6.90_rc0-r2[X=,encode=] >=media-video/libav-0.6.90_rc[X=,encode=] )",
 			},
 		}
 
@@ -228,9 +235,16 @@ class MergeOrderTestCase(TestCase):
 				"RDEPEND": "",
 			},
 			"app-arch/xz-utils-5.0.1" : {},
-			"media-video/ffmpeg-0.7_rc1" : {},
+			"media-video/ffmpeg-0.7_rc1" : {
+				"EAPI" : "2",
+				"IUSE" : "X +encode",
+				"USE" : "encode",
+			},
 			"virtual/ffmpeg-0.6.90" : {
-				"RDEPEND" : "|| ( >=media-video/ffmpeg-0.6.90_rc0-r2 >=media-video/libav-0.6.90_rc )",
+				"EAPI" : "2",
+				"IUSE" : "X +encode",
+				"USE" : "encode",
+				"RDEPEND" : "|| ( >=media-video/ffmpeg-0.6.90_rc0-r2[X=,encode=] >=media-video/libav-0.6.90_rc[X=,encode=] )",
 			},
 		}
 



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-06-04  3:08 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-06-04  3:08 UTC (permalink / raw
  To: gentoo-commits

commit:     a08ac251f34e7aaa9c62892c99dd439a11d9996c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  4 03:08:35 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  4 03:08:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a08ac251

Fix a typo in a comment.

---
 pym/portage/tests/resolver/test_merge_order.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index e42b772..e94b6c7 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -371,7 +371,7 @@ class MergeOrderTestCase(TestCase):
 			# Test swapping of providers for a new-style virtual package,
 			# which relies on delayed evaluation of disjunctive (virtual
 			# and ||) deps as required to solve bug #264434. Note that
-			# this behavior is not suppored for old-style PROVIDE virtuals,
+			# this behavior is not supported for old-style PROVIDE virtuals,
 			# as reported in bug #339164.
 			ResolverPlaygroundTestCase(
 				["media-video/libav"],



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-08-29  6:19 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-08-29  6:19 UTC (permalink / raw
  To: gentoo-commits

commit:     acad62063c074f5b4ff692bc52514b1b8d028100
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 06:18:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 06:18:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=acad6206

ResolverPlayground: fix to make emerge happy

---
 pym/portage/tests/resolver/ResolverPlayground.py |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index dd01414..f41126b 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -7,7 +7,7 @@ import sys
 import tempfile
 import portage
 from portage import os
-from portage.const import PORTAGE_BASE_PATH
+from portage.const import GLOBAL_CONFIG_PATH, PORTAGE_BASE_PATH
 from portage.dbapi.vartree import vartree
 from portage.dbapi.porttree import portagetree
 from portage.dbapi.bintree import binarytree
@@ -16,6 +16,7 @@ from portage.package.ebuild.config import config
 from portage.package.ebuild.digestgen import digestgen
 from portage._sets import load_default_config
 from portage._sets.base import InternalPackageSet
+from portage.util import ensure_dirs
 from portage.versions import catsplit
 
 import _emerge
@@ -206,6 +207,7 @@ class ResolverPlayground(object):
 				f.close()
 			
 			write_key("EAPI", eapi)
+			write_key("COUNTER", "0")
 			write_key("LICENSE", lic)
 			write_key("PROPERTIES", properties)
 			write_key("SLOT", slot)
@@ -286,6 +288,11 @@ class ResolverPlayground(object):
 				f.write("x86\n")
 				f.close()
 
+				parent_file = os.path.join(sub_profile_dir, "parent")
+				f = open(parent_file, "w")
+				f.write("..\n")
+				f.close()
+
 				if profile:
 					for config_file, lines in profile.items():
 						if config_file not in self.config_files:
@@ -331,6 +338,13 @@ class ResolverPlayground(object):
 				f.write("%s\n" % line)
 			f.close()
 
+		#Create /usr/share/portage/config/make.globals
+		make_globals_path = os.path.join(self.eroot,
+			GLOBAL_CONFIG_PATH.lstrip(os.sep), "make.globals")
+		ensure_dirs(os.path.dirname(make_globals_path))
+		os.symlink(os.path.join(PORTAGE_BASE_PATH, "cnf", "make.globals"),
+			make_globals_path)
+
 		#Create /usr/share/portage/config/sets/portage.conf
 		default_sets_conf_dir = os.path.join(self.eroot, "usr/share/portage/config/sets")
 		



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-09-05 22:44 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-09-05 22:44 UTC (permalink / raw
  To: gentoo-commits

commit:     19836e6de2a3723abe9b1f0440c7c08a28813f56
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  5 22:44:40 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep  5 22:44:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=19836e6d

ResolverPlayground: make.profile in /etc/portage

---
 pym/portage/tests/resolver/ResolverPlayground.py |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 67c4e5c..5d7c316 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -7,7 +7,8 @@ import sys
 import tempfile
 import portage
 from portage import os
-from portage.const import GLOBAL_CONFIG_PATH, PORTAGE_BASE_PATH
+from portage.const import (GLOBAL_CONFIG_PATH, PORTAGE_BASE_PATH,
+	USER_CONFIG_PATH)
 from portage.dbapi.vartree import vartree
 from portage.dbapi.porttree import portagetree
 from portage.dbapi.bintree import binarytree
@@ -245,6 +246,13 @@ class ResolverPlayground(object):
 
 	def _create_profile(self, ebuilds, installed, profile, repo_configs, user_config, sets):
 
+		user_config_dir = os.path.join(self.eroot, USER_CONFIG_PATH)
+
+		try:
+			os.makedirs(user_config_dir)
+		except os.error:
+			pass
+
 		for repo in self.repo_dirs:
 			repo_dir = self._get_repo_dir(repo)
 			profile_dir = os.path.join(self._get_repo_dir(repo), "profiles")
@@ -323,8 +331,7 @@ class ResolverPlayground(object):
 						f.close()
 
 				#Create profile symlink
-				os.makedirs(os.path.join(self.eroot, "etc"))
-				os.symlink(sub_profile_dir, os.path.join(self.eroot, "etc", "make.profile"))
+				os.symlink(sub_profile_dir, os.path.join(user_config_dir, "make.profile"))
 
 				#Create minimal herds.xml
 				metadata_dir = os.path.join(repo_dir, "metadata")
@@ -349,13 +356,6 @@ class ResolverPlayground(object):
 				with open(os.path.join(metadata_dir, "metadata.xml"), 'w') as f:
 					f.write(herds_xml)
 
-		user_config_dir = os.path.join(self.eroot, "etc", "portage")
-
-		try:
-			os.makedirs(user_config_dir)
-		except os.error:
-			pass
-
 		repos_conf_file = os.path.join(user_config_dir, "repos.conf")		
 		f = open(repos_conf_file, "w")
 		priority = 0



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-09-11 18:50 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-09-11 18:50 UTC (permalink / raw
  To: gentoo-commits

commit:     676d6b23b096ef65d97fb9f02cc61959004d9edf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 11 18:49:36 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 18:49:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=676d6b23

Add VirtualSlotResolverTestCase for bug #382557.

---
 pym/portage/tests/resolver/test_virtual_slot.py |   46 +++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_virtual_slot.py b/pym/portage/tests/resolver/test_virtual_slot.py
new file mode 100644
index 0000000..40ed73b
--- /dev/null
+++ b/pym/portage/tests/resolver/test_virtual_slot.py
@@ -0,0 +1,46 @@
+# Copyright 2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
+
+class VirtualSlotResolverTestCase(TestCase):
+
+	def testLicenseMaskedVirtualSlotUpdate(self):
+
+		ebuilds = {
+			"dev-java/oracle-jdk-bin-1.7.0" : {"SLOT": "1.7", "LICENSE": "TEST"},
+			"dev-java/sun-jdk-1.6.0" : {"SLOT": "1.6", "LICENSE": "TEST"},
+			"dev-java/icedtea-6.1.10.3" : {"SLOT": "6"},
+			"app-misc/java-app-1": {"RDEPEND": ">=virtual/jdk-1.6.0"},
+			"virtual/jdk-1.6.0": {"SLOT": "1.6", "RDEPEND": "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+			"virtual/jdk-1.7.0": {"SLOT": "1.7", "RDEPEND": "|| ( =dev-java/oracle-jdk-bin-1.7.0* )"},
+		}
+
+		installed = {
+			"app-misc/java-app-1": {"RDEPEND": ">=virtual/jdk-1.6.0"},
+			"dev-java/icedtea-6.1.10.3" : {"SLOT": "6"},
+			"virtual/jdk-1.6.0": {"SLOT" : "1.6", "RDEPEND": "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+		}
+
+		world = ("app-misc/java-app",)
+
+		test_cases = (
+			# Bug #382557 - Don't pull in the virtual/jdk-1.7.0 slot update
+			# since its dependencies can only be satisfied by a package that
+			# is masked by license.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update" : True, "--deep" : True},
+				success = True,
+				mergelist = []),
+		)
+
+		playground = ResolverPlayground(
+			ebuilds=ebuilds, installed=installed, world=world)
+		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()



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-09-18 20:08 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-09-18 20:08 UTC (permalink / raw
  To: gentoo-commits

commit:     552720b56d811875b25cad201cd38641ad62da81
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Sun Sep 18 19:28:12 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 18 20:02:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=552720b5

ResolverPlayground: Add support for world sets

---
 pym/portage/tests/resolver/ResolverPlayground.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 5fb64cf..adf03d2 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -57,7 +57,7 @@ class ResolverPlayground(object):
 """
 
 	def __init__(self, ebuilds={}, installed={}, profile={}, repo_configs={}, \
-		user_config={}, sets={}, world=[], distfiles={}, debug=False):
+		user_config={}, sets={}, world=[], world_sets=[], distfiles={}, debug=False):
 		"""
 		ebuilds: cpv -> metadata mapping simulating available ebuilds. 
 		installed: cpv -> metadata mapping simulating installed packages.
@@ -85,7 +85,7 @@ class ResolverPlayground(object):
 		self._create_ebuilds(ebuilds)
 		self._create_installed(installed)
 		self._create_profile(ebuilds, installed, profile, repo_configs, user_config, sets)
-		self._create_world(world)
+		self._create_world(world, world_sets)
 
 		self.settings, self.trees = self._load_config()
 
@@ -444,18 +444,24 @@ class ResolverPlayground(object):
 				f.write("%s\n" % line)
 			f.close()
 
-	def _create_world(self, world):
+	def _create_world(self, world, world_sets):
 		#Create /var/lib/portage/world
 		var_lib_portage = os.path.join(self.eroot, "var", "lib", "portage")
 		os.makedirs(var_lib_portage)
 
 		world_file = os.path.join(var_lib_portage, "world")
+		world_set_file = os.path.join(var_lib_portage, "world_sets")
 
 		f = open(world_file, "w")
 		for atom in world:
 			f.write("%s\n" % atom)
 		f.close()
 
+		f = open(world_set_file, "w")
+		for atom in world_sets:
+			f.write("%s\n" % atom)
+		f.close()
+
 	def _load_config(self):
 		portdir_overlay = []
 		for repo_name in sorted(self.repo_dirs):



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-09-22 18:19 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-09-22 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     7369c82039a3ead20d015e1856fc3f4f78d31c22
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 18:19:05 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 18:19:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7369c820

Test || choice circular handling.

---
 .../tests/resolver/test_circular_choices.py        |   32 ++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_circular_choices.py b/pym/portage/tests/resolver/test_circular_choices.py
new file mode 100644
index 0000000..57f76b9
--- /dev/null
+++ b/pym/portage/tests/resolver/test_circular_choices.py
@@ -0,0 +1,32 @@
+# Copyright 2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class CircularChoicesTestCase(TestCase):
+
+	def testDirectCircularDependency(self):
+
+		ebuilds = {
+			"dev-lang/gwydion-dylan-2.4.0": {"DEPEND": "|| ( dev-lang/gwydion-dylan dev-lang/gwydion-dylan-bin )" },
+			"dev-lang/gwydion-dylan-bin-2.4.0": {},
+		}
+
+		test_cases = (
+			# Automatically pull in gwydion-dylan-bin to solve a circular dep
+			ResolverPlaygroundTestCase(
+				["dev-lang/gwydion-dylan"],
+				mergelist = ['dev-lang/gwydion-dylan-bin-2.4.0', 'dev-lang/gwydion-dylan-2.4.0'],
+				success = True,
+			),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds)
+		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()



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-09-22 19:07 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-09-22 19:07 UTC (permalink / raw
  To: gentoo-commits

commit:     64899b4f3bfcce72b487428d36b279454b298c88
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 22 19:06:18 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 22 19:06:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=64899b4f

Test direct virtual circular dep for bug #384107.

---
 .../tests/resolver/test_circular_choices.py        |   29 ++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_circular_choices.py b/pym/portage/tests/resolver/test_circular_choices.py
index 57f76b9..33b7306 100644
--- a/pym/portage/tests/resolver/test_circular_choices.py
+++ b/pym/portage/tests/resolver/test_circular_choices.py
@@ -30,3 +30,32 @@ class CircularChoicesTestCase(TestCase):
 				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
 		finally:
 			playground.cleanup()
+
+class VirtualCircularChoicesTestCase(TestCase):
+	def testDirectVirtualCircularDependency(self):
+
+		# Bug #384107
+		self.todo = True
+
+		ebuilds = {
+			"dev-java/icedtea-6.1.10.3": { "SLOT" : "6", "DEPEND": "virtual/jdk" },
+			"dev-java/icedtea6-bin-1.10.3": {},
+			"virtual/jdk-1.6.0": { "SLOT" : "1.6", "RDEPEND": "|| ( dev-java/icedtea6-bin =dev-java/icedtea-6* )" },
+		}
+
+		test_cases = (
+			# Automatically pull in icedtea6-bin to solve a circular dep
+			ResolverPlaygroundTestCase(
+				["dev-java/icedtea"],
+				mergelist = ["dev-java/icedtea6-bin-1.10.3", "virtual/jdk-1.6.0", "dev-java/icedtea-6.1.10.3"],
+				success = True,
+			),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds)
+		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()



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-10-02  2:14 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-10-02  2:14 UTC (permalink / raw
  To: gentoo-commits

commit:     a2ffa0af21d114935ea5acc9ad7253b74d7966ec
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  2 02:13:20 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct  2 02:13:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a2ffa0af

Add tests for KEYWORDS masking.

---
 pym/portage/tests/resolver/ResolverPlayground.py |    2 +-
 pym/portage/tests/resolver/test_keywords.py      |  356 ++++++++++++++++++++++
 2 files changed, 357 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 9630008..ec6f631 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -37,7 +37,7 @@ class ResolverPlayground(object):
 	its work.
 	"""
 
-	config_files = frozenset(("package.use", "package.mask", "package.keywords", \
+	config_files = frozenset(("package.accept_keywords", "package.use", "package.mask", "package.keywords", \
 		"package.unmask", "package.properties", "package.license", "use.mask", "use.force",
 		"layout.conf",))
 

diff --git a/pym/portage/tests/resolver/test_keywords.py b/pym/portage/tests/resolver/test_keywords.py
new file mode 100644
index 0000000..d59ea58
--- /dev/null
+++ b/pym/portage/tests/resolver/test_keywords.py
@@ -0,0 +1,356 @@
+# Copyright 2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class KeywordsTestCase(TestCase):
+
+	def testStableConfig(self):
+		# Only accept stable keywords for a particular ARCH.
+
+		user_config = {
+			'package.accept_keywords':
+				(
+					'*/* -* x86',
+				),
+		}
+
+		ebuilds = {
+			'app-misc/A-1': {'KEYWORDS': 'x86'},
+			'app-misc/B-1': {'KEYWORDS': '~x86'},
+			'app-misc/C-1': {'KEYWORDS': '*'},
+			'app-misc/D-1': {'KEYWORDS': '~*'},
+			'app-misc/E-1': {'KEYWORDS': 'arm'},
+			'app-misc/F-1': {'KEYWORDS': '~arm'},
+			'app-misc/G-1': {'KEYWORDS': ''},
+		}
+
+		test_cases = (
+
+			ResolverPlaygroundTestCase(
+				['app-misc/A'],
+				success = True,
+				mergelist = ['app-misc/A-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/B'],
+				success = False,
+				unstable_keywords = ('app-misc/B-1',),
+				mergelist = ['app-misc/B-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/C'],
+				success = True,
+				mergelist = ['app-misc/C-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/D'],
+				success = False,
+				unstable_keywords = ('app-misc/D-1',),
+				mergelist = ['app-misc/D-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/E'],
+				success = False,
+				unstable_keywords = ('app-misc/E-1',),
+				mergelist = ['app-misc/E-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/F'],
+				success = False,
+				unstable_keywords = ('app-misc/F-1',),
+				mergelist = ['app-misc/F-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/G'],
+				success = False,
+				unstable_keywords = ('app-misc/G-1',),
+				mergelist = ['app-misc/G-1']),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			user_config=user_config)
+		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()
+
+	def testAnyStableConfig(self):
+		# Accept stable keywords for any ARCH.
+
+		user_config = {
+			'package.accept_keywords':
+				(
+					'*/* -* *',
+				),
+		}
+
+		ebuilds = {
+			'app-misc/A-1': {'KEYWORDS': 'x86'},
+			'app-misc/B-1': {'KEYWORDS': '~x86'},
+			'app-misc/C-1': {'KEYWORDS': '*'},
+			'app-misc/D-1': {'KEYWORDS': '~*'},
+			'app-misc/E-1': {'KEYWORDS': 'arm'},
+			'app-misc/F-1': {'KEYWORDS': '~arm'},
+			'app-misc/G-1': {'KEYWORDS': ''},
+		}
+
+		test_cases = (
+
+			ResolverPlaygroundTestCase(
+				['app-misc/A'],
+				success = True,
+				mergelist = ['app-misc/A-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/B'],
+				success = False,
+				unstable_keywords = ('app-misc/B-1',),
+				mergelist = ['app-misc/B-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/C'],
+				success = True,
+				mergelist = ['app-misc/C-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/D'],
+				success = False,
+				unstable_keywords = ('app-misc/D-1',),
+				mergelist = ['app-misc/D-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/E'],
+				success = True,
+				mergelist = ['app-misc/E-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/F'],
+				success = False,
+				unstable_keywords = ('app-misc/F-1',),
+				mergelist = ['app-misc/F-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/G'],
+				success = False,
+				unstable_keywords = ('app-misc/G-1',),
+				mergelist = ['app-misc/G-1']),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			user_config=user_config)
+		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()
+
+	def testUnstableConfig(self):
+		# Accept stable and unstable keywords for a particular ARCH.
+
+		user_config = {
+			'package.accept_keywords':
+				(
+					'*/* -* x86 ~x86',
+				),
+		}
+
+		ebuilds = {
+			'app-misc/A-1': {'KEYWORDS': 'x86'},
+			'app-misc/B-1': {'KEYWORDS': '~x86'},
+			'app-misc/C-1': {'KEYWORDS': '*'},
+			'app-misc/D-1': {'KEYWORDS': '~*'},
+			'app-misc/E-1': {'KEYWORDS': 'arm'},
+			'app-misc/F-1': {'KEYWORDS': '~arm'},
+			'app-misc/G-1': {'KEYWORDS': ''},
+		}
+
+		test_cases = (
+
+			ResolverPlaygroundTestCase(
+				['app-misc/A'],
+				success = True,
+				mergelist = ['app-misc/A-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/B'],
+				success = True,
+				mergelist = ['app-misc/B-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/C'],
+				success = True,
+				mergelist = ['app-misc/C-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/D'],
+				success = True,
+				mergelist = ['app-misc/D-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/E'],
+				success = False,
+				unstable_keywords = ('app-misc/E-1',),
+				mergelist = ['app-misc/E-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/F'],
+				success = False,
+				unstable_keywords = ('app-misc/F-1',),
+				mergelist = ['app-misc/F-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/G'],
+				success = False,
+				unstable_keywords = ('app-misc/G-1',),
+				mergelist = ['app-misc/G-1']),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			user_config=user_config)
+		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()
+
+	def testAnyUnstableConfig(self):
+		# Accept unstable keywords for any ARCH.
+
+		user_config = {
+			'package.accept_keywords':
+				(
+					'*/* -* * ~*',
+				),
+		}
+
+		ebuilds = {
+			'app-misc/A-1': {'KEYWORDS': 'x86'},
+			'app-misc/B-1': {'KEYWORDS': '~x86'},
+			'app-misc/C-1': {'KEYWORDS': '*'},
+			'app-misc/D-1': {'KEYWORDS': '~*'},
+			'app-misc/E-1': {'KEYWORDS': 'arm'},
+			'app-misc/F-1': {'KEYWORDS': '~arm'},
+			'app-misc/G-1': {'KEYWORDS': ''},
+		}
+
+		test_cases = (
+
+			ResolverPlaygroundTestCase(
+				['app-misc/A'],
+				success = True,
+				mergelist = ['app-misc/A-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/B'],
+				success = True,
+				mergelist = ['app-misc/B-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/C'],
+				success = True,
+				mergelist = ['app-misc/C-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/D'],
+				success = True,
+				mergelist = ['app-misc/D-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/E'],
+				success = True,
+				mergelist = ['app-misc/E-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/F'],
+				success = True,
+				mergelist = ['app-misc/F-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/G'],
+				success = False,
+				unstable_keywords = ('app-misc/G-1',),
+				mergelist = ['app-misc/G-1']),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			user_config=user_config)
+		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()
+
+	def testIgnoreKeywordsConfig(self):
+		# Ignore keywords entirely (accept **)
+
+		user_config = {
+			'package.accept_keywords':
+				(
+					'*/* -* **',
+				),
+		}
+
+		ebuilds = {
+			'app-misc/A-1': {'KEYWORDS': 'x86'},
+			'app-misc/B-1': {'KEYWORDS': '~x86'},
+			'app-misc/C-1': {'KEYWORDS': '*'},
+			'app-misc/D-1': {'KEYWORDS': '~*'},
+			'app-misc/E-1': {'KEYWORDS': 'arm'},
+			'app-misc/F-1': {'KEYWORDS': '~arm'},
+			'app-misc/G-1': {'KEYWORDS': ''},
+		}
+
+		test_cases = (
+
+			ResolverPlaygroundTestCase(
+				['app-misc/A'],
+				success = True,
+				mergelist = ['app-misc/A-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/B'],
+				success = True,
+				mergelist = ['app-misc/B-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/C'],
+				success = True,
+				mergelist = ['app-misc/C-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/D'],
+				success = True,
+				mergelist = ['app-misc/D-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/E'],
+				success = True,
+				mergelist = ['app-misc/E-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/F'],
+				success = True,
+				mergelist = ['app-misc/F-1']),
+
+			ResolverPlaygroundTestCase(
+				['app-misc/G'],
+				success = True,
+				mergelist = ['app-misc/G-1']),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			user_config=user_config)
+		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()



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-11-07 21:38 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-11-07 21:38 UTC (permalink / raw
  To: gentoo-commits

commit:     8a9c4c6a84511c40b91a4dd7dcb9f80f909211de
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  7 21:38:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov  7 21:38:33 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8a9c4c6a

test_multislot: fix EAPI

---
 pym/portage/tests/resolver/test_multislot.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/tests/resolver/test_multislot.py b/pym/portage/tests/resolver/test_multislot.py
index 1331edf..cbb1bee 100644
--- a/pym/portage/tests/resolver/test_multislot.py
+++ b/pym/portage/tests/resolver/test_multislot.py
@@ -14,12 +14,12 @@ class MultSlotTestCase(TestCase):
 
 		ebuilds = {
 			"sys-devel/gcc-4.4.4": { "SLOT": "4.4" },
-			"dev-util/nvidia-cuda-toolkit-4.0" : { "RDEPEND": "sys-devel/gcc:4.4"},
+			"dev-util/nvidia-cuda-toolkit-4.0" : {"EAPI": "1", "RDEPEND": "sys-devel/gcc:4.4"},
 			}
 
 		installed = {
 			"sys-devel/gcc-4.4.4": { "SLOT": "i686-pc-linux-gnu-4.4.4" },
-			"dev-util/nvidia-cuda-toolkit-4.0" : { "RDEPEND": "sys-devel/gcc:4.4"},
+			"dev-util/nvidia-cuda-toolkit-4.0" : {"EAPI": "1", "RDEPEND": "sys-devel/gcc:4.4"},
 			}
 
 		world = (



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2011-12-11  0:22 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2011-12-11  0:22 UTC (permalink / raw
  To: gentoo-commits

commit:     2b51a74bc093e476ece19d0a2194104585e4c903
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 11 00:19:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 11 00:19:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2b51a74b

ResolverPlayground: don't nest sandbox

---
 pym/portage/tests/resolver/ResolverPlayground.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index a185855..201c5c4 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -483,6 +483,10 @@ class ResolverPlayground(object):
 			'PORTAGE_TMPDIR'       : os.path.join(self.eroot, 'var/tmp'),
 		}
 
+		if os.environ.get("SANDBOX_ON") == "1":
+			# avoid problems from nested sandbox instances
+			env["FEATURES"] = "-sandbox"
+
 		# Pass along PORTAGE_USERNAME and PORTAGE_GRPNAME since they
 		# need to be inherited by ebuild subprocesses.
 		if 'PORTAGE_USERNAME' in os.environ:



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-05-13  6:23 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-05-13  6:23 UTC (permalink / raw
  To: gentoo-commits

commit:     d7525a7e433ee77f7c94ab468ff66af4f2913684
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 13 06:23:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun May 13 06:23:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7525a7e

SimpleResolverTestCase: handle PYTHONHASHSEED

---
 pym/portage/tests/resolver/test_simple.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_simple.py b/pym/portage/tests/resolver/test_simple.py
index 0bcfc4b..4c2e97e 100644
--- a/pym/portage/tests/resolver/test_simple.py
+++ b/pym/portage/tests/resolver/test_simple.py
@@ -45,7 +45,8 @@ class SimpleResolverTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				["app-misc/Z"],
 				success = True,
-				mergelist = ["app-misc/W-1", "app-misc/X-1", "app-misc/Z-1"]),
+				ambiguous_merge_order = True,
+				mergelist = [("app-misc/W-1", "app-misc/X-1"), "app-misc/Z-1"]),
 			)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-06-14  0:24 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-06-14  0:24 UTC (permalink / raw
  To: gentoo-commits

commit:     d1a7dc427d000f5b5e85d5dc5cfa449346bdd7d4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 14 00:23:54 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 14 00:23:54 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d1a7dc42

test_autounmask: add case for bug #420847

---
 pym/portage/tests/resolver/test_autounmask.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_autounmask.py b/pym/portage/tests/resolver/test_autounmask.py
index 46dbab1..c75a174 100644
--- a/pym/portage/tests/resolver/test_autounmask.py
+++ b/pym/portage/tests/resolver/test_autounmask.py
@@ -285,6 +285,9 @@ class AutounmaskTestCase(TestCase):
 			"dev-libs/E-1": { "LICENSE": "TEST" },
 			"dev-libs/E-2": { "LICENSE": "TEST" },
 			"dev-libs/F-1": { "DEPEND": "=dev-libs/E-1", "LICENSE": "TEST" },
+
+			"dev-java/sun-jdk-1.6.0.32": { "LICENSE": "TEST", "KEYWORDS": "~x86" },
+			"dev-java/sun-jdk-1.6.0.31": { "LICENSE": "TEST", "KEYWORDS": "x86" },
 			}
 
 		test_cases = (
@@ -316,6 +319,14 @@ class AutounmaskTestCase(TestCase):
 					success = False,
 					mergelist = ["dev-libs/E-1", "dev-libs/F-1", "dev-libs/D-1"],
 					license_changes = { "dev-libs/D-1": set(["TEST"]), "dev-libs/E-1": set(["TEST"]), "dev-libs/E-2": set(["TEST"]), "dev-libs/F-1": set(["TEST"]) }),
+
+				#Test license only for bug #420847
+				#ResolverPlaygroundTestCase(
+					#["dev-java/sun-jdk"],
+					#options = {"--autounmask": True},
+					#success = False,
+					#mergelist = ["dev-java/sun-jdk-1.6.0.31"],
+					#license_changes = { "dev-java/sun-jdk-1.6.0.31": set(["TEST"]) }),
 			)
 
 		playground = ResolverPlayground(ebuilds=ebuilds)



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-06-20  9:53 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-06-20  9:53 UTC (permalink / raw
  To: gentoo-commits

commit:     58077c76a911a3ab5bdea0a30a3bd192faaf12e0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 20 09:51:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 09:51:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=58077c76

ResolverPlayground: distinguish binpkg merge

---
 pym/portage/tests/resolver/ResolverPlayground.py |   17 +++++++++++------
 pym/portage/tests/resolver/test_simple.py        |    4 ++--
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 1e2d64d..8c806c7 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -215,6 +215,7 @@ class ResolverPlayground(object):
 			metadata = metadata.copy()
 			metadata.setdefault("SLOT", "0")
 			metadata.setdefault("KEYWORDS", "x86")
+			metadata.setdefault("BUILD_TIME", "0")
 			metadata["CATEGORY"] = cat
 			metadata["PF"] = pf
 
@@ -243,6 +244,7 @@ class ResolverPlayground(object):
 			lic = metadata.pop("LICENSE", "")
 			properties = metadata.pop("PROPERTIES", "")
 			slot = metadata.pop("SLOT", 0)
+			build_time = metadata.pop("BUILD_TIME", "0")
 			keywords = metadata.pop("KEYWORDS", "~x86")
 			iuse = metadata.pop("IUSE", "")
 			use = metadata.pop("USE", "")
@@ -261,6 +263,7 @@ class ResolverPlayground(object):
 				f.close()
 			
 			write_key("EAPI", eapi)
+			write_key("BUILD_TIME", build_time)
 			write_key("COUNTER", "0")
 			write_key("LICENSE", lic)
 			write_key("PROPERTIES", properties)
@@ -622,8 +625,7 @@ class ResolverPlaygroundTestCase(object):
 							if cpv[:1] == "!":
 								new_got.append(cpv)
 								continue
-							a = Atom("="+cpv, allow_repo=True)
-							new_got.append(a.cpv)
+							new_got.append(cpv.split(_repo_separator)[0])
 						got = new_got
 					if expected:
 						new_expected = []
@@ -632,13 +634,13 @@ class ResolverPlaygroundTestCase(object):
 								if obj[:1] == "!":
 									new_expected.append(obj)
 									continue
-								a = Atom("="+obj, allow_repo=True)
-								new_expected.append(a.cpv)
+								new_expected.append(
+									obj.split(_repo_separator)[0])
 								continue
 							new_expected.append(set())
 							for cpv in obj:
 								if cpv[:1] != "!":
-									cpv = Atom("="+cpv, allow_repo=True).cpv
+									cpv = cpv.split(_repo_separator)[0]
 								new_expected[-1].add(cpv)
 						expected = new_expected
 				if self.ignore_mergelist_order and got is not None:
@@ -743,7 +745,10 @@ class ResolverPlaygroundResult(object):
 					repo_str = ""
 					if x.metadata["repository"] != "test_repo":
 						repo_str = _repo_separator + x.metadata["repository"]
-					self.mergelist.append(x.cpv + repo_str)
+					mergelist_str = x.cpv + repo_str
+					if x.type_name == "binary":
+						mergelist_str = "[binary]" + mergelist_str
+					self.mergelist.append(mergelist_str)
 
 		if self.depgraph._dynamic_config._needed_use_config_changes:
 			self.use_changes = {}

diff --git a/pym/portage/tests/resolver/test_simple.py b/pym/portage/tests/resolver/test_simple.py
index 62a5892..324ffa2 100644
--- a/pym/portage/tests/resolver/test_simple.py
+++ b/pym/portage/tests/resolver/test_simple.py
@@ -49,13 +49,13 @@ class SimpleResolverTestCase(TestCase):
 				["dev-libs/B"],
 				options = {"--update": True, "--usepkg": True},
 				success = True,
-				mergelist = ["dev-libs/B-1.2"]),
+				mergelist = ["[binary]dev-libs/B-1.2"]),
 
 			ResolverPlaygroundTestCase(
 				["dev-libs/B"],
 				options = {"--update": True, "--usepkgonly": True},
 				success = True,
-				mergelist = ["dev-libs/B-1.2"]),
+				mergelist = ["[binary]dev-libs/B-1.2"]),
 
 			ResolverPlaygroundTestCase(
 				["app-misc/Z"],



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-06-20 10:06 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-06-20 10:06 UTC (permalink / raw
  To: gentoo-commits

commit:     fd66f626a5047972439c7aabcb57a7383b0f03cb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 20 10:05:26 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 10:05:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fd66f626

ResolverPlayground: distinguish uninstall merge

---
 pym/portage/tests/resolver/ResolverPlayground.py |    8 ++++++--
 pym/portage/tests/resolver/test_merge_order.py   |    6 +++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 8c806c7..0476ed4 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -746,8 +746,12 @@ class ResolverPlaygroundResult(object):
 					if x.metadata["repository"] != "test_repo":
 						repo_str = _repo_separator + x.metadata["repository"]
 					mergelist_str = x.cpv + repo_str
-					if x.type_name == "binary":
-						mergelist_str = "[binary]" + mergelist_str
+					if x.built:
+						if x.operation == "merge":
+							desc = x.type_name
+						else:
+							desc = x.operation
+						mergelist_str = "[%s]%s" % (desc, mergelist_str)
 					self.mergelist.append(mergelist_str)
 
 		if self.depgraph._dynamic_config._needed_use_config_changes:

diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py
index adff84d..5b5709a 100644
--- a/pym/portage/tests/resolver/test_merge_order.py
+++ b/pym/portage/tests/resolver/test_merge_order.py
@@ -376,7 +376,7 @@ class MergeOrderTestCase(TestCase):
 				success = True,
 				all_permutations = True,
 				ambiguous_merge_order = True,
-				mergelist = [("app-misc/blocker-runtime-a-1", "app-misc/blocker-runtime-b-1"), "app-misc/installed-blocker-a-1", ("!app-misc/blocker-runtime-a", "!app-misc/blocker-runtime-b")]),
+				mergelist = [("app-misc/blocker-runtime-a-1", "app-misc/blocker-runtime-b-1"), "[uninstall]app-misc/installed-blocker-a-1", ("!app-misc/blocker-runtime-a", "!app-misc/blocker-runtime-b")]),
 			# We have a soft buildtime blocker against an installed
 			# package that should cause it to be uninstalled. Note that with
 			# soft blockers, the blocking packages are allowed to temporarily
@@ -386,7 +386,7 @@ class MergeOrderTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				["app-misc/blocker-buildtime-unbuilt-a"],
 				success = True,
-				mergelist = ["app-misc/blocker-buildtime-unbuilt-a-1", "app-misc/installed-blocker-a-1", "!app-misc/installed-blocker-a"]),
+				mergelist = ["app-misc/blocker-buildtime-unbuilt-a-1", "[uninstall]app-misc/installed-blocker-a-1", "!app-misc/installed-blocker-a"]),
 			# We have a hard buildtime blocker against an installed
 			# package that will not resolve automatically (unless
 			# the option requested in bug 250286 is implemented).
@@ -409,7 +409,7 @@ class MergeOrderTestCase(TestCase):
 			ResolverPlaygroundTestCase(
 				["media-video/libav"],
 				success=True,
-				mergelist = ['media-video/libav-0.7_pre20110327', 'media-video/ffmpeg-0.7_rc1', '!media-video/ffmpeg']),
+				mergelist = ['media-video/libav-0.7_pre20110327', '[uninstall]media-video/ffmpeg-0.7_rc1', '!media-video/ffmpeg']),
 			# Test that OS_HEADERS_PACKAGE_ATOM and LIBC_PACKAGE_ATOM
 			# are merged asap, in order to account for implicit
 			# dependencies. See bug #303567. Optimally, satisfied deps



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-06-21 22:32 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-06-21 22:32 UTC (permalink / raw
  To: gentoo-commits

commit:     330663fa23dc8da228789c984e442430d90035a0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 21 22:32:16 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 21 22:32:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=330663fa

ResolverPlayground: fix repo for binpkgs

---
 pym/portage/tests/resolver/ResolverPlayground.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 0476ed4..e65f9f8 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -216,6 +216,7 @@ class ResolverPlayground(object):
 			metadata.setdefault("SLOT", "0")
 			metadata.setdefault("KEYWORDS", "x86")
 			metadata.setdefault("BUILD_TIME", "0")
+			metadata["repository"] = repo
 			metadata["CATEGORY"] = cat
 			metadata["PF"] = pf
 



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-06-23 21:53 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-06-23 21:53 UTC (permalink / raw
  To: gentoo-commits

commit:     7216350dc54b891d1909ffa7d9fceb52f1de04a7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 23 21:53:13 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 23 21:53:13 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7216350d

test_slot_abi: fix atom == type

---
 pym/portage/tests/resolver/test_slot_abi.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_slot_abi.py b/pym/portage/tests/resolver/test_slot_abi.py
index 4693834..6381bcc 100644
--- a/pym/portage/tests/resolver/test_slot_abi.py
+++ b/pym/portage/tests/resolver/test_slot_abi.py
@@ -152,7 +152,7 @@ class SlotAbiTestCase(TestCase):
 			"app-office/libreoffice-3.5.4.2" : {
 				"EAPI": "4-slot-abi",
 				"DEPEND":  ">=sys-libs/db-4:4.7/4.7=",
-				"RDEPEND": ">=sys-libs/db-4:4.7/4.7=="
+				"RDEPEND": ">=sys-libs/db-4:4.7/4.7="
 			},
 		}
 		installed = {



^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-09-25  3:30 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-09-25  3:30 UTC (permalink / raw
  To: gentoo-commits

commit:     673be9159fcc94da719496f6b2049548efeeb1db
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 25 03:30:05 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 25 03:30:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=673be915

ResolverPlayground: simplify vdb/portdb creation

This enables automatic handling of HDEPEND.

---
 pym/portage/tests/resolver/ResolverPlayground.py |  112 ++++++---------------
 1 files changed, 32 insertions(+), 80 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 3bda607..c7c9be9 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -132,24 +132,18 @@ class ResolverPlayground(object):
 
 			metadata = ebuilds[cpv].copy()
 			copyright_header = metadata.pop("COPYRIGHT_HEADER", None)
-			desc = metadata.pop("DESCRIPTION", None)
-			eapi = metadata.pop("EAPI", 0)
-			lic = metadata.pop("LICENSE", "")
-			properties = metadata.pop("PROPERTIES", "")
-			slot = metadata.pop("SLOT", 0)
-			keywords = metadata.pop("KEYWORDS", "x86")
-			homepage = metadata.pop("HOMEPAGE", None)
-			src_uri = metadata.pop("SRC_URI", None)
-			iuse = metadata.pop("IUSE", "")
-			provide = metadata.pop("PROVIDE", None)
-			depend = metadata.pop("DEPEND", "")
-			rdepend = metadata.pop("RDEPEND", None)
-			pdepend = metadata.pop("PDEPEND", None)
-			required_use = metadata.pop("REQUIRED_USE", None)
+			eapi = metadata.pop("EAPI", "0")
 			misc_content = metadata.pop("MISC_CONTENT", None)
+			metadata.setdefault("DEPEND", "")
+			metadata.setdefault("SLOT", "0")
+			metadata.setdefault("KEYWORDS", "x86")
+			metadata.setdefault("IUSE", "")
 
-			if metadata:
-				raise ValueError("metadata of ebuild '%s' contains unknown keys: %s" % (cpv, metadata.keys()))
+			unknown_keys = set(metadata).difference(
+				portage.dbapi.dbapi._known_keys)
+			if unknown_keys:
+				raise ValueError("metadata of ebuild '%s' contains unknown keys: %s" %
+					(cpv, sorted(unknown_keys)))
 
 			repo_dir = self._get_repo_dir(repo)
 			ebuild_dir = os.path.join(repo_dir, a.cp)
@@ -162,27 +156,9 @@ class ResolverPlayground(object):
 			f = open(ebuild_path, "w")
 			if copyright_header is not None:
 				f.write(copyright_header)
-			f.write('EAPI="' + str(eapi) + '"\n')
-			if desc is not None:
-				f.write('DESCRIPTION="%s"\n' % desc)
-			if homepage is not None:
-				f.write('HOMEPAGE="%s"\n' % homepage)
-			if src_uri is not None:
-				f.write('SRC_URI="%s"\n' % src_uri)
-			f.write('LICENSE="' + str(lic) + '"\n')
-			f.write('PROPERTIES="' + str(properties) + '"\n')
-			f.write('SLOT="' + str(slot) + '"\n')
-			f.write('KEYWORDS="' + str(keywords) + '"\n')
-			f.write('IUSE="' + str(iuse) + '"\n')
-			if provide is not None:
-				f.write('PROVIDE="%s"\n' % provide)
-			f.write('DEPEND="' + str(depend) + '"\n')
-			if rdepend is not None:
-				f.write('RDEPEND="' + str(rdepend) + '"\n')
-			if pdepend is not None:
-				f.write('PDEPEND="' + str(pdepend) + '"\n')
-			if required_use is not None:
-				f.write('REQUIRED_USE="' + str(required_use) + '"\n')
+			f.write('EAPI="%s"\n' % eapi)
+			for k, v in metadata.items():
+				f.write('%s="%s"\n' % (k, v))
 			if misc_content is not None:
 				f.write(misc_content)
 			f.close()
@@ -242,49 +218,25 @@ class ResolverPlayground(object):
 				pass
 
 			metadata = installed[cpv].copy()
-			eapi = metadata.pop("EAPI", 0)
-			lic = metadata.pop("LICENSE", "")
-			properties = metadata.pop("PROPERTIES", "")
-			slot = metadata.pop("SLOT", 0)
-			build_time = metadata.pop("BUILD_TIME", "0")
-			keywords = metadata.pop("KEYWORDS", "~x86")
-			iuse = metadata.pop("IUSE", "")
-			use = metadata.pop("USE", "")
-			provide = metadata.pop("PROVIDE", None)
-			depend = metadata.pop("DEPEND", "")
-			rdepend = metadata.pop("RDEPEND", None)
-			pdepend = metadata.pop("PDEPEND", None)
-			required_use = metadata.pop("REQUIRED_USE", None)
-
-			if metadata:
-				raise ValueError("metadata of installed '%s' contains unknown keys: %s" % (cpv, metadata.keys()))
-
-			def write_key(key, value):
-				f = open(os.path.join(vdb_pkg_dir, key), "w")
-				f.write(str(value) + "\n")
-				f.close()
-			
-			write_key("EAPI", eapi)
-			write_key("BUILD_TIME", build_time)
-			write_key("COUNTER", "0")
-			write_key("LICENSE", lic)
-			write_key("PROPERTIES", properties)
-			write_key("SLOT", slot)
-			write_key("LICENSE", lic)
-			write_key("PROPERTIES", properties)
-			write_key("repository", repo)
-			write_key("KEYWORDS", keywords)
-			write_key("IUSE", iuse)
-			write_key("USE", use)
-			if provide is not None:
-				write_key("PROVIDE", provide)
-			write_key("DEPEND", depend)
-			if rdepend is not None:
-				write_key("RDEPEND", rdepend)
-			if pdepend is not None:
-				write_key("PDEPEND", pdepend)
-			if required_use is not None:
-				write_key("REQUIRED_USE", required_use)
+			metadata.setdefault("SLOT", "0")
+			metadata.setdefault("BUILD_TIME", "0")
+			metadata.setdefault("COUNTER", "0")
+			metadata.setdefault("KEYWORDS", "~x86")
+
+			unknown_keys = set(metadata).difference(
+				portage.dbapi.dbapi._known_keys)
+			unknown_keys.discard("BUILD_TIME")
+			unknown_keys.discard("COUNTER")
+			unknown_keys.discard("repository")
+			unknown_keys.discard("USE")
+			if unknown_keys:
+				raise ValueError("metadata of installed '%s' contains unknown keys: %s" %
+					(cpv, sorted(unknown_keys)))
+
+			metadata["repository"] = repo
+			for k, v in metadata.items():
+				with open(os.path.join(vdb_pkg_dir, k), "w") as f:
+					f.write("%s\n" % v)
 
 	def _create_profile(self, ebuilds, installed, profile, repo_configs, user_config, sets):
 


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-09-26  0:52 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-09-26  0:52 UTC (permalink / raw
  To: gentoo-commits

commit:     15a7519049e47f726a37f985b7c4a559b47dae16
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 00:52:08 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 00:52:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=15a75190

ResolverPlayground: check targetroot in mergelist

---
 pym/portage/tests/resolver/ResolverPlayground.py |    3 +++
 pym/portage/tests/resolver/test_targetroot.py    |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index a63d285..62aafb5 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -707,6 +707,7 @@ class ResolverPlaygroundResult(object):
 
 		if self.depgraph._dynamic_config._serialized_tasks_cache is not None:
 			self.mergelist = []
+			host_root = self.depgraph._frozen_config._running_root.root
 			for x in self.depgraph._dynamic_config._serialized_tasks_cache:
 				if isinstance(x, Blocker):
 					self.mergelist.append(x.atom)
@@ -721,6 +722,8 @@ class ResolverPlaygroundResult(object):
 						else:
 							desc = x.operation
 						mergelist_str = "[%s]%s" % (desc, mergelist_str)
+					if x.root != host_root:
+						mergelist_str += "{targetroot}"
 					self.mergelist.append(mergelist_str)
 
 		if self.depgraph._dynamic_config._needed_use_config_changes:

diff --git a/pym/portage/tests/resolver/test_targetroot.py b/pym/portage/tests/resolver/test_targetroot.py
index ef07a76..a79d231 100644
--- a/pym/portage/tests/resolver/test_targetroot.py
+++ b/pym/portage/tests/resolver/test_targetroot.py
@@ -20,7 +20,7 @@ class TargetRootTestCase(TestCase):
 				["dev-lang/python"],
 				options = {},
 				success = True,
-				mergelist = ["dev-lang/python-3.2", "dev-lang/python-3.2"]),
+				mergelist = ["dev-lang/python-3.2", "dev-lang/python-3.2{targetroot}"]),
 		)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, targetroot=True,


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-09-26  2:36 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-09-26  2:36 UTC (permalink / raw
  To: gentoo-commits

commit:     f337eed16b0f9995f6efd825a84a14f34b87adeb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 02:36:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 02:36:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f337eed1

Test emerge --root-deps.

---
 pym/portage/tests/resolver/test_targetroot.py |   32 ++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_targetroot.py b/pym/portage/tests/resolver/test_targetroot.py
index a79d231..118e6ce 100644
--- a/pym/portage/tests/resolver/test_targetroot.py
+++ b/pym/portage/tests/resolver/test_targetroot.py
@@ -12,7 +12,14 @@ class TargetRootTestCase(TestCase):
 				"EAPI": "5-hdepend",
 				"IUSE": "targetroot",
 				"HDEPEND": "targetroot? ( ~dev-lang/python-3.2 )",
-			}, 
+			},
+			"dev-libs/A-1": {
+				"EAPI": "4",
+				"DEPEND": "dev-libs/B",
+				"RDEPEND": "dev-libs/C",
+			},
+			"dev-libs/B-1": {},
+			"dev-libs/C-1": {},
 		}
 
 		test_cases = (
@@ -21,6 +28,29 @@ class TargetRootTestCase(TestCase):
 				options = {},
 				success = True,
 				mergelist = ["dev-lang/python-3.2", "dev-lang/python-3.2{targetroot}"]),
+			ResolverPlaygroundTestCase(
+				["dev-lang/python"],
+				options = {"--root-deps": True},
+				success = True,
+				mergelist = ["dev-lang/python-3.2", "dev-lang/python-3.2{targetroot}"]),
+			ResolverPlaygroundTestCase(
+				["dev-libs/A"],
+				options = {},
+				ambiguous_merge_order = True,
+				success = True,
+				mergelist = [("dev-libs/B-1", "dev-libs/C-1{targetroot}"), "dev-libs/A-1{targetroot}"]),
+			ResolverPlaygroundTestCase(
+				["dev-libs/A"],
+				options = {"--root-deps": True},
+				ambiguous_merge_order = True,
+				success = True,
+				mergelist = [("dev-libs/B-1{targetroot}", "dev-libs/C-1{targetroot}"), "dev-libs/A-1{targetroot}"]),
+			ResolverPlaygroundTestCase(
+				["dev-libs/A"],
+				options = {"--root-deps": "rdeps"},
+				ambiguous_merge_order = True,
+				success = True,
+				mergelist = [("dev-libs/C-1{targetroot}"), "dev-libs/A-1{targetroot}"]),
 		)
 
 		playground = ResolverPlayground(ebuilds=ebuilds, targetroot=True,


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-09-26  2:38 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-09-26  2:38 UTC (permalink / raw
  To: gentoo-commits

commit:     356b518fd996e4fd4719e9d350078326eb64c0d9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 02:38:38 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 02:38:38 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=356b518f

Test emerge --root-deps more.

---
 pym/portage/tests/resolver/test_targetroot.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_targetroot.py b/pym/portage/tests/resolver/test_targetroot.py
index 118e6ce..db6c60d 100644
--- a/pym/portage/tests/resolver/test_targetroot.py
+++ b/pym/portage/tests/resolver/test_targetroot.py
@@ -34,6 +34,11 @@ class TargetRootTestCase(TestCase):
 				success = True,
 				mergelist = ["dev-lang/python-3.2", "dev-lang/python-3.2{targetroot}"]),
 			ResolverPlaygroundTestCase(
+				["dev-lang/python"],
+				options = {"--root-deps": "rdeps"},
+				success = True,
+				mergelist = ["dev-lang/python-3.2", "dev-lang/python-3.2{targetroot}"]),
+			ResolverPlaygroundTestCase(
 				["dev-libs/A"],
 				options = {},
 				ambiguous_merge_order = True,


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-10-26  3:44 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-10-26  3:44 UTC (permalink / raw
  To: gentoo-commits

commit:     9fead7ac9b4d819bdbe4321c78e325dced7c51a8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 26 03:44:28 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 26 03:44:28 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9fead7ac

Add test case for bug #439694.

---
 .../resolver/test_slot_operator_unsatisfied.py     |   67 ++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_slot_operator_unsatisfied.py b/pym/portage/tests/resolver/test_slot_operator_unsatisfied.py
new file mode 100644
index 0000000..fe8893f
--- /dev/null
+++ b/pym/portage/tests/resolver/test_slot_operator_unsatisfied.py
@@ -0,0 +1,67 @@
+# Copyright 2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class SlotOperatorUnsatisfiedTestCase(TestCase):
+
+	def testSlotOperatorUnsatisfied(self):
+
+		ebuilds = {
+			"app-misc/A-1" : {
+				"EAPI": "5",
+				"SLOT": "0/1"
+			},
+			"app-misc/A-2" : {
+				"EAPI": "5",
+				"SLOT": "0/2"
+			},
+			"app-misc/B-0" : {
+				"EAPI": "5",
+				"DEPEND": "app-misc/A:=",
+				"RDEPEND": "app-misc/A:="
+			},
+		}
+
+		installed = {
+			"app-misc/A-2" : {
+				"EAPI": "5",
+				"SLOT": "0/2"
+			},
+
+			"app-misc/B-0" : {
+				"EAPI": "5",
+				"DEPEND": "app-misc/A:0/1=",
+				"RDEPEND": "app-misc/A:0/1="
+			},
+		}
+
+		world = ["app-misc/B"]
+
+		test_cases = (
+
+			# Demonstrate bug #439694, where a broken slot-operator
+			# sub-slot dependency fails to be recognized.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success = True,
+				mergelist = []),
+
+			ResolverPlaygroundTestCase(
+				["app-misc/A"],
+				options = {"--oneshot": True},
+				success = True,
+				mergelist = ["app-misc/A-2"]),
+		)
+
+		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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-10-26  6:31 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-10-26  6:31 UTC (permalink / raw
  To: gentoo-commits

commit:     287636c98ca6841601372d32fb7c66ffdad9eaae
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 26 06:31:36 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 26 06:31:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=287636c9

Add test case for bug #439688.

---
 .../tests/resolver/test_slot_conflict_rebuild.py   |   80 ++++++++++++++++++++
 1 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
new file mode 100644
index 0000000..e255e2a
--- /dev/null
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -0,0 +1,80 @@
+# Copyright 2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class SlotConflictRebuildTestCase(TestCase):
+
+	def testSlotConflictRebuild(self):
+
+		ebuilds = {
+
+			"app-misc/A-1" : {
+				"EAPI": "5",
+				"SLOT": "0/1"
+			},
+
+			"app-misc/A-2" : {
+				"EAPI": "5",
+				"SLOT": "0/2"
+			},
+
+			"app-misc/B-0" : {
+				"EAPI": "5",
+				"DEPEND": "app-misc/A:=",
+				"RDEPEND": "app-misc/A:="
+			},
+
+			"app-misc/C-0" : {
+				"EAPI": "5",
+				"DEPEND": "<app-misc/A-2",
+				"RDEPEND": "<app-misc/A-2"
+			},
+
+		}
+
+		installed = {
+
+			"app-misc/A-1" : {
+				"EAPI": "5",
+				"SLOT": "0/1"
+			},
+
+			"app-misc/B-0" : {
+				"EAPI": "5",
+				"DEPEND": "app-misc/A:0/1=",
+				"RDEPEND": "app-misc/A:0/1="
+			},
+
+			"app-misc/C-0" : {
+				"EAPI": "5",
+				"DEPEND": "<app-misc/A-2",
+				"RDEPEND": "<app-misc/A-2"
+			},
+
+		}
+
+		world = ["app-misc/B", "app-misc/C"]
+
+		test_cases = (
+
+			# Demonstrate bug #439688, where a slot conflict prevents
+			# an upgrade and triggers unnecessary rebuilds.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success = True,
+				mergelist = ["app-misc/A-1", "app-misc/B-0"]),
+
+		)
+
+		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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2012-10-26 17:25 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2012-10-26 17:25 UTC (permalink / raw
  To: gentoo-commits

commit:     94cfbc7023f89905f03e9f87563133fa2530c30e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 26 17:24:37 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 26 17:24:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=94cfbc70

test_slot_conflict_rebuild: add a valid rebuild

---
 .../tests/resolver/test_slot_conflict_rebuild.py   |   31 ++++++++++++++++++-
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
index 5ce2329..3cd86bd 100644
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -33,6 +33,22 @@ class SlotConflictRebuildTestCase(TestCase):
 				"RDEPEND": "<app-misc/A-2"
 			},
 
+			"app-misc/D-1" : {
+				"EAPI": "5",
+				"SLOT": "0/1"
+			},
+
+			"app-misc/D-2" : {
+				"EAPI": "5",
+				"SLOT": "0/2"
+			},
+
+			"app-misc/E-0" : {
+				"EAPI": "5",
+				"DEPEND": "app-misc/D:=",
+				"RDEPEND": "app-misc/D:="
+			},
+
 		}
 
 		installed = {
@@ -54,9 +70,20 @@ class SlotConflictRebuildTestCase(TestCase):
 				"RDEPEND": "<app-misc/A-2"
 			},
 
+			"app-misc/D-1" : {
+				"EAPI": "5",
+				"SLOT": "0/1"
+			},
+
+			"app-misc/E-0" : {
+				"EAPI": "5",
+				"DEPEND": "app-misc/D:0/1=",
+				"RDEPEND": "app-misc/D:0/1="
+			},
+
 		}
 
-		world = ["app-misc/B", "app-misc/C"]
+		world = ["app-misc/B", "app-misc/C", "app-misc/E"]
 
 		test_cases = (
 
@@ -66,7 +93,7 @@ class SlotConflictRebuildTestCase(TestCase):
 				["@world"],
 				options = {"--update": True, "--deep": True},
 				success = True,
-				mergelist = []),
+				mergelist = ["app-misc/D-2", "app-misc/E-0"]),
 
 		)
 


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-02-12  1:36 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2013-02-12  1:36 UTC (permalink / raw
  To: gentoo-commits

commit:     a1fc6a8b692ea76a118b298a868d4811c4793628
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 01:35:48 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 12 01:35:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a1fc6a8b

Add test case for bug #456340.

The problem here results from poor handling of the unsatisfied built
slot operator dep inside _add_dep, where it aborts the graph and tries
to backtrack immediately. We really want it to queue a rebuild here,
and continue filling out the graph.

---
 .../tests/resolver/test_slot_operator_unsolved.py  |   73 ++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_slot_operator_unsolved.py b/pym/portage/tests/resolver/test_slot_operator_unsolved.py
new file mode 100644
index 0000000..a496252
--- /dev/null
+++ b/pym/portage/tests/resolver/test_slot_operator_unsolved.py
@@ -0,0 +1,73 @@
+# Copyright 2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class SlotOperatorUnsolvedTestCase(TestCase):
+	"""
+	Demonstrate bug #456340, where an unsolved circular dependency
+	interacts with an unsatisfied built slot-operator dep.
+
+	The problem here results from poor handling of the unsatisfied built
+	slot operator dep inside _add_dep, where it aborts the graph and tries
+	to backtrack immediately. We really want it to queue a rebuild here,
+	and continue filling out the graph.
+	"""
+	def __init__(self, *args, **kwargs):
+		super(SlotOperatorUnsolvedTestCase, self).__init__(*args, **kwargs)
+
+	def testSlotOperatorUnsolved(self):
+		ebuilds = {
+			"dev-libs/icu-50.1.2" : {
+				"EAPI": "5",
+				"SLOT": "0/50.1.2"
+			},
+			"net-libs/webkit-gtk-1.10.2-r300" : {
+				"EAPI": "5",
+				"DEPEND":  ">=dev-libs/icu-3.8.1-r1:=",
+				"RDEPEND": ">=dev-libs/icu-3.8.1-r1:="
+			},
+			"dev-ruby/rdoc-3.12.1" : {
+				"EAPI": "5",
+				"DEPEND": ">=dev-ruby/hoe-2.7.0",
+			},
+			"dev-ruby/hoe-2.13.0" : {
+				"EAPI": "5",
+				"DEPEND": ">=dev-ruby/rdoc-3.10",
+				"RDEPEND": ">=dev-ruby/rdoc-3.10",
+			},
+		}
+
+		installed = {
+			"dev-libs/icu-50.1.2" : {
+				"EAPI": "5",
+				"SLOT": "0/50.1.2"
+			},
+			"net-libs/webkit-gtk-1.10.2-r300" : {
+				"EAPI": "5",
+				"DEPEND":  ">=dev-libs/icu-3.8.1-r1:0/50=",
+				"RDEPEND": ">=dev-libs/icu-3.8.1-r1:0/50="
+			},
+		}
+
+		world = ["net-libs/webkit-gtk", "dev-ruby/hoe"]
+
+		test_cases = (
+
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success = False),
+
+		)
+
+		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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-02-12  3:03 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2013-02-12  3:03 UTC (permalink / raw
  To: gentoo-commits

commit:     8d53cd7227f6e0187a743b617746168ed28e895e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 12 03:03:16 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 12 03:03:16 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8d53cd72

SlotOperatorUnsolvedTestCase: add unwanted binpkg

---
 .../tests/resolver/test_slot_operator_unsolved.py  |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/pym/portage/tests/resolver/test_slot_operator_unsolved.py b/pym/portage/tests/resolver/test_slot_operator_unsolved.py
index 7ae3d9e..c19783d 100644
--- a/pym/portage/tests/resolver/test_slot_operator_unsolved.py
+++ b/pym/portage/tests/resolver/test_slot_operator_unsolved.py
@@ -37,6 +37,14 @@ class SlotOperatorUnsolvedTestCase(TestCase):
 			},
 		}
 
+		binpkgs = {
+			"net-libs/webkit-gtk-1.10.2-r300" : {
+				"EAPI": "5",
+				"DEPEND":  ">=dev-libs/icu-3.8.1-r1:0/50=",
+				"RDEPEND": ">=dev-libs/icu-3.8.1-r1:0/50="
+			},
+		}
+
 		installed = {
 			"dev-libs/icu-50.1.2" : {
 				"EAPI": "5",
@@ -59,7 +67,7 @@ class SlotOperatorUnsolvedTestCase(TestCase):
 
 			ResolverPlaygroundTestCase(
 				["@world"],
-				options = {"--update": True, "--deep": True},
+				options = {"--update": True, "--deep": True, "--usepkg": True},
 				circular_dependency_solutions = {
 					'dev-ruby/hoe-2.13.0': frozenset([frozenset([('test', False)])]),
 					'dev-ruby/rdoc-3.12.1': frozenset([frozenset([('test', False)])])
@@ -69,7 +77,7 @@ class SlotOperatorUnsolvedTestCase(TestCase):
 
 		)
 
-		playground = ResolverPlayground(ebuilds=ebuilds,
+		playground = ResolverPlayground(ebuilds=ebuilds, binpkgs=binpkgs,
 			installed=installed, user_config=user_config,
 			world=world, debug=False)
 		try:


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-02-14  1:20 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2013-02-14  1:20 UTC (permalink / raw
  To: gentoo-commits

commit:     e76fd172b7ececb7913343cb860244e899f826a7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 14 01:20:34 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 14 01:20:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e76fd172

--complete-graph-if-new-ver: test slot change

---
 ...test_complete_if_new_subslot_without_revbump.py |   74 ++++++++++++++++++++
 1 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/pym/portage/tests/resolver/test_complete_if_new_subslot_without_revbump.py b/pym/portage/tests/resolver/test_complete_if_new_subslot_without_revbump.py
new file mode 100644
index 0000000..fddbead
--- /dev/null
+++ b/pym/portage/tests/resolver/test_complete_if_new_subslot_without_revbump.py
@@ -0,0 +1,74 @@
+# Copyright 2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class CompeteIfNewSubSlotWithoutRevBumpTestCase(TestCase):
+
+	def testCompeteIfNewSubSlotWithoutRevBump(self):
+
+		ebuilds = {
+			"media-libs/libpng-1.5.14" : {
+				"EAPI": "5",
+				"SLOT": "0"
+			},
+
+			"x11-libs/gdk-pixbuf-2.26.5" : {
+				"EAPI": "5",
+				"DEPEND": ">=media-libs/libpng-1.4:=",
+				"RDEPEND": ">=media-libs/libpng-1.4:="
+			},
+		}
+
+		binpkgs = {
+			"x11-libs/gdk-pixbuf-2.26.5" : {
+				"EAPI": "5",
+				"DEPEND": ">=media-libs/libpng-1.4:0/15=",
+				"RDEPEND": ">=media-libs/libpng-1.4:0/15="
+			},
+		}
+
+		installed = {
+			"media-libs/libpng-1.5.14" : {
+				"EAPI": "5",
+				"SLOT": "0/15"
+			},
+
+			"x11-libs/gdk-pixbuf-2.26.5" : {
+				"EAPI": "5",
+				"DEPEND": ">=media-libs/libpng-1.4:0/15=",
+				"RDEPEND": ">=media-libs/libpng-1.4:0/15="
+			},
+		}
+
+		world = ["x11-libs/gdk-pixbuf"]
+
+		test_cases = (
+			# Test that --complete-graph-if-new-ver=y triggers rebuild
+			# when the sub-slot changes without a revbump.
+			ResolverPlaygroundTestCase(
+				["media-libs/libpng"],
+				options = {
+					"--oneshot": True,
+					"--complete-graph-if-new-ver": "y",
+					"--rebuild-if-new-slot": "n",
+					"--usepkg": True
+				},
+				success = True,
+				mergelist = [
+					"media-libs/libpng-1.5.14",
+					"x11-libs/gdk-pixbuf-2.26.5"
+				]
+			),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds, binpkgs=binpkgs,
+			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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-03-04 23:37 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2013-03-04 23:37 UTC (permalink / raw
  To: gentoo-commits

commit:     35b380891f4d142e77fc873368724c1d90c014e6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  4 23:37:18 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar  4 23:37:18 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=35b38089

Add test for bug #460304.

---
 pym/portage/tests/resolver/test_slot_abi.py |   59 ++++++++++++++++++++++++++-
 1 files changed, 58 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/resolver/test_slot_abi.py b/pym/portage/tests/resolver/test_slot_abi.py
index 8aed5d3..ca3662d 100644
--- a/pym/portage/tests/resolver/test_slot_abi.py
+++ b/pym/portage/tests/resolver/test_slot_abi.py
@@ -1,4 +1,4 @@
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase
@@ -247,6 +247,63 @@ class SlotAbiTestCase(TestCase):
 		finally:
 			playground.cleanup()
 
+
+	def testWholeSlotConditional(self):
+		ebuilds = {
+			"dev-libs/libnl-3.2.14" : {
+				"SLOT": "3"
+			},
+			"dev-libs/libnl-1.1-r3" : {
+				"SLOT": "1.1"
+			},
+			"net-misc/networkmanager-0.9.6.4-r1" : {
+				"EAPI": "5",
+				"IUSE": "wimax",
+				"DEPEND": "wimax? ( dev-libs/libnl:1.1= ) !wimax? ( dev-libs/libnl:3= )",
+				"RDEPEND": "wimax? ( dev-libs/libnl:1.1= ) !wimax? ( dev-libs/libnl:3= )"
+			},
+		}
+		installed = {
+			"dev-libs/libnl-1.1-r3" : {
+				"SLOT": "1.1"
+			},
+			"net-misc/networkmanager-0.9.6.4-r1" : {
+				"EAPI": "5",
+				"IUSE": "wimax",
+				"USE": "wimax",
+				"DEPEND":  "dev-libs/libnl:1.1/1.1=",
+				"RDEPEND": "dev-libs/libnl:1.1/1.1="
+			},
+		}
+
+		user_config = {
+			"make.conf" : ("USE=\"wimax\"",)
+		}
+
+		world = ["net-misc/networkmanager"]
+
+		test_cases = (
+
+			# Demonstrate bug #460304, where _slot_operator_update_probe needs
+			# to account for USE conditional deps.
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success = True,
+				mergelist = ["net-misc/networkmanager-0.9.6.4-r1"]),
+
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			installed=installed, user_config=user_config, 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()
+
 	def testWholeSlotSubSlotMix(self):
 		ebuilds = {
 			"dev-libs/glib-1.2.10" : {


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-07-30  2:13 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2013-07-30  2:13 UTC (permalink / raw
  To: gentoo-commits

commit:     2fe14319d9143610dfdb8d1d044d7432038c857c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 30 02:08:26 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 30 02:12:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2fe14319

Add test for bug #478188.

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

diff --git a/pym/portage/tests/resolver/test_or_choices.py b/pym/portage/tests/resolver/test_or_choices.py
new file mode 100644
index 0000000..3bc67bc
--- /dev/null
+++ b/pym/portage/tests/resolver/test_or_choices.py
@@ -0,0 +1,65 @@
+# Copyright 2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class OrChoicesTestCase(TestCase):
+
+	def testOrChoices(self):
+		ebuilds = {
+			"dev-lang/vala-0.20.0" : {
+				"EAPI": "5",
+				"SLOT": "0.20"
+			},
+			"dev-lang/vala-0.18.0" : {
+				"EAPI": "5",
+				"SLOT": "0.18"
+			},
+			#"dev-libs/gobject-introspection-1.36.0" : {
+			#	"EAPI": "5",
+			#	"RDEPEND" : "!<dev-lang/vala-0.20.0",
+			#},
+			"dev-libs/gobject-introspection-1.34.0" : {
+				"EAPI": "5"
+			},
+			"sys-apps/systemd-ui-2" : {
+				"EAPI": "5",
+				"RDEPEND" : "|| ( dev-lang/vala:0.20 dev-lang/vala:0.18 )"
+			},
+		}
+
+		installed = {
+			"dev-lang/vala-0.18.0" : {
+				"EAPI": "5",
+				"SLOT": "0.18"
+			},
+			"dev-libs/gobject-introspection-1.34.0" : {
+				"EAPI": "5"
+			},
+			"sys-apps/systemd-ui-2" : {
+				"EAPI": "5",
+				"RDEPEND" : "|| ( dev-lang/vala:0.20 dev-lang/vala:0.18 )"
+			},
+		}
+
+		world = ["dev-libs/gobject-introspection", "sys-apps/systemd-ui"]
+
+		test_cases = (
+			# Demonstrate that vala:0.20 update is not pulled in, as in bug #478188
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success=True,
+				all_permutations = True,
+				mergelist = []),
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed, world=world)
+		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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-08-22  0:46 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2013-08-22  0:46 UTC (permalink / raw
  To: gentoo-commits

commit:     fedb39bc9a2a9fd3ab37a08096cda6824c93b02a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 22 00:45:39 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 22 00:45:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fedb39bc

Add test for bug #481628.

---
 .../tests/resolver/test_autounmask_multilib_use.py | 85 ++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/pym/portage/tests/resolver/test_autounmask_multilib_use.py b/pym/portage/tests/resolver/test_autounmask_multilib_use.py
new file mode 100644
index 0000000..e160c77
--- /dev/null
+++ b/pym/portage/tests/resolver/test_autounmask_multilib_use.py
@@ -0,0 +1,85 @@
+# Copyright 2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class AutounmaskMultilibUseTestCase(TestCase):
+
+	def testAutounmaskMultilibUse(self):
+
+		self.todo = True
+
+		ebuilds = {
+			"x11-proto/xextproto-7.2.1-r1": {
+				"EAPI": "5",
+				"IUSE": "abi_x86_32 abi_x86_64",
+			},
+			"x11-libs/libXaw-1.0.11-r2": {
+				"EAPI": "5",
+				"IUSE": "abi_x86_32 abi_x86_64",
+				"RDEPEND": "x11-proto/xextproto[abi_x86_32(-)?,abi_x86_64(-)?]"
+			},
+			"app-emulation/emul-linux-x86-xlibs-20130224-r2": {
+				"EAPI": "5",
+				"RDEPEND": "x11-libs/libXaw[abi_x86_32]"
+			},
+			"games-util/steam-client-meta-0-r20130514": {
+				"EAPI": "5",
+				"RDEPEND": "app-emulation/emul-linux-x86-xlibs"
+			}
+		}
+
+		installed = {
+			"x11-proto/xextproto-7.2.1-r1": {
+				"EAPI": "5",
+				"IUSE": "abi_x86_32 abi_x86_64",
+				"USE": "abi_x86_32 abi_x86_64"
+			},
+			"x11-libs/libXaw-1.0.11-r2": {
+				"EAPI": "5",
+				"IUSE": "abi_x86_32 abi_x86_64",
+				"RDEPEND": "x11-proto/xextproto[abi_x86_32(-)?,abi_x86_64(-)?]",
+				"USE": "abi_x86_32 abi_x86_64"
+			},
+			"app-emulation/emul-linux-x86-xlibs-20130224-r2": {
+				"EAPI": "5",
+				"RDEPEND": "x11-libs/libXaw[abi_x86_32]"
+			},
+			"games-util/steam-client-meta-0-r20130514": {
+				"EAPI": "5",
+				"RDEPEND": "app-emulation/emul-linux-x86-xlibs"
+			}
+		}
+
+		user_config = {
+			#"make.conf" : ("USE=\"abi_x86_32 abi_x86_64\"",)
+			"make.conf" : ("USE=\"abi_x86_64\"",)
+		}
+
+		world = ("games-util/steam-client-meta",)
+
+		test_cases = (
+
+				# Test autounmask solving of multilib use deps for bug #481628.
+				# We would like it to suggest some USE changes, but instead it
+				# currently fails with a SLOT conflict.
+
+				ResolverPlaygroundTestCase(
+					["x11-proto/xextproto", "x11-libs/libXaw"],
+					options = {"--oneshot": True, "--autounmask": True,
+						"--backtrack": 30},
+					mergelist = ["x11-proto/xextproto-7.2.1-r1", "x11-libs/libXaw-1.0.11-r2"],
+					success = True),
+			)
+
+		playground = ResolverPlayground(ebuilds=ebuilds, installed=installed,
+			user_config=user_config, 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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-11-26 13:50 Brian Dolbec
  0 siblings, 0 replies; 75+ messages in thread
From: Brian Dolbec @ 2013-11-26 13:50 UTC (permalink / raw
  To: gentoo-commits

commit:     84ec8afa54c934639cb4d0603c119bda7142f12e
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Tue Nov 26 09:03:11 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Nov 26 09:14:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84ec8afa

Add test case for bug 486580

---
 .../tests/resolver/test_slot_conflict_rebuild.py   | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
index 3cd86bd..b1fd208 100644
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -105,3 +105,78 @@ class SlotConflictRebuildTestCase(TestCase):
 				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
 		finally:
 			playground.cleanup()
+
+
+	def testSlotConflictMassRebuild(self):
+		"""
+		Bug 486580
+		Before this bug was fixed, emerge would backtrack for each package that needs
+		a rebuild. This could cause it to hit the backtrack limit and not rebuild all
+		needed packages.
+		"""
+		ebuilds = {
+
+			"app-misc/A-1" : {
+				"EAPI": "5",
+				"DEPEND": "app-misc/B:=",
+				"RDEPEND": "app-misc/B:="
+			},
+
+			"app-misc/B-1" : {
+				"EAPI": "5",
+				"SLOT": "1"
+			},
+
+			"app-misc/B-2" : {
+				"EAPI": "5",
+				"SLOT": "2/2"
+			},
+		}
+
+		installed = {
+			"app-misc/B-1" : {
+				"EAPI": "5",
+				"SLOT": "1"
+			},
+		}
+
+		expected_mergelist = ['app-misc/A-1', 'app-misc/B-2']
+
+		for i in xrange(5):
+			ebuilds["app-misc/C%sC-1" % i] = {
+				"EAPI": "5",
+				"DEPEND": "app-misc/B:=",
+				"RDEPEND": "app-misc/B:="
+			}
+
+			installed["app-misc/C%sC-1" % i] = {
+				"EAPI": "5",
+				"DEPEND": "app-misc/B:1/1=",
+				"RDEPEND": "app-misc/B:1/1="
+			}
+			for x in ("DEPEND", "RDEPEND"):
+				ebuilds["app-misc/A-1"][x] += " app-misc/C%sC" % i
+
+			expected_mergelist.append("app-misc/C%sC-1" % i)
+
+
+		test_cases = (
+			ResolverPlaygroundTestCase(
+				["app-misc/A"],
+				ignore_mergelist_order=True,
+				all_permutations=True,
+				options = {"--backtrack": 3, '--deep': True},
+				success = True,
+				mergelist = expected_mergelist),
+		)
+
+		world = []
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			installed=installed, world=world, debug=True)
+		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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-11-26 15:11 Brian Dolbec
  0 siblings, 0 replies; 75+ messages in thread
From: Brian Dolbec @ 2013-11-26 15:11 UTC (permalink / raw
  To: gentoo-commits

commit:     b37f8a80a9ff959948926425109e1fc1c0901f32
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 26 15:06:46 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Nov 26 15:06:46 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b37f8a80

fix py-3 compatibility

---
 pym/portage/tests/resolver/test_slot_conflict_rebuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
index b1fd208..0fe8f5d 100644
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -142,7 +142,7 @@ class SlotConflictRebuildTestCase(TestCase):
 
 		expected_mergelist = ['app-misc/A-1', 'app-misc/B-2']
 
-		for i in xrange(5):
+		for i in list(range(5)):
 			ebuilds["app-misc/C%sC-1" % i] = {
 				"EAPI": "5",
 				"DEPEND": "app-misc/B:=",


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-11-27  3:24 Mike Frysinger
  0 siblings, 0 replies; 75+ messages in thread
From: Mike Frysinger @ 2013-11-27  3:24 UTC (permalink / raw
  To: gentoo-commits

commit:     cdd47fc0b6b7274f0591bdd9c18ae7a47c44e733
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 27 03:23:58 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Nov 27 03:23:58 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cdd47fc0

test_slot_conflict_rebuild: drop pointless list cast

The range() func already returns a list, so need for list().

---
 pym/portage/tests/resolver/test_slot_conflict_rebuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
index 0fe8f5d..96cc8f1 100644
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -142,7 +142,7 @@ class SlotConflictRebuildTestCase(TestCase):
 
 		expected_mergelist = ['app-misc/A-1', 'app-misc/B-2']
 
-		for i in list(range(5)):
+		for i in range(5):
 			ebuilds["app-misc/C%sC-1" % i] = {
 				"EAPI": "5",
 				"DEPEND": "app-misc/B:=",


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-11-27  7:44 Mike Frysinger
  0 siblings, 0 replies; 75+ messages in thread
From: Mike Frysinger @ 2013-11-27  7:44 UTC (permalink / raw
  To: gentoo-commits

commit:     902d3661c352875e577a491bf1c758b396c95863
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Tue Nov 26 20:06:24 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Nov 27 07:44:43 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=902d3661

Suppress debug outout from tests

---
 pym/portage/tests/resolver/test_slot_conflict_rebuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
index 9fd9164..74f5cc1 100644
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -173,7 +173,7 @@ class SlotConflictRebuildTestCase(TestCase):
 		world = []
 
 		playground = ResolverPlayground(ebuilds=ebuilds,
-			installed=installed, world=world, debug=True)
+			installed=installed, world=world, debug=False)
 		try:
 			for test_case in test_cases:
 				playground.run_TestCase(test_case)


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2013-12-05 21:51 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 75+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-12-05 21:51 UTC (permalink / raw
  To: gentoo-commits

commit:     d518ef475d8fc9a13dbcc8743c51d60b18bdb490
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Dec  5 21:51:40 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Thu Dec  5 21:51:40 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d518ef47

Fix a typo.

---
 pym/portage/tests/resolver/test_slot_conflict_rebuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
index 1950550..5acdadb 100644
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
@@ -304,7 +304,7 @@ class SlotConflictRebuildTestCase(TestCase):
 		"""
 		Bug 487198
 		For parents with mixed >= and < dependencies, we scheduled rebuilds for the
-		>= atom, but in the end didn't install the child update becaue of the < atom.
+		>= atom, but in the end didn't install the child update because of the < atom.
 		"""
 		ebuilds = {
 			"cat/slotted-lib-1" : {


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2014-01-07 19:06 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 75+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-01-07 19:06 UTC (permalink / raw
  To: gentoo-commits

commit:     c508940d7fdf4ce92617942460900946e079c355
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Tue Jan  7 19:06:20 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Tue Jan  7 19:06:20 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c508940d

ResolverPlayground: Write layout.conf if needed

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

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index e09e265..99c66cd 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from itertools import permutations
@@ -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")


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2014-01-07 20:40 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 75+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-01-07 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     5007501b4a166e0e72d5b852ea7a3cb440942b1c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Jan  7 20:39:49 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Tue Jan  7 20:39:49 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5007501b

Use with statements.

---
 pym/portage/tests/resolver/ResolverPlayground.py | 100 ++++++++++-------------
 1 file changed, 43 insertions(+), 57 deletions(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 99c66cd..9577743 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -116,9 +116,8 @@ class ResolverPlayground(object):
 				pass
 
 			repo_name_file = os.path.join(profile_path, "repo_name")
-			f = open(repo_name_file, "w")
-			f.write("%s\n" % repo)
-			f.close()
+			with open(repo_name_file, "w") as f:
+				f.write("%s\n" % repo)
 
 		return self._repositories[repo]["location"]
 
@@ -158,15 +157,14 @@ class ResolverPlayground(object):
 			except os.error:
 				pass
 
-			f = open(ebuild_path, "w")
-			if copyright_header is not None:
-				f.write(copyright_header)
-			f.write('EAPI="%s"\n' % eapi)
-			for k, v in metadata.items():
-				f.write('%s="%s"\n' % (k, v))
-			if misc_content is not None:
-				f.write(misc_content)
-			f.close()
+			with open(ebuild_path, "w") as f:
+				if copyright_header is not None:
+					f.write(copyright_header)
+				f.write('EAPI="%s"\n' % eapi)
+				for k, v in metadata.items():
+					f.write('%s="%s"\n' % (k, v))
+				if misc_content is not None:
+					f.write(misc_content)
 
 	def _create_ebuild_manifests(self, ebuilds):
 		tmpsettings = config(clone=self.settings)
@@ -271,16 +269,14 @@ class ResolverPlayground(object):
 					categories.add(catsplit(cpv)[0])
 
 			categories_file = os.path.join(profile_dir, "categories")
-			f = open(categories_file, "w")
-			for cat in categories:
-				f.write(cat + "\n")
-			f.close()
+			with open(categories_file, "w") as f:
+				for cat in categories:
+					f.write(cat + "\n")
 
 			#Create $REPO/profiles/license_groups
 			license_file = os.path.join(profile_dir, "license_groups")
-			f = open(license_file, "w")
-			f.write("EULA TEST\n")
-			f.close()
+			with open(license_file, "w") as f:
+				f.write("EULA TEST\n")
 
 			repo_config = repo_configs.get(repo)
 			if repo_config:
@@ -294,10 +290,9 @@ class ResolverPlayground(object):
 						file_name = os.path.join(profile_dir, config_file)
 						if "/" in config_file and not os.path.isdir(os.path.dirname(file_name)):
 							os.makedirs(os.path.dirname(file_name))
-					f = open(file_name, "w")
-					for line in lines:
-						f.write("%s\n" % line)
-					f.close()
+					with open(file_name, "w") as f:
+						for line in lines:
+							f.write("%s\n" % line)
 
 			#Create $profile_dir/eclass (we fail to digest the ebuilds if it's not there)
 			os.makedirs(os.path.join(repo_dir, "eclass"))
@@ -315,25 +310,21 @@ class ResolverPlayground(object):
 
 				if not (profile and "eapi" in profile):
 					eapi_file = os.path.join(sub_profile_dir, "eapi")
-					f = open(eapi_file, "w")
-					f.write("0\n")
-					f.close()
+					with open(eapi_file, "w") as f:
+						f.write("0\n")
 
 				make_defaults_file = os.path.join(sub_profile_dir, "make.defaults")
-				f = open(make_defaults_file, "w")
-				f.write("ARCH=\"x86\"\n")
-				f.write("ACCEPT_KEYWORDS=\"x86\"\n")
-				f.close()
+				with open(make_defaults_file, "w") as f:
+					f.write("ARCH=\"x86\"\n")
+					f.write("ACCEPT_KEYWORDS=\"x86\"\n")
 
 				use_force_file = os.path.join(sub_profile_dir, "use.force")
-				f = open(use_force_file, "w")
-				f.write("x86\n")
-				f.close()
+				with open(use_force_file, "w") as f:
+					f.write("x86\n")
 
 				parent_file = os.path.join(sub_profile_dir, "parent")
-				f = open(parent_file, "w")
-				f.write("..\n")
-				f.close()
+				with open(parent_file, "w") as f:
+					f.write("..\n")
 
 				if profile:
 					for config_file, lines in profile.items():
@@ -341,10 +332,9 @@ class ResolverPlayground(object):
 							raise ValueError("Unknown config file: '%s'" % config_file)
 
 						file_name = os.path.join(sub_profile_dir, config_file)
-						f = open(file_name, "w")
-						for line in lines:
-							f.write("%s\n" % line)
-						f.close()
+						with open(file_name, "w") as f:
+							for line in lines:
+								f.write("%s\n" % line)
 
 				#Create profile symlink
 				os.symlink(sub_profile_dir, os.path.join(user_config_dir, "make.profile"))
@@ -411,10 +401,9 @@ class ResolverPlayground(object):
 				raise ValueError("Unknown config file: '%s'" % config_file)
 
 			file_name = os.path.join(user_config_dir, config_file)
-			f = open(file_name, "w")
-			for line in lines:
-				f.write("%s\n" % line)
-			f.close()
+			with open(file_name, "w") as f:
+				for line in lines:
+					f.write("%s\n" % line)
 
 		#Create /usr/share/portage/config/make.globals
 		make_globals_path = os.path.join(self.eroot,
@@ -444,10 +433,9 @@ class ResolverPlayground(object):
 
 		for sets_file, lines in sets.items():
 			file_name = os.path.join(set_config_dir, sets_file)
-			f = open(file_name, "w")
-			for line in lines:
-				f.write("%s\n" % line)
-			f.close()
+			with open(file_name, "w") as f:
+				for line in lines:
+					f.write("%s\n" % line)
 
 	def _create_world(self, world, world_sets):
 		#Create /var/lib/portage/world
@@ -457,15 +445,13 @@ class ResolverPlayground(object):
 		world_file = os.path.join(var_lib_portage, "world")
 		world_set_file = os.path.join(var_lib_portage, "world_sets")
 
-		f = open(world_file, "w")
-		for atom in world:
-			f.write("%s\n" % atom)
-		f.close()
+		with open(world_file, "w") as f:
+			for atom in world:
+				f.write("%s\n" % atom)
 
-		f = open(world_set_file, "w")
-		for atom in world_sets:
-			f.write("%s\n" % atom)
-		f.close()
+		with open(world_set_file, "w") as f:
+			for atom in world_sets:
+				f.write("%s\n" % atom)
 
 	def _load_config(self):
 
@@ -746,7 +732,7 @@ class ResolverPlaygroundResult(object):
 				self.license_changes[pkg.cpv] = missing_licenses
 
 		if self.depgraph._dynamic_config._slot_conflict_handler is not None:
-			self.slot_collision_solutions  = []
+			self.slot_collision_solutions = []
 			handler = self.depgraph._dynamic_config._slot_conflict_handler
 
 			for change in handler.changes:


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2014-02-24 20:03 Sebastian Luther
  0 siblings, 0 replies; 75+ messages in thread
From: Sebastian Luther @ 2014-02-24 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     92a7b16bd71ee630b34583bd848e5f7b922c59a7
Author:     David James <davidjames <AT> google <DOT> com>
AuthorDate: Mon Feb 24 18:14:26 2014 +0000
Commit:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de >
CommitDate: Mon Feb 24 19:31:33 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=92a7b16b

Add a test case for --newuse, --changed-use, and --binpkg-respect-use.

Change-Id: I201e468c6e7cda6aa961371ad9ddc10cfab04bc7

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

diff --git a/pym/portage/tests/resolver/test_useflags.py b/pym/portage/tests/resolver/test_useflags.py
new file mode 100644
index 0000000..0a5f3b3
--- /dev/null
+++ b/pym/portage/tests/resolver/test_useflags.py
@@ -0,0 +1,78 @@
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
+
+class UseFlagsTestCase(TestCase):
+
+	def testUseFlags(self):
+		ebuilds = {
+			"dev-libs/A-1": { "IUSE": "X", },
+			"dev-libs/B-1": { "IUSE": "X Y", },
+			}
+
+		installed = {
+			"dev-libs/A-1": { "IUSE": "X", },
+			"dev-libs/B-1": { "IUSE": "X", },
+			}
+
+		binpkgs = installed
+
+		user_config = {
+			"package.use": ( "dev-libs/A X", ),
+			"use.force": ( "Y", ),
+		}
+
+		test_cases = (
+			#default: don't reinstall on use flag change
+			ResolverPlaygroundTestCase(
+				["dev-libs/A"],
+				options = {"--selective": True, "--usepkg": True},
+				success = True,
+				mergelist = []),
+
+			#default: respect use flags for binpkgs
+			ResolverPlaygroundTestCase(
+				["dev-libs/A"],
+				options = {"--usepkg": True},
+				success = True,
+				mergelist = ["dev-libs/A-1"]),
+
+			#--binpkg-respect-use=n: use binpkgs with different use flags
+			ResolverPlaygroundTestCase(
+				["dev-libs/A"],
+				options = {"--binpkg-respect-use": "n", "--usepkg": True},
+				success = True,
+				mergelist = ["[binary]dev-libs/A-1"]),
+
+			#--reinstall=changed-use: reinstall if use flag changed
+			ResolverPlaygroundTestCase(
+				["dev-libs/A"],
+				options = {"--reinstall": "changed-use", "--usepkg": True},
+				success = True,
+				mergelist = ["dev-libs/A-1"]),
+
+			#--reinstall=changed-use: don't reinstall on new use flag
+			ResolverPlaygroundTestCase(
+				["dev-libs/B"],
+				options = {"--reinstall": "changed-use", "--usepkg": True},
+				success = True,
+				mergelist = []),
+
+			#--newuse: reinstall on new use flag
+			ResolverPlaygroundTestCase(
+				["dev-libs/B"],
+				options = {"--newuse": True, "--usepkg": True},
+				success = True,
+				mergelist = ["dev-libs/B-1"]),
+			)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			binpkgs=binpkgs, installed=installed, user_config=user_config)
+		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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2014-09-16  6:35 Brian Dolbec
  0 siblings, 0 replies; 75+ messages in thread
From: Brian Dolbec @ 2014-09-16  6:35 UTC (permalink / raw
  To: gentoo-commits

commit:     4fcf4fa56c0033d726eb0755e3ca67b3337ad944
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 13 00:41:00 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep 16 03:29:41 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4fcf4fa5

Add test for bug #522652 with slot-operator

This test case uses || ( bar foo:= ) syntax that is forbidden by PMS.

---
 .../tests/resolver/test_slot_operator_rebuild.py   | 80 ++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/pym/portage/tests/resolver/test_slot_operator_rebuild.py b/pym/portage/tests/resolver/test_slot_operator_rebuild.py
new file mode 100644
index 0000000..42512aa
--- /dev/null
+++ b/pym/portage/tests/resolver/test_slot_operator_rebuild.py
@@ -0,0 +1,80 @@
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+	ResolverPlaygroundTestCase)
+
+class SlotOperatorRebuildTestCase(TestCase):
+
+	def testSlotOperatorRebuild(self):
+
+		ebuilds = {
+
+			"app-misc/A-1" : {
+				"EAPI": "5",
+				"SLOT": "0/1"
+			},
+
+			"app-misc/A-2" : {
+				"EAPI": "5",
+				"SLOT": "0/2"
+			},
+
+			"app-misc/B-0" : {
+				"EAPI": "5",
+				"RDEPEND": "app-misc/A:="
+			},
+
+			"app-misc/C-0" : {
+				"EAPI": "5",
+				"RDEPEND": "|| ( app-misc/X app-misc/A:= )"
+			},
+
+		}
+
+		installed = {
+
+			"app-misc/A-1" : {
+				"EAPI": "5",
+				"SLOT": "0/1"
+			},
+
+			"app-misc/B-0" : {
+				"EAPI": "5",
+				"RDEPEND": "app-misc/A:0/1="
+			},
+
+			"app-misc/C-0" : {
+				"EAPI": "5",
+				"RDEPEND": "|| ( app-misc/X app-misc/A:0/1= )"
+			},
+
+		}
+
+		world = ["app-misc/B", "app-misc/C"]
+
+		test_cases = (
+
+			# Test bug #522652, where the unsatisfiable app-misc/X
+			# atom is selected, and the dependency is placed into
+			# _initially_unsatisfied_deps where it is ignored, causing
+			# the app-misc/C-0 rebuild to be missed.
+			ResolverPlaygroundTestCase(
+				["app-misc/A"],
+				options = {"--dynamic-deps": "n"},
+				success = True,
+				ambiguous_merge_order = True,
+				mergelist = ['app-misc/A-2', ('app-misc/B-0', 'app-misc/C-0')]
+			),
+
+		)
+
+		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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2014-09-19  8:52 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2014-09-19  8:52 UTC (permalink / raw
  To: gentoo-commits

commit:     52970a73754160a203e34684e7000ba6f8a47667
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 19 08:47:59 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 19 08:47:59 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=52970a73

ResolverPlayground: inline _iter_forced_rebuilds

Use an inline generator expression rather than a function, since the
function was only used once.

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

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 646987d..d74a410 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -778,12 +778,10 @@ class ResolverPlaygroundResult(object):
 				for dep_info in self.depgraph._dynamic_config._unsatisfied_deps_for_display)
 
 		if self.depgraph._forced_rebuilds:
-			self.forced_rebuilds = dict(self._iter_forced_rebuilds())
-
-	def _iter_forced_rebuilds(self):
-		for child_dict in self.depgraph._forced_rebuilds.values():
-			for child, parents in child_dict.items():
-				yield child.cpv, set(parent.cpv for parent in parents)
+			self.forced_rebuilds = dict(
+				(child.cpv, set(parent.cpv for parent in parents))
+				for child_dict in self.depgraph._forced_rebuilds.values()
+				for child, parents in child_dict.items())
 
 class ResolverPlaygroundDepcleanResult(object):
 


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2016-04-29 17:24 Brian Dolbec
  0 siblings, 0 replies; 75+ messages in thread
From: Brian Dolbec @ 2016-04-29 17:24 UTC (permalink / raw
  To: gentoo-commits

commit:     8e26fbf2ebb3d26765f34dbd7b14726d8cbf122f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 17 08:06:27 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Apr 25 15:28:53 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8e26fbf2

tests: Add type="" to <maintainer/>

 pym/portage/tests/resolver/ResolverPlayground.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 68e047a..d1434f7 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -47,7 +47,7 @@ class ResolverPlayground(object):
 	metadata_xml_template = """<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<maintainer>
+<maintainer type="person">
 <email>maintainer-needed@gentoo.org</email>
 <description>Description of the maintainership</description>
 </maintainer>


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2016-06-26 23:51 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2016-06-26 23:51 UTC (permalink / raw
  To: gentoo-commits

commit:     ac6f924fa3d9296778d493a16a1d428ab54dda97
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 23 06:17:17 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 26 23:49:29 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac6f924f

Add a unit test which reproduces bug 584626

X-Gentoo-Bug: 584626
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=584626

 .../resolver/test_slot_operator_reverse_deps.py    | 109 +++++++++++++++++++++
 1 file changed, 109 insertions(+)

diff --git a/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py b/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py
new file mode 100644
index 0000000..72879f8
--- /dev/null
+++ b/pym/portage/tests/resolver/test_slot_operator_reverse_deps.py
@@ -0,0 +1,109 @@
+# Copyright 2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (
+	ResolverPlayground,
+	ResolverPlaygroundTestCase,
+)
+
+class SlotOperatorReverseDepsTestCase(TestCase):
+
+	def testSlotOperatorReverseDeps(self):
+
+		ebuilds = {
+
+			"media-libs/mesa-11.2.2" : {
+				"EAPI": "6",
+				"SLOT": "0",
+				"RDEPEND": ">=sys-devel/llvm-3.6.0:="
+			},
+
+			"sys-devel/clang-3.7.1-r100" : {
+				"EAPI": "6",
+				"SLOT": "0/3.7",
+				"RDEPEND": "~sys-devel/llvm-3.7.1"
+			},
+
+			"sys-devel/clang-3.8.0-r100" : {
+				"EAPI": "6",
+				"SLOT": "0/3.8",
+				"RDEPEND": "~sys-devel/llvm-3.8.0"
+			},
+
+			"sys-devel/llvm-3.7.1-r2" : {
+				"EAPI": "6",
+				"SLOT": "0/3.7.1",
+				"PDEPEND": "=sys-devel/clang-3.7.1-r100"
+			},
+
+			"sys-devel/llvm-3.8.0-r2" : {
+				"EAPI": "6",
+				"SLOT": "0/3.8.0",
+				"PDEPEND": "=sys-devel/clang-3.8.0-r100"
+			},
+
+		}
+
+		installed = {
+
+			"media-libs/mesa-11.2.2" : {
+				"EAPI": "6",
+				"SLOT": "0",
+				"RDEPEND": ">=sys-devel/llvm-3.6.0:0/3.7.1="
+			},
+
+			"sys-devel/clang-3.7.1-r100" : {
+				"EAPI": "6",
+				"SLOT": "0/3.7",
+				"RDEPEND": "~sys-devel/llvm-3.7.1"
+			},
+
+			"sys-devel/llvm-3.7.1-r2" : {
+				"EAPI": "6",
+				"SLOT": "0/3.7.1",
+				"PDEPEND": "=sys-devel/clang-3.7.1-r100"
+			},
+
+		}
+
+		world = ["media-libs/mesa"]
+
+		test_cases = (
+
+			# Test bug #584626, where an llvm update is missed due to
+			# the check_reverse_dependencies function seeing that
+			# updating llvm will break a dependency of the installed
+			# version of clang (though a clang update is available).
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success = True,
+				mergelist = [],
+			),
+
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {
+					"--update": True,
+					"--deep": True,
+					"--ignore-built-slot-operator-deps": "y",
+				},
+				success = True,
+				mergelist = [
+					'sys-devel/llvm-3.8.0-r2',
+					'sys-devel/clang-3.8.0-r100',
+				],
+			),
+
+		)
+
+		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()


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2017-12-16  3:16 Zac Medico
  0 siblings, 0 replies; 75+ messages in thread
From: Zac Medico @ 2017-12-16  3:16 UTC (permalink / raw
  To: gentoo-commits

commit:     b47daf4d12ad54668c75f53661da4b252e665c22
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 16 03:15:58 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 16 03:16:30 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b47daf4d

MultirepoTestCase: add missing EAPI definitions needed for slot deps

 pym/portage/tests/resolver/test_multirepo.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/tests/resolver/test_multirepo.py b/pym/portage/tests/resolver/test_multirepo.py
index 2b1a6d073..dabec6af9 100644
--- a/pym/portage/tests/resolver/test_multirepo.py
+++ b/pym/portage/tests/resolver/test_multirepo.py
@@ -42,7 +42,7 @@ class MultirepoTestCase(TestCase):
 			}
 
 		installed = {
-			"dev-libs/H-1": { "RDEPEND" : "|| ( dev-libs/I:2 dev-libs/I:1 )"},
+			"dev-libs/H-1": { "RDEPEND" : "|| ( dev-libs/I:2 dev-libs/I:1 )", "EAPI" : "3" },
 			"dev-libs/I-2::repo1": {"SLOT" : "2"},
 			"dev-libs/K-1::repo1": { },
 			}
@@ -277,7 +277,7 @@ class MultirepoTestCase(TestCase):
 			}
 
 		installed = {
-			"dev-libs/J-1": { "RDEPEND" : "|| ( dev-libs/I:2 dev-libs/I:1 )"},
+			"dev-libs/J-1": { "RDEPEND" : "|| ( dev-libs/I:2 dev-libs/I:1 )", "EAPI" : "3" },
 			"dev-libs/I-2::repo1": {"SLOT" : "2"},
 			}
 


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2018-02-26 22:07 Michał Górny
  0 siblings, 0 replies; 75+ messages in thread
From: Michał Górny @ 2018-02-26 22:07 UTC (permalink / raw
  To: gentoo-commits

commit:     45bdfae8b20dc24559d325db7322576855d6a582
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 26 12:40:15 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Feb 26 22:07:36 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=45bdfae8

test_required_use: Add tests for ?? operator

Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 pym/portage/tests/resolver/test_required_use.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/pym/portage/tests/resolver/test_required_use.py b/pym/portage/tests/resolver/test_required_use.py
index c8810faef..d40222204 100644
--- a/pym/portage/tests/resolver/test_required_use.py
+++ b/pym/portage/tests/resolver/test_required_use.py
@@ -44,6 +44,12 @@ class RequiredUSETestCase(TestCase):
 			"dev-libs/D-3" : {"EAPI": "4", "IUSE": "+w +x y z",     "REQUIRED_USE": "w? ( x || ( y z ) )"},
 			"dev-libs/D-4" : {"EAPI": "4", "IUSE": "+w x +y +z",    "REQUIRED_USE": "w? ( x || ( y z ) )"},
 			"dev-libs/D-5" : {"EAPI": "4", "IUSE": "w x y z",       "REQUIRED_USE": "w? ( x || ( y z ) )"},
+
+			"dev-libs/E-1" : {"EAPI": "5", "IUSE": "foo bar",   "REQUIRED_USE": "?? ( foo bar )"},
+			"dev-libs/E-2" : {"EAPI": "5", "IUSE": "foo +bar",  "REQUIRED_USE": "?? ( foo bar )"},
+			"dev-libs/E-3" : {"EAPI": "5", "IUSE": "+foo bar",  "REQUIRED_USE": "?? ( foo bar )"},
+			"dev-libs/E-4" : {"EAPI": "5", "IUSE": "+foo +bar", "REQUIRED_USE": "?? ( foo bar )"},
+			"dev-libs/E-5" : {"EAPI": "5", "IUSE": "+foo +bar", "REQUIRED_USE": "?? ( )"},
 			}
 
 		test_cases = (
@@ -79,6 +85,12 @@ class RequiredUSETestCase(TestCase):
 			ResolverPlaygroundTestCase(["=dev-libs/D-3"],  success = False),
 			ResolverPlaygroundTestCase(["=dev-libs/D-4"],  success = False),
 			ResolverPlaygroundTestCase(["=dev-libs/D-5"],  success = True, mergelist=["dev-libs/D-5"]),
+
+			ResolverPlaygroundTestCase(["=dev-libs/E-1"], success = True, mergelist=["dev-libs/E-1"]),
+			ResolverPlaygroundTestCase(["=dev-libs/E-2"], success = True, mergelist=["dev-libs/E-2"]),
+			ResolverPlaygroundTestCase(["=dev-libs/E-3"], success = True, mergelist=["dev-libs/E-3"]),
+			ResolverPlaygroundTestCase(["=dev-libs/E-4"], success = False),
+			ResolverPlaygroundTestCase(["=dev-libs/E-5"], success = True, mergelist=["dev-libs/E-5"]),
 			)
 
 		playground = ResolverPlayground(ebuilds=ebuilds)


^ permalink raw reply related	[flat|nested] 75+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/
@ 2018-03-04 21:05 Michał Górny
  0 siblings, 0 replies; 75+ messages in thread
From: Michał Górny @ 2018-03-04 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     ea4456cf197fd7ac8644ab0396fb629ce612ae6f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 26 12:40:15 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar  4 21:03:52 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ea4456cf

test_required_use: Add tests for ?? operator

 pym/portage/tests/resolver/test_required_use.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/tests/resolver/test_required_use.py b/pym/portage/tests/resolver/test_required_use.py
index d40222204..ac748ca3b 100644
--- a/pym/portage/tests/resolver/test_required_use.py
+++ b/pym/portage/tests/resolver/test_required_use.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage.tests import TestCase


^ permalink raw reply related	[flat|nested] 75+ messages in thread

end of thread, other threads:[~2018-03-04 21:05 UTC | newest]

Thread overview: 75+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-22 21:01 [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2018-03-04 21:05 Michał Górny
2018-02-26 22:07 Michał Górny
2017-12-16  3:16 Zac Medico
2016-06-26 23:51 Zac Medico
2016-04-29 17:24 Brian Dolbec
2014-09-19  8:52 Zac Medico
2014-09-16  6:35 Brian Dolbec
2014-02-24 20:03 Sebastian Luther
2014-01-07 20:40 Arfrever Frehtes Taifersar Arahesis
2014-01-07 19:06 Arfrever Frehtes Taifersar Arahesis
2013-12-05 21:51 Arfrever Frehtes Taifersar Arahesis
2013-11-27  7:44 Mike Frysinger
2013-11-27  3:24 Mike Frysinger
2013-11-26 15:11 Brian Dolbec
2013-11-26 13:50 Brian Dolbec
2013-08-22  0:46 Zac Medico
2013-07-30  2:13 Zac Medico
2013-03-04 23:37 Zac Medico
2013-02-14  1:20 Zac Medico
2013-02-12  3:03 Zac Medico
2013-02-12  1:36 Zac Medico
2012-10-26 17:25 Zac Medico
2012-10-26  6:31 Zac Medico
2012-10-26  3:44 Zac Medico
2012-09-26  2:38 Zac Medico
2012-09-26  2:36 Zac Medico
2012-09-26  0:52 Zac Medico
2012-09-25  3:30 Zac Medico
2012-06-23 21:53 Zac Medico
2012-06-21 22:32 Zac Medico
2012-06-20 10:06 Zac Medico
2012-06-20  9:53 Zac Medico
2012-06-14  0:24 Zac Medico
2012-05-13  6:23 Zac Medico
2011-12-11  0:22 Zac Medico
2011-11-07 21:38 Zac Medico
2011-10-02  2:14 Zac Medico
2011-09-22 19:07 Zac Medico
2011-09-22 18:19 Zac Medico
2011-09-18 20:08 Zac Medico
2011-09-11 18:50 Zac Medico
2011-09-05 22:44 Zac Medico
2011-08-29  6:19 Zac Medico
2011-06-04  3:08 Zac Medico
2011-05-30 23:44 Zac Medico
2011-05-30 22:58 Zac Medico
2011-05-23  5:59 Zac Medico
2011-05-23  0:46 Zac Medico
2011-05-22 22:01 Zac Medico
2011-05-22 20:36 Zac Medico
2011-05-22 20:03 Zac Medico
2011-05-22 19:44 Zac Medico
2011-05-22 17:03 Zac Medico
2011-05-22  9:05 Zac Medico
2011-05-21 22:37 Zac Medico
2011-05-21 22:17 Zac Medico
2011-05-21 10:34 Zac Medico
2011-05-21 10:30 Zac Medico
2011-05-21  9:21 Zac Medico
2011-05-21  9:11 Zac Medico
2011-05-21  8:47 Zac Medico
2011-05-21  4:15 Zac Medico
2011-05-21  4:02 Zac Medico
2011-05-21  3:30 Zac Medico
2011-05-21  1:17 Zac Medico
2011-05-21  1:13 Zac Medico
2011-05-21  1:01 Zac Medico
2011-05-21  0:51 Zac Medico
2011-05-17 20:34 Zac Medico
2011-05-04 17:36 Zac Medico
2011-02-17 10:43 Zac Medico
2011-02-13 17:35 Zac Medico
2011-02-13 13:01 Zac Medico
2011-02-13 11:35 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox