Deprecate the manifest1_compat parameter. v2.2.0_alpha56
authorZac Medico <zmedico@gentoo.org>
Wed, 14 Sep 2011 04:49:23 +0000 (21:49 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 14 Sep 2011 04:49:23 +0000 (21:49 -0700)
bin/ebuild
pym/portage/manifest.py
pym/portage/package/ebuild/digestgen.py

index 95f4e15b876867745080d7d00dece124487dcf5e..f47975aad9b28d88bbf9aeeb6f21cf2f1262f352 100755 (executable)
@@ -204,7 +204,7 @@ def discard_digests(myebuild, mysettings, mydbapi):
                mf = mysettings.repositories.get_repo_for_location(
                        os.path.dirname(os.path.dirname(pkgdir)))
                mf = mf.load_manifest(pkgdir, mysettings["DISTDIR"],
-                       fetchlist_dict=fetchlist_dict, manifest1_compat=False)
+                       fetchlist_dict=fetchlist_dict)
                mf.create(requiredDistfiles=None,
                        assumeDistHashesSometimes=True, assumeDistHashesAlways=True)
                distfiles = fetchlist_dict[cpv]
index 4fd44b0591eafd52cd21fe85daefabaf89a6e062..3f0aa932709c6bf070f2984ab4adbe132917fa31 100644 (file)
@@ -3,6 +3,7 @@
 
 import errno
 import io
+import warnings
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
@@ -99,25 +100,26 @@ class Manifest2Entry(ManifestEntry):
 class Manifest(object):
        parsers = (parseManifest2,)
        def __init__(self, pkgdir, distdir, fetchlist_dict=None,
-               manifest1_compat=False, from_scratch=False, thin=False):
-               """ create new Manifest instance for package in pkgdir
-                   and add compability entries for old portage versions if manifest1_compat == True.
+               manifest1_compat=DeprecationWarning, from_scratch=False, thin=False):
+               """ Create new Manifest instance for package in pkgdir.
                    Do not parse Manifest file if from_scratch == True (only for internal use)
                        The fetchlist_dict parameter is required only for generation of
                        a Manifest (not needed for parsing and checking sums).
                        If thin is specified, then the manifest carries only info for
                        distfiles."""
+
+               if manifest1_compat is not DeprecationWarning:
+                       warnings.warn("The manifest1_compat parameter of the "
+                               "portage.manifest.Manifest constructor is deprecated.",
+                               DeprecationWarning, stacklevel=2)
+
                self.pkgdir = _unicode_decode(pkgdir).rstrip(os.sep) + os.sep
                self.fhashdict = {}
                self.hashes = set()
                self.hashes.update(portage.const.MANIFEST2_HASH_FUNCTIONS)
-               if manifest1_compat:
-                       raise NotImplementedError("manifest1 support has been removed")
                self.hashes.difference_update(hashname for hashname in \
                        list(self.hashes) if hashname not in hashfunc_map)
                self.hashes.add("size")
-               if manifest1_compat:
-                       raise NotImplementedError("manifest1 support has been removed")
                self.hashes.add(portage.const.MANIFEST2_REQUIRED_HASH)
                for t in portage.const.MANIFEST2_IDENTIFIERS:
                        self.fhashdict[t] = {}
@@ -325,7 +327,7 @@ class Manifest(object):
                        distfilehashes = {}
                self.__init__(self.pkgdir, self.distdir,
                        fetchlist_dict=self.fetchlist_dict, from_scratch=True,
-                       manifest1_compat=False, thin=self.thin)
+                       thin=self.thin)
                pn = os.path.basename(self.pkgdir.rstrip(os.path.sep))
                cat = self._pkgdir_category()
 
index 605151263dae70faf2fbbf2c9a3f11d5991d784c..7b589720230045d5ba1df53f22832926ad99cffe 100644 (file)
@@ -52,10 +52,9 @@ def digestgen(myarchives=None, mysettings=None, myportdb=None):
                                del e
                                return 0
                mytree = os.path.dirname(os.path.dirname(mysettings["O"]))
-               manifest1_compat = False
                mf = mysettings.repositories.get_repo_for_location(mytree)
                mf = mf.load_manifest(mysettings["O"], mysettings["DISTDIR"],
-                       fetchlist_dict=fetchlist_dict, manifest1_compat=manifest1_compat)
+                       fetchlist_dict=fetchlist_dict)
                # Don't require all hashes since that can trigger excessive
                # fetches when sufficient digests already exist.  To ease transition
                # while Manifest 1 is being removed, only require hashes that will