* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, bin/, pym/portage/
@ 2011-09-14 4:49 Zac Medico
0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2011-09-14 4:49 UTC (permalink / raw
To: gentoo-commits
commit: 05f5e7f26b92f534ffa0be28ec0a4ff58c0b0d6b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 04:49:23 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 04:49:23 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=05f5e7f2
Deprecate the manifest1_compat parameter.
---
bin/ebuild | 2 +-
pym/portage/manifest.py | 18 ++++++++++--------
pym/portage/package/ebuild/digestgen.py | 3 +--
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/bin/ebuild b/bin/ebuild
index 95f4e15..f47975a 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -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]
diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py
index 4fd44b0..3f0aa93 100644
--- a/pym/portage/manifest.py
+++ b/pym/portage/manifest.py
@@ -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()
diff --git a/pym/portage/package/ebuild/digestgen.py b/pym/portage/package/ebuild/digestgen.py
index 6051512..7b58972 100644
--- a/pym/portage/package/ebuild/digestgen.py
+++ b/pym/portage/package/ebuild/digestgen.py
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, bin/, pym/portage/
@ 2012-03-12 4:42 Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2012-03-12 4:42 UTC (permalink / raw
To: gentoo-commits
commit: 6e4f1bd23cbb3332fa1d4f1e570420b743e01296
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 11 04:15:31 2012 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Mar 11 19:41:42 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6e4f1bd2
portageq: add "colormap" helper
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
---
bin/isolated-functions.sh | 2 +-
bin/portageq | 8 ++++++++
pym/portage/output.py | 6 ++++++
pym/portage/package/ebuild/doebuild.py | 8 ++------
4 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 9321ad5..98be41e 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -431,8 +431,8 @@ set_colors() {
BAD=$'\e[31;01m'
HILITE=$'\e[36;01m'
BRACKET=$'\e[34;01m'
+ NORMAL=$'\e[0m'
fi
- NORMAL=$'\e[0m'
}
RC_ENDCOL="yes"
diff --git a/bin/portageq b/bin/portageq
index 5ecbb21..fcdb9d9 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -44,6 +44,7 @@ del pym_path
from portage import os
from portage.eapi import eapi_has_repo_deps
from portage.util import writemsg, writemsg_stdout
+from portage.output import colormap
portage.proxy.lazyimport.lazyimport(globals(),
'subprocess',
'_emerge.Package:Package',
@@ -685,6 +686,13 @@ def distdir(argv):
print(portage.settings["DISTDIR"])
+def colormap(argv):
+ """
+ Display the color.map as environment variables.
+ """
+ print(portage.output.colormap())
+
+
def envvar(argv):
"""<variable>+
Returns a specific environment variable as exists prior to ebuild.sh.
diff --git a/pym/portage/output.py b/pym/portage/output.py
index 43d7503..98bec81 100644
--- a/pym/portage/output.py
+++ b/pym/portage/output.py
@@ -325,6 +325,12 @@ def style_to_ansi_code(style):
ret += codes.get(attr_name, attr_name)
return ret
+def colormap():
+ mycolors = []
+ for c in ("GOOD", "WARN", "BAD", "HILITE", "BRACKET", "NORMAL"):
+ mycolors.append("%s=$'%s'" % (c, style_to_ansi_code(c)))
+ return "\n".join(mycolors)
+
def colorize(color_key, text):
global havecolor
if havecolor:
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index c45aa03..4ff3eea 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -50,7 +50,7 @@ from portage.exception import DigestException, FileNotFound, \
IncorrectParameter, InvalidDependString, PermissionDenied, \
UnsupportedAPIException
from portage.localization import _
-from portage.output import style_to_ansi_code
+from portage.output import colormap
from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
from portage.util import apply_recursive_permissions, \
apply_secpass_permissions, noiselimit, normalize_path, \
@@ -300,11 +300,7 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
mysettings["PORTAGE_CONFIGROOT"], EBUILD_SH_ENV_DIR)
# Allow color.map to control colors associated with einfo, ewarn, etc...
- mycolors = []
- for c in ("GOOD", "WARN", "BAD", "HILITE", "BRACKET"):
- mycolors.append("%s=$'%s'" % \
- (c, style_to_ansi_code(c)))
- mysettings["PORTAGE_COLORMAP"] = "\n".join(mycolors)
+ mysettings["PORTAGE_COLORMAP"] = colormap()
if "COLUMNS" not in mysettings:
# Set COLUMNS, in order to prevent unnecessary stty calls
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-12 4:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-12 4:42 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, bin/, pym/portage/ Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2011-09-14 4:49 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox