* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2011-06-06 16:00 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 10+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-06-06 16:00 UTC (permalink / raw
To: gentoo-commits
commit: c04c2543225e7089d17b4b11f5460643965ac653
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Mon Jun 6 16:00:40 2011 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Mon Jun 6 16:00:40 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c04c2543
Fix some typos.
---
pym/_emerge/depgraph.py | 2 +-
pym/_emerge/unmerge.py | 2 +-
pym/portage/package/ebuild/getmaskingreason.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 64fe9c9..b9a394e 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4223,7 +4223,7 @@ class depgraph(object):
if True:
# Pull in blockers from all installed packages that haven't already
- # been pulled into the depgraph, in order to ensure that the are
+ # been pulled into the depgraph, in order to ensure that they are
# respected (bug 128809). Due to the performance penalty that is
# incurred by all the additional dep_check calls that are required,
# blockers returned from dep_check are cached on disk by the
diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py
index 9f348a3..38f3515 100644
--- a/pym/_emerge/unmerge.py
+++ b/pym/_emerge/unmerge.py
@@ -25,7 +25,7 @@ def _unmerge_display(root_config, myopts, unmerge_action,
writemsg_level=portage.util.writemsg_level):
"""
Returns a tuple of (returncode, pkgmap) where returncode is
- os.EX_OK is no errors occur, and 1 otherwise.
+ os.EX_OK if no errors occur, and 1 otherwise.
"""
quiet = "--quiet" in myopts
diff --git a/pym/portage/package/ebuild/getmaskingreason.py b/pym/portage/package/ebuild/getmaskingreason.py
index c19066f..f027876 100644
--- a/pym/portage/package/ebuild/getmaskingreason.py
+++ b/pym/portage/package/ebuild/getmaskingreason.py
@@ -17,7 +17,7 @@ from _emerge.Package import Package
def getmaskingreason(mycpv, metadata=None, settings=None,
portdb=None, return_location=False, myrepo=None):
"""
- If specified, the myrepo argument is assumed it be valid. This
+ If specified, the myrepo argument is assumed to be valid. This
should be a safe assumption since portdbapi methods always
return valid repo names and valid "repository" metadata from
aux_get.
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2011-06-29 9:27 Zac Medico
0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2011-06-29 9:27 UTC (permalink / raw
To: gentoo-commits
commit: 31c9c68d7e96070166fe385141400fa3bcb5950e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 29 09:18:21 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 29 09:18:21 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=31c9c68d
Detect/create missing soname symlinks for libs.
This will allow us to safely use the ldconfig -X option for all
ldconfig calls, an thereby avoid having ldconfig override our own
soname symlink policy which allows preserve-libs to work correctly
when libraries are downgraded as discussed in bug 373341.
---
pym/_emerge/EbuildPhase.py | 10 ++++
pym/portage/package/ebuild/doebuild.py | 81 +++++++++++++++++++++++++++++++-
2 files changed, 90 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 306932f..954c033 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -18,6 +18,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
'portage.package.ebuild.doebuild:_check_build_log,' + \
'_post_phase_cmds,_post_phase_userpriv_perms,' + \
'_post_src_install_chost_fix,' + \
+ '_post_src_install_soname_symlinks,' + \
'_post_src_install_uid_fix,_postinst_bsdflags,' + \
'_preinst_bsdflags'
)
@@ -254,6 +255,15 @@ class EbuildPhase(CompositeTask):
noiselevel=-1)
self._die_hooks()
return
+
+ if self.phase == "install":
+ out = portage.StringIO()
+ _post_src_install_soname_symlinks(self.settings, out)
+ msg = _unicode_decode(out.getvalue(),
+ encoding=_encodings['content'], errors='replace')
+ if msg:
+ self.scheduler.output(msg, log_path=log_path)
+
self._current_task = None
self.wait()
return
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 9df7dc7..35a0b0f 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -5,6 +5,7 @@ __all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
import codecs
import gzip
+import errno
from itertools import chain
import logging
import os as _os
@@ -1612,12 +1613,90 @@ def _post_src_install_uid_fix(mysettings, out):
mode='w', encoding=_encodings['repo.content'],
errors='strict').write(v + '\n')
+ _reapply_bsdflags_to_image(mysettings)
+
+def _reapply_bsdflags_to_image(mysettings):
+ """
+ Reapply flags saved and removed by _preinst_bsdflags.
+ """
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(os.path.join(mysettings["T"], "bsdflags.mtree"))))
+def _post_src_install_soname_symlinks(mysettings, out):
+ """
+ Check that libraries in $D have corresponding soname symlinks.
+ If symlinks are missing then create them and trigger a QA Notice.
+ This requires $PORTAGE_BUILDDIR/build-info/NEEDED.ELF.2 for
+ operation.
+ """
+
+ image_dir = mysettings["D"]
+ needed_filename = os.path.join(mysettings["PORTAGE_BUILDDIR"],
+ "build-info", "NEEDED.ELF.2")
+
+ try:
+ lines = codecs.open(_unicode_encode(needed_filename,
+ encoding=_encodings['fs'], errors='strict'),
+ 'r', encoding=_encodings['repo.content'],
+ errors='replace').readlines()
+ except IOError as e:
+ if e.errno not in (errno.ENOENT, errno.ESTALE):
+ raise
+ return
+
+ missing_symlinks = []
+
+ # Parse NEEDED.ELF.2 like LinkageMapELF.rebuild() does.
+ for l in lines:
+ l = l.rstrip("\n")
+ if not l:
+ continue
+ fields = l.split(";")
+ if len(fields) < 5:
+ portage.util.writemsg_level(_("\nWrong number of fields " \
+ "in %s: %s\n\n") % (needed_filename, l),
+ level=logging.ERROR, noiselevel=-1)
+ continue
+
+ obj, soname = fields[1:3]
+ if not soname:
+ continue
+
+ obj_file_path = os.path.join(image_dir, obj.lstrip(os.sep))
+ sym_file_path = os.path.join(os.path.dirname(obj_file_path), soname)
+ try:
+ os.lstat(sym_file_path)
+ except OSError as e:
+ if e.errno not in (errno.ENOENT, errno.ESTALE):
+ raise
+ else:
+ continue
+
+ missing_symlinks.append((obj, soname))
+
+ if not missing_symlinks:
+ return
+
+ qa_msg = ["QA Notice: Missing soname symlink(s) " + \
+ "will be automatically created:"]
+ qa_msg.append("")
+ qa_msg.extend("\t%s -> %s" % (os.path.join(
+ os.path.dirname(obj).lstrip(os.sep), soname),
+ os.path.basename(obj))
+ for obj, soname in missing_symlinks)
+ qa_msg.append("")
+ for line in qa_msg:
+ eqawarn(line, key=mysettings.mycpv, out=out)
+
+ _preinst_bsdflags(mysettings)
+ for obj, soname in missing_symlinks:
+ obj_file_path = os.path.join(image_dir, obj.lstrip(os.sep))
+ sym_file_path = os.path.join(os.path.dirname(obj_file_path), soname)
+ os.symlink(os.path.basename(obj_file_path), sym_file_path)
+ _reapply_bsdflags_to_image(mysettings)
+
def _merge_unicode_error(errors):
lines = []
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2011-11-17 23:25 Zac Medico
0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2011-11-17 23:25 UTC (permalink / raw
To: gentoo-commits
commit: d032f01ae3333fa5383aec25878b0eadd95f208b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 17 23:25:03 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Nov 17 23:25:03 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d032f01a
Tweak the last commit.
---
pym/_emerge/Scheduler.py | 13 ++-----------
pym/portage/package/ebuild/doebuild.py | 7 +++++++
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 393eeb6..ad1a944 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -76,7 +76,7 @@ class Scheduler(PollScheduler):
frozenset(["--pretend",
"--fetchonly", "--fetch-all-uri"])
- _opts_no_self_reinstall = frozenset(["--buildpkgonly",
+ _opts_no_self_update = frozenset(["--buildpkgonly",
"--fetchonly", "--fetch-all-uri", "--pretend"])
class _iface_class(SlotObject):
@@ -288,17 +288,8 @@ class Scheduler(PollScheduler):
self._running_root, installed=True)
def _handle_self_update(self):
- """
- If portage is updating itself, create temporary
- copies of PORTAGE_BIN_PATH and PORTAGE_PYM_PATH in order
- to avoid relying on the new versions which may be
- incompatible. Register an atexit hook to clean up the
- temporary directories. Pre-load elog modules here since
- we won't be able to later if they get unmerged (happens
- when namespace changes).
- """
- if self._opts_no_self_reinstall.intersection(self.myopts):
+ if self._opts_no_self_update.intersection(self.myopts):
return
for x in self._mergelist:
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 49d3e89..9e71cfc 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -2017,6 +2017,13 @@ def _merge_unicode_error(errors):
return lines
def _prepare_self_update(settings):
+ """
+ Call this when portage is updating itself, in order to create
+ temporary copies of PORTAGE_BIN_PATH and PORTAGE_PYM_PATH, since
+ the new versions may be incompatible. An atexit hook will
+ automatically clean up the temporary copies.
+ """
+
# Load lazily referenced portage submodules into memory,
# so imports won't fail during portage upgrade/downgrade.
_preload_elog_modules(settings)
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2012-05-09 20:00 Zac Medico
0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2012-05-09 20:00 UTC (permalink / raw
To: gentoo-commits
commit: e779d4ad49a3ee90a278a8e0a74a6a61d977810c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 9 20:00:32 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 9 20:00:32 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e779d4ad
Split out eapi_invalid function.
---
pym/_emerge/EbuildMetadataPhase.py | 46 +++-----------------------
pym/portage/package/ebuild/_eapi_invalid.py | 46 +++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 40 deletions(-)
diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index f89077e..80190fa 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -5,17 +5,17 @@ from _emerge.SubProcess import SubProcess
import sys
from portage.cache.mappings import slot_dict_class
import portage
+portage.proxy.lazyimport.lazyimport(globals(),
+ 'portage.package.ebuild._eapi_invalid:eapi_invalid',
+)
from portage import os
from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
-from portage.dep import _repo_separator
-from portage.elog import elog_process
-from portage.elog.messages import eerror
+
import errno
import fcntl
import io
-import textwrap
class EbuildMetadataPhase(SubProcess):
@@ -171,40 +171,6 @@ class EbuildMetadataPhase(SubProcess):
self.returncode = 1
def _eapi_invalid(self, metadata):
-
repo_name = self.portdb.getRepositoryName(self.repo_path)
-
- msg = []
- msg.extend(textwrap.wrap(("EAPI assignment in ebuild '%s%s%s' does not"
- " conform with PMS section 7.3.1:") %
- (self.cpv, _repo_separator, repo_name), 70))
-
- if not self._eapi:
- # None means the assignment was not found, while an
- # empty string indicates an (invalid) empty assingment.
- msg.append(
- "\tvalid EAPI assignment must"
- " occur on or before line: %s" %
- self._eapi_lineno)
- else:
- msg.append(("\tbash returned EAPI '%s' which does not match "
- "assignment on line: %s") %
- (metadata["EAPI"], self._eapi_lineno))
-
- if 'parse-eapi-ebuild-head' in self.settings.features:
- msg.extend(textwrap.wrap(("NOTE: This error will soon"
- " become unconditionally fatal in a future version of Portage,"
- " but at this time, it can by made non-fatal by setting"
- " FEATURES=-parse-eapi-ebuild-head in"
- " make.conf."), 70))
- else:
- msg.extend(textwrap.wrap(("NOTE: This error will soon"
- " become unconditionally fatal in a future version of Portage."
- " At the earliest opportunity, please enable"
- " FEATURES=parse-eapi-ebuild-head in make.conf in order to"
- " make this error fatal."), 70))
-
- for line in msg:
- eerror(line, phase="other", key=self.cpv)
- elog_process(self.cpv, self.settings,
- phasefilter=("other",))
+ eapi_invalid(self, self.cpv, repo_name, self.settings,
+ metadata["EAPI"], self._eapi, self._eapi_lineno)
diff --git a/pym/portage/package/ebuild/_eapi_invalid.py b/pym/portage/package/ebuild/_eapi_invalid.py
new file mode 100644
index 0000000..50a6978
--- /dev/null
+++ b/pym/portage/package/ebuild/_eapi_invalid.py
@@ -0,0 +1,46 @@
+# Copyright 2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import textwrap
+
+from portage.dep import _repo_separator
+from portage.elog import elog_process
+from portage.elog.messages import eerror
+
+def eapi_invalid(self, cpv, repo_name, settings,
+ eapi_var, eapi_parsed, eapi_lineno):
+
+ msg = []
+ msg.extend(textwrap.wrap(("EAPI assignment in ebuild '%s%s%s' does not"
+ " conform with PMS section 7.3.1:") %
+ (cpv, _repo_separator, repo_name), 70))
+
+ if not eapi_parsed:
+ # None means the assignment was not found, while an
+ # empty string indicates an (invalid) empty assingment.
+ msg.append(
+ "\tvalid EAPI assignment must"
+ " occur on or before line: %s" %
+ eapi_lineno)
+ else:
+ msg.append(("\tbash returned EAPI '%s' which does not match "
+ "assignment on line: %s") %
+ (eapi_var, eapi_lineno))
+
+ if 'parse-eapi-ebuild-head' in settings.features:
+ msg.extend(textwrap.wrap(("NOTE: This error will soon"
+ " become unconditionally fatal in a future version of Portage,"
+ " but at this time, it can by made non-fatal by setting"
+ " FEATURES=-parse-eapi-ebuild-head in"
+ " make.conf."), 70))
+ else:
+ msg.extend(textwrap.wrap(("NOTE: This error will soon"
+ " become unconditionally fatal in a future version of Portage."
+ " At the earliest opportunity, please enable"
+ " FEATURES=parse-eapi-ebuild-head in make.conf in order to"
+ " make this error fatal."), 70))
+
+ for line in msg:
+ eerror(line, phase="other", key=cpv)
+ elog_process(cpv, settings,
+ phasefilter=("other",))
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2012-05-09 20:16 Zac Medico
0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2012-05-09 20:16 UTC (permalink / raw
To: gentoo-commits
commit: 5958b9d406134a139cd66025eaf7bd650fb32b24
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 9 20:00:32 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 9 20:15:46 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5958b9d4
Split out eapi_invalid function.
---
pym/_emerge/EbuildMetadataPhase.py | 48 +++++----------------------
pym/portage/package/ebuild/_eapi_invalid.py | 46 +++++++++++++++++++++++++
2 files changed, 55 insertions(+), 39 deletions(-)
diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index f89077e..b7af69d 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -5,17 +5,17 @@ from _emerge.SubProcess import SubProcess
import sys
from portage.cache.mappings import slot_dict_class
import portage
+portage.proxy.lazyimport.lazyimport(globals(),
+ 'portage.package.ebuild._eapi_invalid:eapi_invalid',
+)
from portage import os
from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
-from portage.dep import _repo_separator
-from portage.elog import elog_process
-from portage.elog.messages import eerror
+
import errno
import fcntl
import io
-import textwrap
class EbuildMetadataPhase(SubProcess):
@@ -171,40 +171,10 @@ class EbuildMetadataPhase(SubProcess):
self.returncode = 1
def _eapi_invalid(self, metadata):
-
repo_name = self.portdb.getRepositoryName(self.repo_path)
-
- msg = []
- msg.extend(textwrap.wrap(("EAPI assignment in ebuild '%s%s%s' does not"
- " conform with PMS section 7.3.1:") %
- (self.cpv, _repo_separator, repo_name), 70))
-
- if not self._eapi:
- # None means the assignment was not found, while an
- # empty string indicates an (invalid) empty assingment.
- msg.append(
- "\tvalid EAPI assignment must"
- " occur on or before line: %s" %
- self._eapi_lineno)
- else:
- msg.append(("\tbash returned EAPI '%s' which does not match "
- "assignment on line: %s") %
- (metadata["EAPI"], self._eapi_lineno))
-
- if 'parse-eapi-ebuild-head' in self.settings.features:
- msg.extend(textwrap.wrap(("NOTE: This error will soon"
- " become unconditionally fatal in a future version of Portage,"
- " but at this time, it can by made non-fatal by setting"
- " FEATURES=-parse-eapi-ebuild-head in"
- " make.conf."), 70))
+ if metadata is not None:
+ eapi_var = metadata["EAPI"]
else:
- msg.extend(textwrap.wrap(("NOTE: This error will soon"
- " become unconditionally fatal in a future version of Portage."
- " At the earliest opportunity, please enable"
- " FEATURES=parse-eapi-ebuild-head in make.conf in order to"
- " make this error fatal."), 70))
-
- for line in msg:
- eerror(line, phase="other", key=self.cpv)
- elog_process(self.cpv, self.settings,
- phasefilter=("other",))
+ eapi_var = None
+ eapi_invalid(self, self.cpv, repo_name, self.settings,
+ eapi_var, self._eapi, self._eapi_lineno)
diff --git a/pym/portage/package/ebuild/_eapi_invalid.py b/pym/portage/package/ebuild/_eapi_invalid.py
new file mode 100644
index 0000000..50a6978
--- /dev/null
+++ b/pym/portage/package/ebuild/_eapi_invalid.py
@@ -0,0 +1,46 @@
+# Copyright 2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import textwrap
+
+from portage.dep import _repo_separator
+from portage.elog import elog_process
+from portage.elog.messages import eerror
+
+def eapi_invalid(self, cpv, repo_name, settings,
+ eapi_var, eapi_parsed, eapi_lineno):
+
+ msg = []
+ msg.extend(textwrap.wrap(("EAPI assignment in ebuild '%s%s%s' does not"
+ " conform with PMS section 7.3.1:") %
+ (cpv, _repo_separator, repo_name), 70))
+
+ if not eapi_parsed:
+ # None means the assignment was not found, while an
+ # empty string indicates an (invalid) empty assingment.
+ msg.append(
+ "\tvalid EAPI assignment must"
+ " occur on or before line: %s" %
+ eapi_lineno)
+ else:
+ msg.append(("\tbash returned EAPI '%s' which does not match "
+ "assignment on line: %s") %
+ (eapi_var, eapi_lineno))
+
+ if 'parse-eapi-ebuild-head' in settings.features:
+ msg.extend(textwrap.wrap(("NOTE: This error will soon"
+ " become unconditionally fatal in a future version of Portage,"
+ " but at this time, it can by made non-fatal by setting"
+ " FEATURES=-parse-eapi-ebuild-head in"
+ " make.conf."), 70))
+ else:
+ msg.extend(textwrap.wrap(("NOTE: This error will soon"
+ " become unconditionally fatal in a future version of Portage."
+ " At the earliest opportunity, please enable"
+ " FEATURES=parse-eapi-ebuild-head in make.conf in order to"
+ " make this error fatal."), 70))
+
+ for line in msg:
+ eerror(line, phase="other", key=cpv)
+ elog_process(cpv, settings,
+ phasefilter=("other",))
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2012-09-01 22:43 Zac Medico
0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2012-09-01 22:43 UTC (permalink / raw
To: gentoo-commits
commit: bb3094fb926910594f26ac3cf246d9aa9f9444d9
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 1 20:51:18 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 1 20:51:18 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bb3094fb
_prepare_self_update: ignore installed version
Now portage will unconditionally make a temporary copy of itself during
updates. This is safer, since it provides maximum protection against
any possible incompatibilities. For example, suppose that the ebuild
has been updated to change the location of installed files (such as
libdir change) without a revision bump.
---
pym/_emerge/Scheduler.py | 13 ++++---------
pym/portage/package/ebuild/doebuild.py | 9 ++-------
2 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 8ee9a58..9f1c86e 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -300,15 +300,10 @@ class Scheduler(PollScheduler):
if not portage.dep.match_from_list(
portage.const.PORTAGE_PACKAGE_ATOM, [x]):
continue
- if self._running_portage is None or \
- self._running_portage.cpv != x.cpv or \
- '9999' in x.cpv or \
- 'git' in x.inherited or \
- 'git-2' in x.inherited:
- rval = _check_temp_dir(self.settings)
- if rval != os.EX_OK:
- return rval
- _prepare_self_update(self.settings)
+ rval = _check_temp_dir(self.settings)
+ if rval != os.EX_OK:
+ return rval
+ _prepare_self_update(self.settings)
break
return os.EX_OK
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 4c0c45d..9b678f7 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -2129,11 +2129,6 @@ def _handle_self_update(settings, vardb):
if settings["ROOT"] == "/" and \
portage.dep.match_from_list(
portage.const.PORTAGE_PACKAGE_ATOM, [cpv]):
- inherited = frozenset(settings.get('INHERITED', '').split())
- if not vardb.cpv_exists(cpv) or \
- '9999' in cpv or \
- 'git' in inherited or \
- 'git-2' in inherited:
- _prepare_self_update(settings)
- return True
+ _prepare_self_update(settings)
+ return True
return False
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2012-12-19 3:58 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 10+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-12-19 3:58 UTC (permalink / raw
To: gentoo-commits
commit: 947f5d7df924e3850339921d623b9fe03047fa89
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Dec 19 03:56:59 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Wed Dec 19 03:56:59 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=947f5d7d
Rename a private module in preparation for extending its functionality.
---
pym/_emerge/EbuildMetadataPhase.py | 2 +-
.../{_eapi_invalid.py => _metadata_invalid.py} | 0
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py
index f351b16..cc8d775 100644
--- a/pym/_emerge/EbuildMetadataPhase.py
+++ b/pym/_emerge/EbuildMetadataPhase.py
@@ -6,7 +6,7 @@ import sys
from portage.cache.mappings import slot_dict_class
import portage
portage.proxy.lazyimport.lazyimport(globals(),
- 'portage.package.ebuild._eapi_invalid:eapi_invalid',
+ 'portage.package.ebuild._metadata_invalid:eapi_invalid',
)
from portage import os
from portage import _encodings
diff --git a/pym/portage/package/ebuild/_eapi_invalid.py b/pym/portage/package/ebuild/_metadata_invalid.py
similarity index 100%
rename from pym/portage/package/ebuild/_eapi_invalid.py
rename to pym/portage/package/ebuild/_metadata_invalid.py
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2017-04-04 3:20 Zac Medico
0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2017-04-04 3:20 UTC (permalink / raw
To: gentoo-commits
commit: 285d5d038d8bb8a17d853816e156147c8c59f248
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 3 00:40:55 2017 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 4 03:19:29 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=285d5d03
EbuildBuild: async spawn_nofetch in _fetchonly_exit (bug 614116)
Replace a synchronous spawn_nofetch call with an asynchronous one,
in order to avoid event loop recursion which is not compatible with
asyncio. This involves refactoring of spawn_nofetch to provide an
asynchronous interface.
X-Gentoo-bug: 614116
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=614116
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/_emerge/EbuildBuild.py | 18 ++++-
pym/portage/package/ebuild/_spawn_nofetch.py | 106 +++++++++++++++++----------
2 files changed, 85 insertions(+), 39 deletions(-)
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 11eb1c93e..48f470483 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -22,7 +22,7 @@ import portage
from portage import _encodings, _unicode_decode, _unicode_encode, os
from portage.package.ebuild.digestcheck import digestcheck
from portage.package.ebuild.doebuild import _check_temp_dir
-from portage.package.ebuild._spawn_nofetch import spawn_nofetch
+from portage.package.ebuild._spawn_nofetch import SpawnNofetchWithoutBuilddir
class EbuildBuild(CompositeTask):
@@ -165,8 +165,22 @@ class EbuildBuild(CompositeTask):
def _fetchonly_exit(self, fetcher):
self._final_exit(fetcher)
if self.returncode != os.EX_OK:
+ self.returncode = None
portdb = self.pkg.root_config.trees[self._tree].dbapi
- spawn_nofetch(portdb, self._ebuild_path, settings=self.settings)
+ self._start_task(SpawnNofetchWithoutBuilddir(
+ background=self.background,
+ portdb=portdb,
+ ebuild_path=self._ebuild_path,
+ scheduler=self.scheduler,
+ settings=self.settings),
+ self._nofetch_without_builddir_exit)
+ return
+
+ self.wait()
+
+ def _nofetch_without_builddir_exit(self, nofetch):
+ self._final_exit(nofetch)
+ self.returncode = 1
self.wait()
def _pre_clean_exit(self, pre_clean_phase):
diff --git a/pym/portage/package/ebuild/_spawn_nofetch.py b/pym/portage/package/ebuild/_spawn_nofetch.py
index 0fc53c8ca..bbfd5b72b 100644
--- a/pym/portage/package/ebuild/_spawn_nofetch.py
+++ b/pym/portage/package/ebuild/_spawn_nofetch.py
@@ -14,11 +14,14 @@ from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
from portage.util._async.SchedulerInterface import SchedulerInterface
from portage.util._eventloop.EventLoop import EventLoop
from portage.util._eventloop.global_event_loop import global_event_loop
+from _emerge.CompositeTask import CompositeTask
from _emerge.EbuildPhase import EbuildPhase
-def spawn_nofetch(portdb, ebuild_path, settings=None, fd_pipes=None):
+
+class SpawnNofetchWithoutBuilddir(CompositeTask):
"""
- This spawns pkg_nofetch if appropriate. The settings parameter
+ This spawns pkg_nofetch if appropriate, while avoiding the
+ need to lock a global build directory. The settings parameter
is useful only if setcpv has already been called in order
to cache metadata. It will be cloned internally, in order to
prevent any changes from interfering with the calling code.
@@ -40,33 +43,42 @@ def spawn_nofetch(portdb, ebuild_path, settings=None, fd_pipes=None):
to be displayed for problematic packages even though they do
not set RESTRICT=fetch (bug #336499).
- This function does nothing if the PORTAGE_PARALLEL_FETCHONLY
+ This class does nothing if the PORTAGE_PARALLEL_FETCHONLY
variable is set in the config instance.
"""
+ __slots__ = ('ebuild_path', 'fd_pipes', 'portdb', 'settings',
+ '_private_tmpdir')
+
+ def _start(self):
+ settings = self.settings
+ if settings is None:
+ settings = self.portdb.settings
+
+ if 'PORTAGE_PARALLEL_FETCHONLY' in settings:
+ # parallel-fetch mode
+ self.returncode = os.EX_OK
+ self._async_wait()
+ return
- if settings is None:
- settings = config(clone=portdb.settings)
- else:
- settings = config(clone=settings)
-
- if 'PORTAGE_PARALLEL_FETCHONLY' in settings:
- return os.EX_OK
-
- # We must create our private PORTAGE_TMPDIR before calling
- # doebuild_environment(), since lots of variables such
- # as PORTAGE_BUILDDIR refer to paths inside PORTAGE_TMPDIR.
- portage_tmpdir = settings.get('PORTAGE_TMPDIR')
- if not portage_tmpdir or not os.access(portage_tmpdir, os.W_OK):
- portage_tmpdir = None
- private_tmpdir = tempfile.mkdtemp(dir=portage_tmpdir)
- settings['PORTAGE_TMPDIR'] = private_tmpdir
- settings.backup_changes('PORTAGE_TMPDIR')
- # private temp dir was just created, so it's not locked yet
- settings.pop('PORTAGE_BUILDDIR_LOCKED', None)
-
- try:
- doebuild_environment(ebuild_path, 'nofetch',
- settings=settings, db=portdb)
+ # Prevent temporary config changes from interfering
+ # with config instances that are reused.
+ settings = self.settings = config(clone=settings)
+
+ # We must create our private PORTAGE_TMPDIR before calling
+ # doebuild_environment(), since lots of variables such
+ # as PORTAGE_BUILDDIR refer to paths inside PORTAGE_TMPDIR.
+ portage_tmpdir = settings.get('PORTAGE_TMPDIR')
+ if not portage_tmpdir or not os.access(portage_tmpdir, os.W_OK):
+ portage_tmpdir = None
+ private_tmpdir = self._private_tmpdir = tempfile.mkdtemp(
+ dir=portage_tmpdir)
+ settings['PORTAGE_TMPDIR'] = private_tmpdir
+ settings.backup_changes('PORTAGE_TMPDIR')
+ # private temp dir was just created, so it's not locked yet
+ settings.pop('PORTAGE_BUILDDIR_LOCKED', None)
+
+ doebuild_environment(self.ebuild_path, 'nofetch',
+ settings=settings, db=self.portdb)
restrict = settings['PORTAGE_RESTRICT'].split()
defined_phases = settings['DEFINED_PHASES'].split()
if not defined_phases:
@@ -76,18 +88,38 @@ def spawn_nofetch(portdb, ebuild_path, settings=None, fd_pipes=None):
if 'fetch' not in restrict and \
'nofetch' not in defined_phases:
- return os.EX_OK
+ self.returncode = os.EX_OK
+ self._async_wait()
+ return
prepare_build_dirs(settings=settings)
- ebuild_phase = EbuildPhase(background=False,
+
+ ebuild_phase = EbuildPhase(background=self.background,
phase='nofetch',
- scheduler=SchedulerInterface(portage._internal_caller and
+ scheduler=self.scheduler,
+ fd_pipes=self.fd_pipes, settings=settings)
+
+ self._start_task(ebuild_phase, self._nofetch_exit)
+
+ def _nofetch_exit(self, ebuild_phase):
+ self._final_exit(ebuild_phase)
+ elog_process(self.settings.mycpv, self.settings)
+ shutil.rmtree(self._private_tmpdir)
+ self._async_wait()
+
+
+def spawn_nofetch(portdb, ebuild_path, settings=None, fd_pipes=None):
+ """
+ Create a NofetchPrivateTmpdir instance, and execute it synchronously.
+ This function must not be called from asynchronous code, since it will
+ trigger event loop recursion which is incompatible with asyncio.
+ """
+ nofetch = SpawnNofetchWithoutBuilddir(background=False,
+ portdb=portdb,
+ ebuild_path=ebuild_path,
+ scheduler=SchedulerInterface(portage._internal_caller and
global_event_loop() or EventLoop(main=False)),
- fd_pipes=fd_pipes, settings=settings)
- ebuild_phase.start()
- ebuild_phase.wait()
- elog_process(settings.mycpv, settings)
- finally:
- shutil.rmtree(private_tmpdir)
-
- return ebuild_phase.returncode
+ fd_pipes=fd_pipes, settings=settings)
+
+ nofetch.start()
+ return nofetch.wait()
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2018-04-23 0:08 Zac Medico
0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2018-04-23 0:08 UTC (permalink / raw
To: gentoo-commits
commit: db4dca876cdb004b12a944f5323a51bc4bbde770
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 00:04:29 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 00:06:35 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=db4dca87
EbuildBuild._start(): fix event loop recursion (bug 653844)
Use async_aux_get to fetch SRC_URI metadata (it's not cached in
self.pkg.metadata because some packages have an extremely large
SRC_URI value).
Bug: https://bugs.gentoo.org/653844
pym/_emerge/EbuildBuild.py | 19 ++++++++++++++-----
pym/portage/package/ebuild/doebuild.py | 6 ++++--
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 9d4afd0ea..8ad8bcae9 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -35,23 +35,32 @@ class EbuildBuild(CompositeTask):
("_build_dir", "_buildpkg", "_ebuild_path", "_issyspkg", "_tree")
def _start(self):
-
- pkg = self.pkg
- settings = self.settings
-
if not self.opts.fetchonly:
- rval = _check_temp_dir(settings)
+ rval = _check_temp_dir(self.settings)
if rval != os.EX_OK:
self.returncode = rval
self._current_task = None
self._async_wait()
return
+ # First get the SRC_URI metadata (it's not cached in self.pkg.metadata
+ # because some packages have an extremely large SRC_URI value).
+ self._start_task(
+ AsyncTaskFuture(
+ future=self.pkg.root_config.trees["porttree"].dbapi.\
+ async_aux_get(self.pkg.cpv, ["SRC_URI"], myrepo=self.pkg.repo)),
+ self._start_with_metadata)
+
+ def _start_with_metadata(self, aux_get_task):
+ self._assert_current(aux_get_task)
+ pkg = self.pkg
+ settings = self.settings
root_config = pkg.root_config
tree = "porttree"
self._tree = tree
portdb = root_config.trees[tree].dbapi
settings.setcpv(pkg)
+ settings.configdict["pkg"]["SRC_URI"], = aux_get_task.future.result()
settings.configdict["pkg"]["EMERGE_FROM"] = "ebuild"
if self.opts.buildpkgonly:
settings.configdict["pkg"]["MERGE_TYPE"] = "buildonly"
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 3c8414387..0dabafeb7 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -450,8 +450,10 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
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)
+ src_uri = mysettings.configdict["pkg"].get("SRC_URI")
+ if src_uri is None:
+ src_uri, = mydbapi.aux_get(mysettings.mycpv,
+ ["SRC_URI"], mytree=mytree)
metadata = {
"EAPI" : eapi,
"SRC_URI" : src_uri,
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/
@ 2018-06-04 23:46 Zac Medico
0 siblings, 0 replies; 10+ messages in thread
From: Zac Medico @ 2018-06-04 23:46 UTC (permalink / raw
To: gentoo-commits
commit: 345256c2d439c5ab580e4226f227db2819883d40
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 4 23:32:46 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 4 23:44:15 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=345256c2
emerge -pf: spawn pkg_nofetch asynchronously (bug 657360)
For pretend mode, fix doebuild to skip the spawn_nofetch call
that would trigger event loop recursion, and spawn pkg_nofetch
asynchronously.
Bug: https://bugs.gentoo.org/657360
pym/_emerge/EbuildBuild.py | 16 ++++++++++++++--
pym/_emerge/EbuildFetchonly.py | 5 ++++-
pym/portage/package/ebuild/doebuild.py | 15 +++++++--------
3 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py
index 00d4680f5..d9f7f6da7 100644
--- a/pym/_emerge/EbuildBuild.py
+++ b/pym/_emerge/EbuildBuild.py
@@ -142,8 +142,20 @@ class EbuildBuild(CompositeTask):
pkg=pkg, pretend=opts.pretend,
settings=settings)
retval = fetcher.execute()
- self.returncode = retval
- self.wait()
+ if retval == os.EX_OK:
+ self._current_task = None
+ self.returncode = os.EX_OK
+ self._async_wait()
+ else:
+ # For pretend mode, the convention it to execute
+ # pkg_nofetch and return a successful exitcode.
+ self._start_task(SpawnNofetchWithoutBuilddir(
+ background=self.background,
+ portdb=self.pkg.root_config.trees[self._tree].dbapi,
+ ebuild_path=self._ebuild_path,
+ scheduler=self.scheduler,
+ settings=self.settings),
+ self._default_final_exit)
return
else:
fetcher = EbuildFetcher(
diff --git a/pym/_emerge/EbuildFetchonly.py b/pym/_emerge/EbuildFetchonly.py
index f88ea96ef..eec2ad208 100644
--- a/pym/_emerge/EbuildFetchonly.py
+++ b/pym/_emerge/EbuildFetchonly.py
@@ -25,7 +25,10 @@ class EbuildFetchonly(SlotObject):
listonly=self.pretend, fetchonly=1, fetchall=self.fetch_all,
mydbapi=portdb, tree="porttree")
- if rval != os.EX_OK:
+ # For pretend mode, this error message is suppressed,
+ # and the unsuccessful return value is used to trigger
+ # a call to the pkg_nofetch phase.
+ if rval != os.EX_OK and not self.pretend:
msg = "Fetch failed for '%s'" % (pkg.cpv,)
eerror(msg, phase="unpack", key=pkg.cpv)
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index dc443df00..0e94de805 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1079,14 +1079,13 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0,
if not fetch(fetchme, mysettings, listonly=listonly,
fetchonly=fetchonly, allow_missing_digests=False,
digests=dist_digests):
- spawn_nofetch(mydbapi, myebuild, settings=mysettings,
- fd_pipes=fd_pipes)
- if listonly:
- # The convention for listonly mode is to report
- # success in any case, even though fetch() may
- # return unsuccessfully in order to trigger the
- # nofetch phase.
- return 0
+ # Since listonly mode is called by emerge --pretend in an
+ # asynchronous context, spawn_nofetch would trigger event loop
+ # recursion here, therefore delegate execution of pkg_nofetch
+ # to the caller (bug 657360).
+ if not listonly:
+ spawn_nofetch(mydbapi, myebuild, settings=mysettings,
+ fd_pipes=fd_pipes)
return 1
if need_distfiles:
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-06-04 23:47 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 0:08 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/_emerge/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2018-06-04 23:46 Zac Medico
2017-04-04 3:20 Zac Medico
2012-12-19 3:58 Arfrever Frehtes Taifersar Arahesis
2012-09-01 22:43 Zac Medico
2012-05-09 20:16 Zac Medico
2012-05-09 20:00 Zac Medico
2011-11-17 23:25 Zac Medico
2011-06-29 9:27 Zac Medico
2011-06-06 16:00 Arfrever Frehtes Taifersar Arahesis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox