Discussion:
[gentoo-portage-dev] [PATCH 0/4] Unused prepall* removal
Michał Górny
2018-09-15 11:48:50 UTC
Permalink
Hi,

This series removes unused prepall* helpers. Their code is integrated
into prepall, then prepall is moved into misc-functions as internal
function rather than ebuild-visible helper.

There is still one use of prepalldocs but it will be removed before
the patch is merged.

This is the first step of refactoring for ecompress replacement.

--
Best regards,
Michał Górny

Michał Górny (4):
Ban prepallinfo for ebuild scope use
Ban prepallman in ebuild scope
Ban prepalldocs in ebuild scope
Ban prepall in ebuild scope

bin/ebuild-helpers/prepall | 25 +++----------------------
bin/ebuild-helpers/prepalldocs | 19 ++-----------------
bin/ebuild-helpers/prepallinfo | 9 ++-------
bin/ebuild-helpers/prepallman | 20 +++-----------------
bin/misc-functions.sh | 27 ++++++++++++++++++++++++++-
5 files changed, 36 insertions(+), 64 deletions(-)
--
2.19.0
Michał Górny
2018-09-15 11:48:51 UTC
Permalink
---
bin/ebuild-helpers/prepall | 4 ++--
bin/ebuild-helpers/prepallinfo | 9 ++-------
2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall
index bc77af4a1..c2d879f37 100755
--- a/bin/ebuild-helpers/prepall
+++ b/bin/ebuild-helpers/prepall
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
@@ -17,7 +17,7 @@ if has chflags $FEATURES ; then
fi

prepallman
-prepallinfo
+[[ -d ${ED%/}/usr/share/info ]] && prepinfo

___eapi_has_dostrip || prepallstrip

diff --git a/bin/ebuild-helpers/prepallinfo b/bin/ebuild-helpers/prepallinfo
index 34d6a74b7..e23a6d410 100755
--- a/bin/ebuild-helpers/prepallinfo
+++ b/bin/ebuild-helpers/prepallinfo
@@ -4,10 +4,5 @@

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

-if ! ___eapi_has_prefix_variables; then
- ED=${D}
-fi
-
-[[ -d ${ED%/}/usr/share/info ]] || exit 0
-
-exec prepinfo
+die "'${0##*/}' is not allowed in ebuild scope"
+exit 1
--
2.19.0
Michał Górny
2018-09-15 11:48:52 UTC
Permalink
---
bin/ebuild-helpers/prepall | 7 ++++++-
bin/ebuild-helpers/prepallman | 20 +++-----------------
2 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall
index c2d879f37..87e1ca20c 100755
--- a/bin/ebuild-helpers/prepall
+++ b/bin/ebuild-helpers/prepall
@@ -16,7 +16,12 @@ if has chflags $FEATURES ; then
chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
fi

-prepallman
+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
diff --git a/bin/ebuild-helpers/prepallman b/bin/ebuild-helpers/prepallman
index 03b10a8da..e23a6d410 100755
--- a/bin/ebuild-helpers/prepallman
+++ b/bin/ebuild-helpers/prepallman
@@ -1,22 +1,8 @@
#!/bin/bash
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

-# replaced by controllable compression in EAPI 4
-___eapi_has_docompress && exit 0
-
-if ! ___eapi_has_prefix_variables; then
- ED=${D}
-fi
-
-ret=0
-
-while IFS= read -r -d '' mandir ; do
- mandir=${mandir#${ED}}
- prepman "${mandir%/man}"
- ((ret|=$?))
-done < <(find "${ED}" -type d -name man -print0)
-
-exit ${ret}
+die "'${0##*/}' is not allowed in ebuild scope"
+exit 1
--
2.19.0
Michał Górny
2018-09-15 11:48:54 UTC
Permalink
---
bin/ebuild-helpers/prepall | 28 ++--------------------------
bin/misc-functions.sh | 27 ++++++++++++++++++++++++++-
2 files changed, 28 insertions(+), 27 deletions(-)

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..7120717b7 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
+
+ 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
Michał Górny
2018-09-15 11:48:53 UTC
Permalink
---
bin/ebuild-helpers/prepalldocs | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/bin/ebuild-helpers/prepalldocs b/bin/ebuild-helpers/prepalldocs
index 6cdceb318..e23a6d410 100755
--- a/bin/ebuild-helpers/prepalldocs
+++ b/bin/ebuild-helpers/prepalldocs
@@ -4,20 +4,5 @@

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

-if ___eapi_has_docompress; then
- die "'${0##*/}' has been banned for EAPI '$EAPI'"
- exit 1
-fi
-
-if [[ -n $1 ]] ; then
- __vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
-fi
-
-if ! ___eapi_has_prefix_variables; then
- ED=${D}
-fi
-
-[[ -d ${ED%/}/usr/share/doc ]] || exit 0
-
-ecompressdir --ignore /usr/share/doc/${PF}/html
-ecompressdir --queue /usr/share/doc
+die "'${0##*/}' is not allowed in ebuild scope"
+exit 1
--
2.19.0
Loading...