1 |
commit: 603f50e1bacae45e1a24452e07d1381e2ea0c786 |
2 |
Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 26 22:29:48 2015 +0000 |
4 |
Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 26 22:29:48 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=603f50e1 |
7 |
|
8 |
[eclass] Add fetch restriction to inform users about packages that are not released yet. |
9 |
|
10 |
eclass/kde5.eclass | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++--- |
11 |
1 file changed, 66 insertions(+), 3 deletions(-) |
12 |
|
13 |
diff --git a/eclass/kde5.eclass b/eclass/kde5.eclass |
14 |
index 0a195cb..b039e36 100644 |
15 |
--- a/eclass/kde5.eclass |
16 |
+++ b/eclass/kde5.eclass |
17 |
@@ -28,7 +28,7 @@ if [[ ${KDE_BUILD_TYPE} = live ]]; then |
18 |
esac |
19 |
fi |
20 |
|
21 |
-EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm |
22 |
+EXPORT_FUNCTIONS pkg_pretend pkg_setup pkg_nofetch src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm |
23 |
|
24 |
# @ECLASS-VARIABLE: QT_MINIMAL |
25 |
# @DESCRIPTION: |
26 |
@@ -92,9 +92,17 @@ fi |
27 |
# @DESCRIPTION: |
28 |
# If set to "none", do nothing. |
29 |
# For any other value, add selinux to IUSE, and depending on that useflag |
30 |
-# add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND |
31 |
+# add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND. |
32 |
: ${KDE_SELINUX_MODULE:=none} |
33 |
|
34 |
+# @ECLASS-VARIABLE: KDE_RELEASE_DATE |
35 |
+# @DESCRIPTION: |
36 |
+# Used to display a fetch restriction for packages that have not been published yet. |
37 |
+# If set to "none", use internal schedule. |
38 |
+# Otherwise set it to a date formatted as YYMMDD. |
39 |
+# Internal schedule is adjusted in _get_release_date(). |
40 |
+: ${KDE_RELEASE_DATE:=none} |
41 |
+ |
42 |
if [[ ${KDEBASE} = kdevelop ]]; then |
43 |
HOMEPAGE="http://www.kdevelop.org/" |
44 |
else |
45 |
@@ -308,9 +316,53 @@ _calculate_live_repo() { |
46 |
esac |
47 |
} |
48 |
|
49 |
+ |
50 |
+_get_release_date() { |
51 |
+ debug-print-function ${FUNCNAME} "$@" |
52 |
+ case ${CATEGORY} in |
53 |
+ kde-frameworks) |
54 |
+ case ${PV} in |
55 |
+ 5.10) echo "20150507" ;; |
56 |
+ 5.11) echo "20150611" ;; |
57 |
+ 5.12) echo "20150709" ;; |
58 |
+ 5.13) echo "20150806" ;; |
59 |
+ *) echo "none" ;; |
60 |
+ esac |
61 |
+ ;; |
62 |
+ kde-plasma) |
63 |
+ case ${PV} in |
64 |
+ 5.3.0) echo "20150428" ;; |
65 |
+ *) echo "none" ;; |
66 |
+ esac |
67 |
+ ;; |
68 |
+ kde-applications) |
69 |
+ case ${PV} in |
70 |
+ 15.04.1) echo "20150512" ;; |
71 |
+ 15.04.2) echo "20150602" ;; |
72 |
+ 15.04.3) echo "20150630" ;; |
73 |
+ *) echo "none" ;; |
74 |
+ esac |
75 |
+ ;; |
76 |
+ *) echo "none" ;; |
77 |
+ esac |
78 |
+} |
79 |
+ |
80 |
+_check_fetch_restriction() { |
81 |
+ debug-print-function ${FUNCNAME} "$@" |
82 |
+ if [[ ${KDE_RELEASE_DATE} == "none" ]]; then |
83 |
+ KDE_RELEASE_DATE=_get_releasedate |
84 |
+ fi |
85 |
+ if [[ ${KDE_RELEASE_DATE} != "none" ]]; then |
86 |
+ if [[ $(date +"%Y%m%d") < ${KDE_RELEASE_DATE} ]]; then |
87 |
+ RESTRICT+=" fetch" |
88 |
+ fi |
89 |
+ fi |
90 |
+} |
91 |
+ |
92 |
case ${KDE_BUILD_TYPE} in |
93 |
live) _calculate_live_repo ;; |
94 |
- *) _calculate_src_uri ;; |
95 |
+ *) _calculate_src_uri |
96 |
+ _check_fetch_restriction ;; |
97 |
esac |
98 |
|
99 |
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" |
100 |
@@ -331,6 +383,17 @@ kde5_pkg_setup() { |
101 |
_check_gcc_version |
102 |
} |
103 |
|
104 |
+# @FUNCTION: kde5_pkg_nofetch |
105 |
+# @DESCRIPTION: |
106 |
+# Display package publication status |
107 |
+kde5_pkg_nofetch() { |
108 |
+ einfo "${CATEGORY}/${P} has not been released to the public yet" |
109 |
+ einfo "and is only available to packagers right now." |
110 |
+ einfo "" |
111 |
+ einfo "Further information:" |
112 |
+ einfo "https://techbase.kde.org/Schedules" |
113 |
+} |
114 |
+ |
115 |
# @FUNCTION: kde5_src_unpack |
116 |
# @DESCRIPTION: |
117 |
# Function for unpacking KDE 5. |