Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: eclass/
Date: Sat, 23 May 2020 21:24:48
Message-Id: 1590269065.1dfb073303b39c71c2afdfbec0ecbd7d56ae3e27.asturm@gentoo
commit:     1dfb073303b39c71c2afdfbec0ecbd7d56ae3e27
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun May 10 23:13:21 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat May 23 21:24:25 2020 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=1dfb0733

kde.org.eclass: Add KDE_ORG_CATEGORIES map and KDE_ORG_CATEGORY

To support invent.kde.org git repository addresses without redirect warnings.

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/kde.org.eclass | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass
index 2d21bacc5c..aaee2a2cba 100644
--- a/eclass/kde.org.eclass
+++ b/eclass/kde.org.eclass
@@ -34,6 +34,50 @@ fi
 
 EXPORT_FUNCTIONS pkg_nofetch src_unpack
 
+# @ECLASS-VARIABLE: KDE_ORG_CATEGORIES
+# @INTERNAL
+# @DESCRIPTION
+# Map of ${CATEGORY}=<upstream category> key-value pairs.
+declare -A KDE_ORG_CATEGORIES=(
+	[app-accessibility]=accessibility
+	[app-admin]=system
+	[app-backup]=system
+	[app-cdr]=utilities
+	[app-editors]=office
+	[app-office]=office
+	[app-text]=office
+	[dev-libs]=libraries
+	[dev-util]=sdk
+	[games-kids]=education
+	[kde-frameworks]=frameworks
+	[kde-plasma]=plasma
+	[mail-client]=pim
+	[media-gfx]=graphics
+	[media-libs]=libraries
+	[media-sound]=multimedia
+	[media-video]=multimedia
+	[net-im]=network
+	[net-irc]=network
+	[net-libs]=libraries
+	[net-misc]=network
+	[net-p2p]=network
+	[sci-astronomy]=education
+	[sci-calculators]=utilities
+	[sci-mathematics]=education
+	[sci-visualization]=education
+	[sys-block]=system
+	[sys-libs]=system
+	[www-client]=network
+	[x11-libs]=libraries
+)
+readonly KDE_ORG_CATEGORIES
+
+# @ECLASS-VARIABLE: KDE_ORG_CATEGORY
+# @DESCRIPTION:
+# If unset, default value is mapped from ${CATEGORY} to corresponding upstream
+# category on invent.kde.org, with "kde" as fallback value.
+: ${KDE_ORG_CATEGORY:=${KDE_ORG_CATEGORIES[${CATEGORY}]:-kde}}
+
 # @ECLASS-VARIABLE: KDE_ORG_NAME
 # @DESCRIPTION:
 # If unset, default value is set to ${PN}.
@@ -171,7 +215,7 @@ _kde.org_calculate_live_repo() {
 	# @DESCRIPTION:
 	# This variable allows easy overriding of default kde mirror service
 	# (anongit) with anything else you might want to use.
-	EGIT_MIRROR=${EGIT_MIRROR:=https://invent.kde.org/kde}
+	EGIT_MIRROR=${EGIT_MIRROR:=https://invent.kde.org/${KDE_ORG_CATEGORY}}
 
 	if [[ ${PV} == ??.??.49.9999 && ${KDE_RELEASE_SERVICE} = true ]]; then
 		EGIT_BRANCH="release/$(ver_cut 1-2)"