In portdbapi.aux_get(), simplify code by using string
authorZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 08:19:42 +0000 (08:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 08:19:42 +0000 (08:19 -0000)
manipulation instead of int conversion to manipulate
negative EAPI when deciding whether or not regen is
necessary.

svn path=/main/trunk/; revision=7919

pym/portage/dbapi/porttree.py

index 824d1afc437f5201071e741223b18409074c9320..03550033ab2d09b198c3439e7db76568c5920d34 100644 (file)
@@ -284,15 +284,8 @@ class portdbapi(dbapi):
                        mydata = self.auxdb[mylocation][mycpv]
                        eapi = mydata.get("EAPI","").strip()
                        if not eapi:
-                               eapi = 0
-                       try:
-                               eapi = int(eapi)
-                       except ValueError:
-                               # Non-integer EAPI isn't supported. In case it's supported in
-                               # the future, assume that it's valid (rather than trigger a
-                               # regen).
-                               eapi = None
-                       if eapi is not None and eapi < 0 and eapi_is_supported(-eapi):
+                               eapi = "0"
+                       if eapi.startswith("-") and eapi_is_supported(eapi[1:]):
                                doregen = True
                        elif emtime != long(mydata.get("_mtime_", 0)):
                                doregen = True