Brian Harring wrote:
Please test this out; if you want to test the EAPI checking, tag
EAPI=1 into an ebuild, and try making emerge bail.
Well, it bails too often. :)
It seems that an explicit integer conversion is needed for > and < comparisons with mixed types (2.0.51-eapi-awareness-emerge-int-conversion.patch).
If you're less adventurous, please test the compatibility cache
testing;
in /etc/portage/modules
portdbapi.metadbmodule=portage_db_metadata.database
We need to make sure EAPI defaults to 0 when using old metadata. It seems like
db_template.__getitem__() is a nice central place to do that
(2.0.51-eapi-awareness-db_template.patch). I made another patch for
bindbapi.aux_get() which does the same for old metadata from binpkgs
(2.0.51-eapi-awareness-bindbapi.aux_get.patch).
Zac
Index: portage-2.0.51.22/bin/emerge
===================================================================
--- portage-2.0.51.22.orig/bin/emerge
+++ portage-2.0.51.22/bin/emerge
@@ -1523,7 +1523,7 @@ class depgraph:
sys.exit(1)
if source:
needed = portage.db[x[1]][source].dbapi.aux_get(x[2], ["EAPI"])[0]
- if needed > portage.EAPI:
+ if int(needed) > portage.EAPI:
print '[%s] %s %s, EAPI:%i installed portage EAPI:%i' % (x[0].ljust(13), x[2], red("UNMERGABLE"),needed, portage.EAPI)
stupid_if_logic_hack = True
@@ -1856,7 +1856,7 @@ class depgraph:
print "EAPI check, unknown source "+str(source)+" for "+cpv+", this shouldn't occur",mymergelist
sys.exit(1)
needed = portage.db[root][source].dbapi.aux_get(cpv, ["EAPI"])[0]
- if portage.EAPI < needed:
+ if portage.EAPI < int(needed):
unmergable.append((needed, cpv))
if len(unmergable):
Index: portage-2.0.51.22/pym/portage_db_template.py
===================================================================
--- portage-2.0.51.22.orig/pym/portage_db_template.py
+++ portage-2.0.51.22/pym/portage_db_template.py
@@ -71,6 +71,10 @@ class database:
if self.has_key(key):
try:
values = self.get_values(key)
+ values.setdefault("EAPI","0")
+ if values["EAPI"]=="":
+ # for backward compatibility with old metadata from various sources
+ values["EAPI"]="0"
self.__addCache(key,values)
return values
except SystemExit, e:
Index: portage-2.0.51.22/pym/portage.py
===================================================================
--- portage-2.0.51.22.orig/pym/portage.py
+++ portage-2.0.51.22/pym/portage.py
@@ -4517,13 +4517,18 @@ class bindbapi(fakedbapi):
if self.bintree.remotepkgs[tbz2name].has_key(x):
mylist.append(self.bintree.remotepkgs[tbz2name][x][:]) # [:] Copy String
else:
- mylist.append("")
+ if x=="EAPI":
+ mylist.append("0")
+ else:
+ mylist.append("")
else:
myval = tbz2.getfile(x)
if myval == None:
myval = ""
else:
myval = string.join(myval.split(),' ')
+ if x=="EAPI" and myval=="":
+ myval="0"
mylist.append(myval)
return mylist