public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r11573 - in main/trunk/pym: _emerge portage portage/dbapi
@ 2008-09-27 19:24 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-09-27 19:24 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-09-27 19:24:10 +0000 (Sat, 27 Sep 2008)
New Revision: 11573

Modified:
   main/trunk/pym/_emerge/__init__.py
   main/trunk/pym/portage/__init__.py
   main/trunk/pym/portage/dbapi/porttree.py
Log:
Mask packages with deprecated EAPIs in order to prevent them from being
installed. Such packages will still behave normally if they are already
installed, but preventing new installation will remind people to update
the EAPIs in their overlays if necessary.


Modified: main/trunk/pym/_emerge/__init__.py
===================================================================
--- main/trunk/pym/_emerge/__init__.py	2008-09-27 16:14:37 UTC (rev 11572)
+++ main/trunk/pym/_emerge/__init__.py	2008-09-27 19:24:10 UTC (rev 11573)
@@ -1245,11 +1245,14 @@
 	if pkg.built and not pkg.installed and "CHOST" in pkg.metadata:
 		if not pkgsettings._accept_chost(pkg):
 			return False
-	if not portage.eapi_is_supported(pkg.metadata["EAPI"]):
+	eapi = pkg.metadata["EAPI"]
+	if not portage.eapi_is_supported(eapi):
 		return False
-	if not pkg.installed and \
-		pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata):
-		return False
+	if not pkg.installed:
+		if portage._eapi_is_deprecated(eapi):
+			return False
+		if pkgsettings._getMissingKeywords(pkg.cpv, pkg.metadata):
+			return False
 	if pkgsettings._getMaskAtom(pkg.cpv, pkg.metadata):
 		return False
 	if pkgsettings._getProfileMaskAtom(pkg.cpv, pkg.metadata):

Modified: main/trunk/pym/portage/__init__.py
===================================================================
--- main/trunk/pym/portage/__init__.py	2008-09-27 16:14:37 UTC (rev 11572)
+++ main/trunk/pym/portage/__init__.py	2008-09-27 19:24:10 UTC (rev 11573)
@@ -4578,10 +4578,15 @@
 			eerror(l, phase=mydo, key=mysettings.mycpv)
 	return rval
 
+_deprecated_eapis = frozenset(["2_pre3", "2_pre2", "2_pre1"])
+
+def _eapi_is_deprecated(eapi):
+	return eapi in _deprecated_eapis
+
 def eapi_is_supported(eapi):
 	eapi = str(eapi).strip()
 
-	if eapi in ("2_pre3", "2_pre2", "2_pre1"):
+	if _eapi_is_deprecated(eapi):
 		return True
 
 	try:
@@ -6758,6 +6763,8 @@
 		eapi = eapi[1:]
 	if not eapi_is_supported(eapi):
 		return ["EAPI %s" % eapi]
+	elif _eapi_is_deprecated(eapi) and not installed:
+		return ["EAPI %s" % eapi]
 	egroups = settings.configdict["backupenv"].get(
 		"ACCEPT_KEYWORDS", "").split()
 	mygroups = mygroups.split()

Modified: main/trunk/pym/portage/dbapi/porttree.py
===================================================================
--- main/trunk/pym/portage/dbapi/porttree.py	2008-09-27 16:14:37 UTC (rev 11572)
+++ main/trunk/pym/portage/dbapi/porttree.py	2008-09-27 19:24:10 UTC (rev 11573)
@@ -20,7 +20,8 @@
 import portage.gpg, portage.checksum
 
 from portage import eclass_cache, auxdbkeys, doebuild, flatten, \
-	listdir, dep_expand, eapi_is_supported, key_expand, dep_check
+	listdir, dep_expand, eapi_is_supported, key_expand, dep_check, \
+	_eapi_is_deprecated
 
 import os, stat
 from itertools import izip
@@ -917,8 +918,11 @@
 				writemsg("!!! %s\n" % str(e), noiselevel=-1)
 				del e
 				continue
-			if not eapi_is_supported(metadata["EAPI"]):
+			eapi = metadata["EAPI"]
+			if not eapi_is_supported(eapi):
 				continue
+			if _eapi_is_deprecated(eapi):
+				continue
 			if self.mysettings._getMissingKeywords(mycpv, metadata):
 				continue
 			if local_config:




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-27 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-27 19:24 [gentoo-commits] portage r11573 - in main/trunk/pym: _emerge portage portage/dbapi Zac Medico (zmedico)

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