* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/package/ebuild/
@ 2011-02-04 17:47 zmedico
0 siblings, 0 replies; 6+ messages in thread
From: zmedico @ 2011-02-04 17:47 UTC (permalink / raw
To: gentoo-commits
commit: aa5481cdb2151dcb327c04a3e8ab48a23f92600f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 4 17:17:46 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 4 17:46:12 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aa5481cdb2151dcb327c04a3e8ab48a23f92600f
ebuild(1): ensure REQUIRED_USE is satisfied
---
pym/portage/package/ebuild/doebuild.py | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index bbc3a4a..2eb9f11 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -39,9 +39,10 @@ from portage.data import portage_gid, portage_uid, secpass, \
uid, userpriv_groups
from portage.dbapi.porttree import _parse_uri_map
from portage.dbapi.virtual import fakedbapi
-from portage.dep import Atom, paren_enclose, use_reduce
+from portage.dep import Atom, check_required_use, \
+ human_readable_required_use, paren_enclose, use_reduce
from portage.eapi import eapi_exports_KV, eapi_exports_merge_type, \
- eapi_exports_replace_vars, \
+ eapi_exports_replace_vars, eapi_has_required_use, \
eapi_has_src_prepare_and_src_configure, eapi_has_pkg_pretend
from portage.elog import elog_process
from portage.elog.messages import eerror, eqawarn
@@ -1056,6 +1057,28 @@ def _validate_deps(mysettings, myroot, mydo, mydbapi):
if mydo not in invalid_dep_exempt_phases:
return 1
+ if not pkg.built and pkg.metadata["REQUIRED_USE"] and \
+ eapi_has_required_use(pkg.metadata["EAPI"]):
+ result = check_required_use(pkg.metadata["REQUIRED_USE"],
+ pkg.use.enabled, pkg.iuse.is_valid_flag)
+ if not result:
+ reduced_noise = result.tounicode()
+ writemsg("\n %s\n" % _("The following REQUIRED_USE flag" + \
+ " constraints are unsatisfied:"), noiselevel=-1)
+ writemsg(" %s\n" % reduced_noise,
+ noiselevel=-1)
+ normalized_required_use = \
+ " ".join(pkg.metadata["REQUIRED_USE"].split())
+ if reduced_noise != normalized_required_use:
+ writemsg("\n %s\n" % _("The above constraints " + \
+ "are a subset of the following complete expression:"),
+ noiselevel=-1)
+ writemsg(" %s\n" % \
+ human_readable_required_use(normalized_required_use),
+ noiselevel=-1)
+ writemsg("\n", noiselevel=-1)
+ return 1
+
return os.EX_OK
# XXX This would be to replace getstatusoutput completely.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/package/ebuild/
@ 2011-02-04 17:47 zmedico
0 siblings, 0 replies; 6+ messages in thread
From: zmedico @ 2011-02-04 17:47 UTC (permalink / raw
To: gentoo-commits
commit: 51e6dfb76d9051d1f0190a2cdb0e4e7a04a6f5b7
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 4 17:23:12 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 4 17:46:17 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=51e6dfb76d9051d1f0190a2cdb0e4e7a04a6f5b7
ebuild(1): skip REQUIRED_USE for some phases
---
pym/portage/package/ebuild/doebuild.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 2eb9f11..5272f23 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1057,7 +1057,9 @@ def _validate_deps(mysettings, myroot, mydo, mydbapi):
if mydo not in invalid_dep_exempt_phases:
return 1
- if not pkg.built and pkg.metadata["REQUIRED_USE"] and \
+ if not pkg.built and \
+ mydo not in ("digest", "help", "manifest") and \
+ pkg.metadata["REQUIRED_USE"] and \
eapi_has_required_use(pkg.metadata["EAPI"]):
result = check_required_use(pkg.metadata["REQUIRED_USE"],
pkg.use.enabled, pkg.iuse.is_valid_flag)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/package/ebuild/
@ 2011-03-14 16:24 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2011-03-14 16:24 UTC (permalink / raw
To: gentoo-commits
commit: 47500360b3063b114904c0a7dc4817a2ac6390d4
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 4 16:39:53 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 14 16:21:28 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=47500360
config: quote overlays containing spaces
This will fix bug #357297.
---
pym/portage/package/ebuild/config.py | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index b63cff1..6981e24 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -501,21 +501,24 @@ class config(object):
self._ppropertiesdict = portage.dep.ExtendedAtomDict(dict)
self._penvdict = portage.dep.ExtendedAtomDict(dict)
- """ repoman controls PORTDIR_OVERLAY via the environment, so no
- special cases are needed here."""
-
- overlays = shlex_split(self.get('PORTDIR_OVERLAY', ''))
- if overlays:
- new_ov = []
- for ov in overlays:
+ # repoman controls PORTDIR_OVERLAY via the environment, so no
+ # special cases are needed here.
+ portdir_overlay = shlex_split(self.get("PORTDIR_OVERLAY", ""))
+ new_ov = []
+ if portdir_overlay:
+ whitespace_re = re.compile(r"\s")
+ for ov in portdir_overlay:
ov = normalize_path(ov)
if os.path.isdir(ov):
+ if whitespace_re.search(ov) is not None:
+ ov = portage._shell_quote(ov)
new_ov.append(ov)
else:
writemsg(_("!!! Invalid PORTDIR_OVERLAY"
" (not a dir): '%s'\n") % ov, noiselevel=-1)
- self["PORTDIR_OVERLAY"] = " ".join(new_ov)
- self.backup_changes("PORTDIR_OVERLAY")
+
+ self["PORTDIR_OVERLAY"] = " ".join(new_ov)
+ self.backup_changes("PORTDIR_OVERLAY")
locations_manager.set_port_dirs(self["PORTDIR"], self["PORTDIR_OVERLAY"])
@@ -2129,7 +2132,7 @@ class config(object):
def thirdpartymirrors(self):
if getattr(self, "_thirdpartymirrors", None) is None:
profileroots = [os.path.join(self["PORTDIR"], "profiles")]
- for x in self["PORTDIR_OVERLAY"].split():
+ for x in shlex_split(self.get("PORTDIR_OVERLAY", "")):
profileroots.insert(0, os.path.join(x, "profiles"))
thirdparty_lists = [grabdict(os.path.join(x, "thirdpartymirrors")) for x in profileroots]
self._thirdpartymirrors = stack_dictlist(thirdparty_lists, incremental=True)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/package/ebuild/
@ 2011-05-04 20:03 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2011-05-04 20:03 UTC (permalink / raw
To: gentoo-commits
commit: a841472cea6bf13abc9bf653fbb2ee884e2266f2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 28 21:31:03 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 4 19:37:35 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a841472c
_postinst_bsdflags: apply to $ROOT, not $D
---
pym/portage/package/ebuild/doebuild.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 2a40791..1c04822 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1406,7 +1406,7 @@ def _postinst_bsdflags(mysettings):
if bsd_chflags:
# Restore all of the flags saved above.
os.system("mtree -e -p %s -U -k flags < %s > /dev/null" % \
- (_shell_quote(mysettings["D"]),
+ (_shell_quote(mysettings["ROOT"]),
_shell_quote(os.path.join(mysettings["T"], "bsdflags.mtree"))))
def _post_src_install_uid_fix(mysettings, out):
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/package/ebuild/
@ 2011-05-12 5:24 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2011-05-12 5:24 UTC (permalink / raw
To: gentoo-commits
commit: e81ab80f73d71b6687428ed07cac01a42c484b29
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 9 20:41:56 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 12 05:09:55 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e81ab80f
config: call _populate_treeVirtuals directly
---
pym/portage/package/ebuild/config.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 13a91f9..c26e7fe 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -1966,7 +1966,7 @@ class config(object):
"""Reduce the provides into a list by CP."""
if self._virtuals_manager._treeVirtuals is None:
if self.local_config:
- self._virtuals_manager.populate_treeVirtuals_if_needed(vartree)
+ self._virtuals_manager._populate_treeVirtuals(vartree)
else:
self._virtuals_manager._treeVirtuals = {}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/package/ebuild/
@ 2011-05-26 6:18 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2011-05-26 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 36337a64cb3b254ad69482ed4e955d83dd965e22
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 24 03:02:30 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 04:27:39 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=36337a64
doebuild_environment: move EAPI code later
All EAPI dependent code comes last, so that essential
variables like PORTAGE_BUILDDIR are still initialized even in
cases when UnsupportedAPIException needs to be raised, which
can be useful when uninstalling a package that has corrupt
EAPI metadata.
---
pym/portage/package/ebuild/doebuild.py | 121 +++++++++++++++++--------------
1 files changed, 66 insertions(+), 55 deletions(-)
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index f83a1e3..4cdd765 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -119,6 +119,14 @@ def _spawn_phase(phase, settings, actionmap=None, **kwargs):
def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
debug=False, use_cache=None, db=None):
"""
+ Create and store environment variable in the config instance
+ that's passed in as the "settings" parameter. This will raise
+ UnsupportedAPIException if the given ebuild has an unsupported
+ EAPI. All EAPI dependent code comes last, so that essential
+ variables like PORTAGE_BUILDDIR are still initialized even in
+ cases when UnsupportedAPIException needs to be raised, which
+ can be useful when uninstalling a package that has corrupt
+ EAPI metadata.
The myroot and use_cache parameters are unused.
"""
myroot = None
@@ -141,7 +149,6 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
else:
cat = os.path.basename(normalize_path(os.path.join(pkg_dir, "..")))
- eapi = None
mypv = os.path.basename(ebuild_path)[:-7]
mycpv = cat+"/"+mypv
@@ -222,50 +229,6 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
if noiselimit < 0:
mysettings["PORTAGE_QUIET"] = "1"
- if mydo == 'depend' and 'EAPI' not in mysettings.configdict['pkg']:
- if eapi is None and 'parse-eapi-ebuild-head' in mysettings.features:
- eapi = _parse_eapi_ebuild_head(
- codecs.open(_unicode_encode(ebuild_path,
- encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['content'], errors='replace'))
-
- if eapi is not None:
- if not eapi_is_supported(eapi):
- raise UnsupportedAPIException(mycpv, eapi)
- mysettings.configdict['pkg']['EAPI'] = eapi
-
- if mydo != "depend":
- # Metadata vars such as EAPI and RESTRICT are
- # set by the above config.setcpv() call.
- eapi = mysettings["EAPI"]
- if not eapi_is_supported(eapi):
- # can't do anything with this.
- raise UnsupportedAPIException(mycpv, eapi)
-
- if hasattr(mydbapi, "getFetchMap") and \
- ("A" not in mysettings.configdict["pkg"] or \
- "AA" not in mysettings.configdict["pkg"]):
- src_uri, = mydbapi.aux_get(mysettings.mycpv,
- ["SRC_URI"], mytree=mytree)
- metadata = {
- "EAPI" : eapi,
- "SRC_URI" : src_uri,
- }
- use = frozenset(mysettings["PORTAGE_USE"].split())
- try:
- uri_map = _parse_uri_map(mysettings.mycpv, metadata, use=use)
- except InvalidDependString:
- mysettings.configdict["pkg"]["A"] = ""
- else:
- mysettings.configdict["pkg"]["A"] = " ".join(uri_map)
-
- try:
- uri_map = _parse_uri_map(mysettings.mycpv, metadata)
- except InvalidDependString:
- mysettings.configdict["pkg"]["AA"] = ""
- else:
- mysettings.configdict["pkg"]["AA"] = " ".join(uri_map)
-
if mysplit[2] == "r0":
mysettings["PVR"]=mysplit[1]
else:
@@ -311,7 +274,62 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
mysettings["PM_EBUILD_HOOK_DIR"] = os.path.join(
mysettings["PORTAGE_CONFIGROOT"], EBUILD_SH_ENV_DIR)
- #set up KV variable -- DEP SPEEDUP :: Don't waste time. Keep var persistent.
+ # 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)
+
+ # All EAPI dependent code comes last, so that essential variables
+ # like PORTAGE_BUILDDIR are still initialized even in cases when
+ # UnsupportedAPIException needs to be raised, which can be useful
+ # when uninstalling a package that has corrupt EAPI metadata.
+ eapi = None
+ if mydo == 'depend' and 'EAPI' not in mysettings.configdict['pkg']:
+ if eapi is None and 'parse-eapi-ebuild-head' in mysettings.features:
+ eapi = _parse_eapi_ebuild_head(
+ codecs.open(_unicode_encode(ebuild_path,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['content'], errors='replace'))
+
+ if eapi is not None:
+ if not eapi_is_supported(eapi):
+ raise UnsupportedAPIException(mycpv, eapi)
+ mysettings.configdict['pkg']['EAPI'] = eapi
+
+ if mydo != "depend":
+ # Metadata vars such as EAPI and RESTRICT are
+ # set by the above config.setcpv() call.
+ eapi = mysettings["EAPI"]
+ if not eapi_is_supported(eapi):
+ # can't do anything with this.
+ raise UnsupportedAPIException(mycpv, eapi)
+
+ if hasattr(mydbapi, "getFetchMap") and \
+ ("A" not in mysettings.configdict["pkg"] or \
+ "AA" not in mysettings.configdict["pkg"]):
+ src_uri, = mydbapi.aux_get(mysettings.mycpv,
+ ["SRC_URI"], mytree=mytree)
+ metadata = {
+ "EAPI" : eapi,
+ "SRC_URI" : src_uri,
+ }
+ use = frozenset(mysettings["PORTAGE_USE"].split())
+ try:
+ uri_map = _parse_uri_map(mysettings.mycpv, metadata, use=use)
+ except InvalidDependString:
+ mysettings.configdict["pkg"]["A"] = ""
+ else:
+ mysettings.configdict["pkg"]["A"] = " ".join(uri_map)
+
+ try:
+ uri_map = _parse_uri_map(mysettings.mycpv, metadata)
+ except InvalidDependString:
+ mysettings.configdict["pkg"]["AA"] = ""
+ else:
+ mysettings.configdict["pkg"]["AA"] = " ".join(uri_map)
+
if not eapi_exports_KV(eapi):
# Discard KV for EAPIs that don't support it. Cache KV is restored
# from the backupenv whenever config.reset() is called.
@@ -324,18 +342,11 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
os.path.join(mysettings['EROOT'], "usr/src/linux"))
if mykv:
# Regular source tree
- mysettings["KV"]=mykv
+ mysettings["KV"] = mykv
else:
- mysettings["KV"]=""
+ mysettings["KV"] = ""
mysettings.backup_changes("KV")
- # 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)
-
_doebuild_manifest_cache = None
_doebuild_broken_ebuilds = set()
_doebuild_broken_manifests = set()
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-26 6:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-12 5:24 [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/package/ebuild/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2011-05-26 6:18 Zac Medico
2011-05-04 20:03 Zac Medico
2011-03-14 16:24 Zac Medico
2011-02-04 17:47 zmedico
2011-02-04 17:47 zmedico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox