From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, bin/
Date: Tue, 18 Sep 2012 02:59:37 +0000 (UTC) [thread overview]
Message-ID: <1347937163.1d9b8968460c4bdb44daeda3454ef0ef5035c398.zmedico@gentoo> (raw)
commit: 1d9b8968460c4bdb44daeda3454ef0ef5035c398
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 18 02:59:23 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 18 02:59:23 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1d9b8968
doebuild: update environment.bz2 for pre/postinst
Also, remove unnecessary __dyn_preinst func.
---
bin/misc-functions.sh | 2 +-
bin/phase-functions.sh | 14 +++-----------
bin/save-ebuild-env.sh | 2 +-
pym/portage/package/ebuild/doebuild.py | 12 ++++++++++--
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 486b8d2..1159ca5 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1082,7 +1082,7 @@ preinst_selinux_labels() {
return 1
fi
if has selinux ${FEATURES}; then
- # SELinux file labeling (needs to always be last in __dyn_preinst)
+ # SELinux file labeling (needs to execute after preinst)
# only attempt to label if setfiles is executable
# and 'context' is available on selinuxfs.
if [ -f /selinux/context -o -f /sys/fs/selinux/context ] && \
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 7048419..92e25c6 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -601,14 +601,6 @@ __dyn_install() {
trap - SIGINT SIGQUIT
}
-__dyn_preinst() {
- if [ -z "${D}" ]; then
- eerror "${FUNCNAME}: D is unset"
- return 1
- fi
- __ebuild_phase_with_hooks pkg_preinst
-}
-
__dyn_help() {
echo
echo "Portage"
@@ -871,7 +863,7 @@ __ebuild_main() {
nofetch)
__ebuild_phase_with_hooks pkg_nofetch
;;
- prerm|postrm|postinst|config|info)
+ prerm|postrm|preinst|postinst|config|info)
if has "${1}" config info && \
! declare -F "pkg_${1}" >/dev/null ; then
ewarn "pkg_${1}() is not defined: '${EBUILD##*/}'"
@@ -884,7 +876,7 @@ __ebuild_main() {
__ebuild_phase_with_hooks pkg_${1}
set +x
fi
- if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then
+ if [[ -n $PORTAGE_UPDATE_ENV ]] ; then
# Update environment.bz2 in case installation phases
# need to pass some variables to uninstallation phases.
__save_ebuild_env --exclude-init-phases | \
@@ -960,7 +952,7 @@ __ebuild_main() {
fi
export SANDBOX_ON="0"
;;
- help|pretend|setup|preinst)
+ help|pretend|setup)
#pkg_setup needs to be out of the sandbox for tmp file creation;
#for example, awking and piping a file in /tmp requires a temp file to be created
#in /etc. If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index de8e1fb..7ae3938 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -63,7 +63,7 @@ __save_ebuild_env() {
__abort_handler __abort_prepare __abort_configure __abort_compile \
__abort_test __abort_install __dyn_prepare __dyn_configure \
__dyn_compile __dyn_test __dyn_install \
- __dyn_preinst __dyn_pretend __dyn_help \
+ __dyn_pretend __dyn_help \
debug-print debug-print-function \
debug-print-section __helpers_die inherit EXPORT_FUNCTIONS \
nonfatal register_success_hook \
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 89b6050..7200327 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -904,8 +904,16 @@ def doebuild(myebuild, mydo, _unused=None, settings=None, debug=0, listonly=0,
# the sandbox -- and stop now.
if mydo in ("config", "help", "info", "postinst",
"preinst", "pretend", "postrm", "prerm"):
- return _spawn_phase(mydo, mysettings,
- fd_pipes=fd_pipes, logfile=logfile, returnpid=returnpid)
+ if mydo in ("preinst", "postinst"):
+ env_file = os.path.join(os.path.dirname(mysettings["EBUILD"]),
+ "environment.bz2")
+ if os.path.isfile(env_file):
+ mysettings["PORTAGE_UPDATE_ENV"] = env_file
+ try:
+ return _spawn_phase(mydo, mysettings,
+ fd_pipes=fd_pipes, logfile=logfile, returnpid=returnpid)
+ finally:
+ mysettings.pop("PORTAGE_UPDATE_ENV", None)
mycpv = "/".join((mysettings["CATEGORY"], mysettings["PF"]))
next reply other threads:[~2012-09-18 2:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-18 2:59 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-02-05 19:25 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, bin/ Michał Górny
2013-07-16 17:52 Arfrever Frehtes Taifersar Arahesis
2013-01-15 20:52 Zac Medico
2012-09-14 7:26 Zac Medico
2012-09-13 18:25 Zac Medico
2012-04-22 17:56 Zac Medico
2011-11-10 3:12 Zac Medico
2011-11-09 0:21 Zac Medico
2011-11-05 18:53 Zac Medico
2011-10-15 18:38 Zac Medico
2011-09-22 0:05 Zac Medico
2011-08-28 23:32 Zac Medico
2011-05-07 22:00 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347937163.1d9b8968460c4bdb44daeda3454ef0ef5035c398.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox