Re: [gentoo-portage-dev] [PATCH v2 4/4] Ban prepall in ebuild scope

2018-09-17 Thread Michał Górny
On Sun, 2018-09-16 at 16:09 -0700, Zac Medico wrote:
> On 09/15/2018 06:45 AM, Michał Górny wrote:
> > ---
> >  bin/ebuild-helpers/prepall | 28 ++--
> >  bin/misc-functions.sh  | 27 ++-
> >  2 files changed, 28 insertions(+), 27 deletions(-)
> > 
> > Changed in v2:
> > - fixed calling prepallstrip in EAPI 7
> 
> This series looks good. Please merge.

Thanks for the review.  Merged now.

-- 
Best regards,
Michał Górny


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-portage-dev] [PATCH v2 4/4] Ban prepall in ebuild scope

2018-09-16 Thread Zac Medico
On 09/15/2018 06:45 AM, Michał Górny wrote:
> ---
>  bin/ebuild-helpers/prepall | 28 ++--
>  bin/misc-functions.sh  | 27 ++-
>  2 files changed, 28 insertions(+), 27 deletions(-)
> 
> Changed in v2:
> - fixed calling prepallstrip in EAPI 7

This series looks good. Please merge.
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


[gentoo-portage-dev] [PATCH v2 4/4] Ban prepall in ebuild scope

2018-09-15 Thread Michał Górny
---
 bin/ebuild-helpers/prepall | 28 ++--
 bin/misc-functions.sh  | 27 ++-
 2 files changed, 28 insertions(+), 27 deletions(-)

Changed in v2:
- fixed calling prepallstrip in EAPI 7

diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall
index 87e1ca20c..e23a6d410 100755
--- a/bin/ebuild-helpers/prepall
+++ b/bin/ebuild-helpers/prepall
@@ -4,29 +4,5 @@
 
 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
 
-if ! ___eapi_has_prefix_variables; then
-   ED=${D}
-fi
-
-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
-
-if ! ___eapi_has_docompress; then
-   while IFS= read -r -d '' mandir ; do
-   mandir=${mandir#${ED}}
-   prepman "${mandir%/man}"
-   done < <(find "${ED}" -type d -name man -print0)
-fi
-[[ -d ${ED%/}/usr/share/info ]] && prepinfo
-
-___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
+die "'${0##*/}' is not allowed in ebuild scope"
+exit 1
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 34492e086..d25bc8498 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -162,6 +162,31 @@ prepcompress() {
return 0
 }
 
+__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
+
+   if ! ___eapi_has_docompress; then
+   while IFS= read -r -d '' mandir ; do
+   mandir=${mandir#${ED}}
+   prepman "${mandir%/man}"
+   done < <(find "${ED}" -type d -name man -print0)
+   fi
+   [[ -d ${ED%/}/usr/share/info ]] && prepinfo
+
+   ___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
@@ -219,7 +244,7 @@ install_qa_check() {
done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z)
 
export STRIP_MASK
-   prepall
+   __prepall
___eapi_has_docompress && prepcompress
ecompressdir --dequeue
ecompress --dequeue
-- 
2.19.0