aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-11-27 16:23:46 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-11-27 16:23:46 (GMT)
commit02a6bf1ac95861831a303f220c7a41b9bbd398ab (patch)
tree8eab7c2cfaa3d85bcfdb3fc94979d6929484f5d4
parentegencache: enable md5-dict format by default (diff)
downloadportage-02a6bf1ac95861831a303f220c7a41b9bbd398ab.zip
portage-02a6bf1ac95861831a303f220c7a41b9bbd398ab.tar.gz
portage-02a6bf1ac95861831a303f220c7a41b9bbd398ab.tar.bz2
portdbapi: DeprecationWarning for 'pms' cache
-rw-r--r--pym/portage/dbapi/porttree.py7
-rw-r--r--pym/portage/repository/config.py2
-rw-r--r--pym/portage/tests/dbapi/test_portdb_cache.py8
-rw-r--r--pym/portage/tests/emerge/test_simple.py2
4 files changed, 14 insertions, 5 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 115fc7f..9f0140c 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -204,6 +204,13 @@ class portdbapi(dbapi):
cache.ec = self.repositories.get_repo_for_location(tree).eclass_db
except AttributeError:
pass
+
+ if not cache.complete_eclass_entries:
+ warnings.warn(
+ ("Repository '%s' used deprecated 'pms' cache format. "
+ "Please migrate to 'md5-dict' format.") % (conf.name,),
+ DeprecationWarning)
+
return cache
def _init_cache_dirs(self):
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 246be0e..3d29fd9 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -201,7 +201,7 @@ class RepoConfig(object):
if not force:
return
# The default egencache format was 'pms' prior to portage-2.1.11.32
- # (portage versions ersions prior to portage-2.1.11.14 will NOT
+ # (portage versions prior to portage-2.1.11.14 will NOT
# recognize md5-dict format unless it is explicitly listed in
# layout.conf).
formats = ('md5-dict',)
diff --git a/pym/portage/tests/dbapi/test_portdb_cache.py b/pym/portage/tests/dbapi/test_portdb_cache.py
index 3290d08..67b961a 100644
--- a/pym/portage/tests/dbapi/test_portdb_cache.py
+++ b/pym/portage/tests/dbapi/test_portdb_cache.py
@@ -82,15 +82,17 @@ class PortdbCacheTestCase(TestCase):
sys.exit(1)
"""),),
+ # Don't use python -Wd, since the pms format triggers deprecation warnings
+ # in portdbapi._create_pregen_cache().
(BASH_BINARY, "-c", "echo %s > %s" %
tuple(map(portage._shell_quote,
("cache-formats = pms md5-dict", layout_conf_path,)))),
- python_cmd + (textwrap.dedent("""
+ (portage_python, "-c") + (textwrap.dedent("""
import os, sys, portage
if portage.portdb.porttree_root not in portage.portdb._pregen_auxdb:
sys.exit(1)
"""),),
- python_cmd + (textwrap.dedent("""
+ (portage_python, "-c") + (textwrap.dedent("""
import os, sys, portage
from portage.cache.metadata import database as pms_database
if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.porttree_root], pms_database):
@@ -173,6 +175,6 @@ class PortdbCacheTestCase(TestCase):
sys.stderr.write(_unicode_decode(line))
self.assertEqual(os.EX_OK, proc.returncode,
- "command failed with args %s" % (args,))
+ "command %d failed with args %s" % (i, args,))
finally:
playground.cleanup()
diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py
index 56fbdb3..a22e2b3 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -162,7 +162,7 @@ pkg_preinst() {
portdir = settings["PORTDIR"]
var_cache_edb = os.path.join(eprefix, "var", "cache", "edb")
cachedir = os.path.join(var_cache_edb, "dep")
- cachedir_pregen = os.path.join(portdir, "metadata", "cache")
+ cachedir_pregen = os.path.join(portdir, "metadata", "md5-cache")
portage_python = portage._python_interpreter
ebuild_cmd = (portage_python, "-Wd",