summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2022-07-11 00:14:34 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2022-07-13 11:15:40 +0200
commitb540658748bf567fff94f359e5905b94f38e454f (patch)
treec2dae839d884ef289a3b02f3271dd29a49fd40cf /eclass/kde.org.eclass
parentkde.org.eclass: Add new KDE_ORG_SCHEDULE_URI (diff)
downloadgentoo-b540658748bf567fff94f359e5905b94f38e454f.tar.gz
gentoo-b540658748bf567fff94f359e5905b94f38e454f.tar.bz2
gentoo-b540658748bf567fff94f359e5905b94f38e454f.zip
kde.org.eclass: Add new variables KDE_PV_UNRELEASED, KDE_ORG_UNRELEASED
Replace KDE_UNRELEASED Drop obsolete _kde.org_is_unreleased Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass/kde.org.eclass')
-rw-r--r--eclass/kde.org.eclass43
1 files changed, 14 insertions, 29 deletions
diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
index 524e3060cf40..1f8d8e912a2d 100644
--- a/eclass/kde.org.eclass
+++ b/eclass/kde.org.eclass
@@ -112,7 +112,7 @@ readonly KDE_ORG_CATEGORIES
# Mark package is being part of KDE Gear release schedule.
# By default, this is set to "false" and does nothing.
# If CATEGORY equals kde-apps, this is automatically set to "true".
-# If set to "true", set SRC_URI accordingly and apply KDE_UNRELEASED.
+# If set to "true", set SRC_URI accordingly.
: ${KDE_GEAR:=false}
if [[ ${CATEGORY} == kde-apps ]]; then
KDE_GEAR=true
@@ -134,13 +134,21 @@ case ${KDE_SELINUX_MODULE} in
;;
esac
-# @ECLASS_VARIABLE: KDE_UNRELEASED
+# @ECLASS_VARIABLE: KDE_PV_UNRELEASED
# @INTERNAL
+# @DEFAULT_UNSET
# @DESCRIPTION:
-# An array of $CATEGORY-$PV pairs of packages that are unreleased upstream.
+# An array of package versions that are unreleased upstream.
# Any package matching this will have fetch restriction enabled, and receive
# a proper error message via pkg_nofetch.
-KDE_UNRELEASED=( )
+
+# @ECLASS_VARIABLE: KDE_ORG_UNRELEASED
+# @DESCRIPTION:
+# If set to "true" fetch restriction will be enabled, and a proper error
+# message displayed via pkg_nofetch.
+KDE_ORG_UNRELEASED=false
+has ${PV} "${KDE_PV_UNRELEASED[*]}" && KDE_ORG_UNRELEASED=true
+[[ ${KDE_ORG_UNRELEASED} == true ]] && RESTRICT+=" fetch"
# @ECLASS_VARIABLE: EGIT_MIRROR
# @DESCRIPTION:
@@ -171,25 +179,6 @@ case ${CATEGORY} in
*) ;;
esac
-# @FUNCTION: _kde.org_is_unreleased
-# @INTERNAL
-# @DESCRIPTION:
-# Return true if $CATEGORY-$PV matches against an entry in KDE_UNRELEASED array.
-_kde.org_is_unreleased() {
- local pair
- for pair in "${KDE_UNRELEASED[@]}" ; do
- if [[ "${pair}" == "${CATEGORY}-${PV}" ]]; then
- return 0
- elif [[ ${KDE_GEAR} == true ]]; then
- if [[ "${pair/kde-apps/${CATEGORY}}" == "${CATEGORY}-${PV}" ]]; then
- return 0
- fi
- fi
- done
-
- return 1
-}
-
# @FUNCTION: _kde.org_calculate_src_uri
# @INTERNAL
# @DESCRIPTION:
@@ -246,9 +235,7 @@ _kde.org_calculate_src_uri() {
SRC_URI="${_src_uri}${KDE_ORG_NAME}-${PV}.tar.xz"
fi
- if _kde.org_is_unreleased ; then
- RESTRICT+=" fetch"
- fi
+ [[ ${KDE_ORG_UNRELEASED} == true ]] && RESTRICT+=" fetch"
}
# @FUNCTION: _kde.org_calculate_live_repo
@@ -297,9 +284,7 @@ esac
# KDE_UNRELEASED, display a giant warning that the package has not yet been
# released upstream and should not be used.
kde.org_pkg_nofetch() {
- if ! _kde.org_is_unreleased ; then
- return
- fi
+ [[ ${KDE_ORG_UNRELEASED} == true ]] || return
case ${CATEGORY} in
kde-frameworks) KDE_ORG_SCHEDULE_URI+="/Frameworks" ;;