From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] misc-functions.sh: Inline and reflow __prepall
Date: Wed, 31 Oct 2018 17:46:56 +0100 [thread overview]
Message-ID: <20181031164656.11931-1-mgorny@gentoo.org> (raw)
Inline the __prepall function into install_qa_check(), and reflow it
to cover the code more correctly. The arbitrary split between these
functions has resulted in mismatches, with e.g. prepstrip being covered
by mtree flag saving but dostrip being accidentally omitted.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
bin/misc-functions.sh | 48 ++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index ff3d2a1ff..db7aaed5a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -43,30 +43,6 @@ install_symlink_html_docs() {
fi
}
-__prepall() {
- if has chflags $FEATURES ; then
- # Save all the file flags for restoration at the end of prepall.
- mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
- # Remove all the file flags so that prepall can do anything necessary.
- chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
- chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
- fi
-
- [[ -d ${ED%/}/usr/share/info ]] && prepinfo
-
- # Apply compression.
- "${PORTAGE_BIN_PATH}"/ecompress --queue "${PORTAGE_DOCOMPRESS[@]}"
- "${PORTAGE_BIN_PATH}"/ecompress --ignore "${PORTAGE_DOCOMPRESS_SKIP[@]}"
- "${PORTAGE_BIN_PATH}"/ecompress --dequeue
-
- ___eapi_has_dostrip || prepallstrip
-
- if has chflags $FEATURES ; then
- # Restore all the file flags that were saved at the beginning of prepall.
- mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
- fi
-}
-
install_qa_check() {
local d f i qa_var x paths qa_checks=() checks_run=()
if ! ___eapi_has_prefix_variables; then
@@ -123,13 +99,33 @@ install_qa_check() {
)
done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z)
- export STRIP_MASK
- __prepall
+ if has chflags $FEATURES ; then
+ # Save all the file flags for restoration afterwards.
+ mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
+ # Remove all the file flags so that we can do anything necessary.
+ chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
+ chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
+ fi
+
+ [[ -d ${ED%/}/usr/share/info ]] && prepinfo
+
+ # Apply compression.
+ "${PORTAGE_BIN_PATH}"/ecompress --queue "${PORTAGE_DOCOMPRESS[@]}"
+ "${PORTAGE_BIN_PATH}"/ecompress --ignore "${PORTAGE_DOCOMPRESS_SKIP[@]}"
+ "${PORTAGE_BIN_PATH}"/ecompress --dequeue
+ export STRIP_MASK
if ___eapi_has_dostrip; then
"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
"${PORTAGE_BIN_PATH}"/estrip --dequeue
+ else
+ prepallstrip
+ fi
+
+ if has chflags $FEATURES ; then
+ # Restore all the file flags that were saved earlier on.
+ mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
fi
# Create NEEDED.ELF.2 regardless of RESTRICT=binchecks, since this info is
--
2.19.1
reply other threads:[~2018-10-31 16:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20181031164656.11931-1-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-portage-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