1 |
commit: 749ca048e97ab86232907aa1caa13b4104779d32 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 22 17:06:58 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 22 20:06:34 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=749ca048 |
7 |
|
8 |
kde-plasma/plasma-workspace: Improve old script detection/migration |
9 |
|
10 |
- Drop mkdir and chmod commands |
11 |
- Add missing || die |
12 |
- No need for subshells to detect constant paths |
13 |
- Use md5sum to detect if existing scripts were modified at all |
14 |
- Clean up pre-5.17.4 scripts, they were owned by plasma-workspace anyway |
15 |
|
16 |
Bug: https://bugs.gentoo.org/688366 |
17 |
Package-Manager: Portage-2.3.82, Repoman-2.3.20 |
18 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
19 |
|
20 |
.../plasma-workspace-5.17.49.9999.ebuild | 112 ++++++++++++--------- |
21 |
.../plasma-workspace/plasma-workspace-9999.ebuild | 83 ++++++++------- |
22 |
2 files changed, 112 insertions(+), 83 deletions(-) |
23 |
|
24 |
diff --git a/kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild b/kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild |
25 |
index 88f5a6d01f..a79c18f580 100644 |
26 |
--- a/kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild |
27 |
+++ b/kde-plasma/plasma-workspace/plasma-workspace-5.17.49.9999.ebuild |
28 |
@@ -22,6 +22,14 @@ REQUIRED_USE="gps? ( geolocation )" |
29 |
|
30 |
# drop qtgui subslot operator when QT_MINIMAL >= 5.14.0 |
31 |
COMMON_DEPEND=" |
32 |
+ >=dev-qt/qtdbus-${QTMIN}:5 |
33 |
+ >=dev-qt/qtdeclarative-${QTMIN}:5[widgets] |
34 |
+ >=dev-qt/qtgui-${QTMIN}:5=[jpeg] |
35 |
+ >=dev-qt/qtnetwork-${QTMIN}:5 |
36 |
+ >=dev-qt/qtsql-${QTMIN}:5 |
37 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
38 |
+ >=dev-qt/qtx11extras-${QTMIN}:5 |
39 |
+ >=dev-qt/qtxml-${QTMIN}:5 |
40 |
>=kde-frameworks/kactivities-${KFMIN}:5 |
41 |
>=kde-frameworks/kactivities-stats-${KFMIN}:5 |
42 |
>=kde-frameworks/kauth-${KFMIN}:5 |
43 |
@@ -65,14 +73,6 @@ COMMON_DEPEND=" |
44 |
>=kde-plasma/libkscreen-${PVCUT}:5 |
45 |
>=kde-plasma/libksysguard-${PVCUT}:5 |
46 |
>=kde-plasma/libkworkspace-${PVCUT}:5 |
47 |
- >=dev-qt/qtdbus-${QTMIN}:5 |
48 |
- >=dev-qt/qtdeclarative-${QTMIN}:5[widgets] |
49 |
- >=dev-qt/qtgui-${QTMIN}:5=[jpeg] |
50 |
- >=dev-qt/qtnetwork-${QTMIN}:5 |
51 |
- >=dev-qt/qtsql-${QTMIN}:5 |
52 |
- >=dev-qt/qtwidgets-${QTMIN}:5 |
53 |
- >=dev-qt/qtx11extras-${QTMIN}:5 |
54 |
- >=dev-qt/qtxml-${QTMIN}:5 |
55 |
media-libs/phonon[qt5(+)] |
56 |
sys-libs/zlib |
57 |
x11-libs/libICE |
58 |
@@ -98,18 +98,18 @@ DEPEND="${COMMON_DEPEND} |
59 |
x11-base/xorg-proto |
60 |
" |
61 |
RDEPEND="${COMMON_DEPEND} |
62 |
- >=kde-frameworks/kdesu-${KFMIN}:5 |
63 |
- >=kde-frameworks/kirigami-${KFMIN}:5 |
64 |
- >=kde-apps/kio-extras-19.04.3:5 |
65 |
- >=kde-plasma/ksysguard-${PVCUT}:5 |
66 |
- >=kde-plasma/milou-${PVCUT}:5 |
67 |
- >=kde-plasma/plasma-integration-${PVCUT}:5 |
68 |
+ app-text/iso-codes |
69 |
>=dev-qt/qdbus-${QTMIN}:5 |
70 |
>=dev-qt/qtgraphicaleffects-${QTMIN}:5 |
71 |
>=dev-qt/qtpaths-${QTMIN}:5 |
72 |
>=dev-qt/qtquickcontrols-${QTMIN}:5[widgets] |
73 |
>=dev-qt/qtquickcontrols2-${QTMIN}:5 |
74 |
- app-text/iso-codes |
75 |
+ >=kde-apps/kio-extras-19.04.3:5 |
76 |
+ >=kde-frameworks/kdesu-${KFMIN}:5 |
77 |
+ >=kde-frameworks/kirigami-${KFMIN}:5 |
78 |
+ >=kde-plasma/ksysguard-${PVCUT}:5 |
79 |
+ >=kde-plasma/milou-${PVCUT}:5 |
80 |
+ >=kde-plasma/plasma-integration-${PVCUT}:5 |
81 |
x11-apps/xmessage |
82 |
x11-apps/xprop |
83 |
x11-apps/xrdb |
84 |
@@ -129,15 +129,42 @@ PATCHES=( |
85 |
|
86 |
RESTRICT+=" test" |
87 |
|
88 |
-# used for agent scripts migration |
89 |
-OLDST=/etc/plasma/startup/10-agent-startup.sh |
90 |
-NEWST=/etc/xdg/plasma-workspace/env/10-agent-startup.sh |
91 |
-OLDSH=/etc/plasma/shutdown/10-agent-shutdown.sh |
92 |
-NEWSH=/etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh |
93 |
+pkg_setup() { |
94 |
+ ecm_pkg_setup |
95 |
+ |
96 |
+ local md5 |
97 |
+ local srcfile=/etc/plasma/XX/10-agent-XX.sh |
98 |
+ local newdir="${EPREFIX}"/etc/xdg/plasma-workspace |
99 |
+ |
100 |
+ if [[ -f "${EROOT}"${srcfile//XX/startup} ]]; then |
101 |
+ md5=$(md5sum "${EROOT}"${srcfile//XX/startup}) |
102 |
+ if [[ ${md5%% *} != 90caaabb40b56bfbe65388841a6dd6ca ]]; then |
103 |
+ elog "Existing modified ${EPREFIX}${srcfile//XX/startup} detected." |
104 |
+ elog "Copying to ${newdir}/env/10-agent-startup.sh..." |
105 |
+ cp -v "${EROOT}"${srcfile//XX/startup} "${T}"/ || die |
106 |
+ fi |
107 |
+ fi |
108 |
+ |
109 |
+ if [[ -f "${EROOT}"${srcfile//XX/shutdown} ]]; then |
110 |
+ md5=$(md5sum "${EROOT}"${srcfile//XX/shutdown}) |
111 |
+ if [[ ${md5%% *} != d7bffa0273f92abd999c7c3c43dbc23d ]]; then |
112 |
+ elog "Existing modified ${EPREFIX}${srcfile//XX/shutdown} detected." |
113 |
+ elog "Copying to ${newdir}/shutdown/10-agent-shutdown.sh..." |
114 |
+ cp -v "${EROOT}"${srcfile//XX/shutdown} "${T}"/ || die |
115 |
+ fi |
116 |
+ fi |
117 |
+} |
118 |
|
119 |
src_prepare() { |
120 |
ecm_src_prepare |
121 |
|
122 |
+ if [[ ! -f "${T}"/10-agent-startup.sh ]]; then |
123 |
+ cp "${FILESDIR}"/10-agent-startup.sh "${T}"/ || die |
124 |
+ fi |
125 |
+ if [[ ! -f "${T}"/10-agent-shutdown.sh ]]; then |
126 |
+ cp "${FILESDIR}"/10-agent-shutdown.sh "${T}"/ || die |
127 |
+ fi |
128 |
+ |
129 |
cmake_comment_add_subdirectory libkworkspace |
130 |
# delete colliding libkworkspace translations |
131 |
if [[ ${KDE_BUILD_TYPE} = release ]]; then |
132 |
@@ -165,41 +192,28 @@ src_install() { |
133 |
ecm_src_install |
134 |
|
135 |
# default startup and shutdown scripts |
136 |
- insinto "$(dirname ${NEWST})" |
137 |
- doins "${FILESDIR}/$(basename ${NEWST})" |
138 |
+ insinto /etc/xdg/plasma-workspace/env |
139 |
+ doins "${T}"/10-agent-startup.sh |
140 |
|
141 |
- insinto "$(dirname ${NEWSH})" |
142 |
- doins "${FILESDIR}/$(basename ${NEWSH})" |
143 |
- fperms +x "${NEWSH}" |
144 |
-} |
145 |
- |
146 |
-pkg_preinst() { |
147 |
- ecm_pkg_preinst |
148 |
- |
149 |
- # migrate existing agent scripts to new layout if no files there yet |
150 |
- if [[ -r "${EROOT}${OLDST}" && ! -f "${EROOT}${NEWST}" ]]; then |
151 |
- mkdir -p "${EROOT}$(dirname ${NEWST})" && cp "${EROOT}${OLDST}" "${EROOT}${NEWST}" && \ |
152 |
- elog "${EROOT}${OLDST} has been migrated to ${EROOT}${NEWST}, please delete old file." |
153 |
- fi |
154 |
- if [[ -r "${EROOT}${OLDSH}" && ! -f "${EROOT}${NEWSH}" ]]; then |
155 |
- mkdir -p "${EROOT}$(dirname ${NEWSH})" && cp "${EROOT}${OLDSH}" "${EROOT}${NEWSH}" && \ |
156 |
- chmod +x "${EROOT}${NEWSH}" && \ |
157 |
- elog "${EROOT}${OLDSH} has been migrated to ${EROOT}${NEWSH}, please delete old file." |
158 |
- fi |
159 |
+ insinto /etc/xdg/plasma-workspace/shutdown |
160 |
+ doins "${T}"/10-agent-shutdown.sh |
161 |
+ fperms +x /etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh |
162 |
} |
163 |
|
164 |
pkg_postinst () { |
165 |
ecm_pkg_postinst |
166 |
|
167 |
- # warn about any leftover user scripts |
168 |
- if [[ -d "${EROOT}"/etc/plasma/startup && -n "$(ls "${EROOT}"/etc/plasma/startup)" ]] || \ |
169 |
- [[ -d "${EROOT}"/etc/plasma/shutdown && -n "$(ls "${EROOT}"/etc/plasma/shutdown)" ]]; then |
170 |
- elog "You appear to have scripts in ${EROOT}/etc/plasma/{startup,shutdown}." |
171 |
- elog "They will no longer work since plasma-workspace-5.17" |
172 |
+ # Clean up pre-5.17.4 scripts |
173 |
+ if [[ -e "${EROOT}"/etc/plasma/startup/10-agent-startup.sh ]]; then |
174 |
+ rm "${EROOT}"/etc/plasma/startup/10-agent-startup.sh || die |
175 |
+ elog "Removed obsolete ${EPREFIX}/etc/plasma/startup/10-agent-startup.sh" |
176 |
+ fi |
177 |
+ if [[ -e "${EROOT}"/etc/plasma/shutdown/10-agent-shutdown.sh ]]; then |
178 |
+ rm "${EROOT}"/etc/plasma/shutdown/10-agent-shutdown.sh || die |
179 |
+ elog "Removed obsolete ${EPREFIX}/etc/plasma/shutdown/10-agent-shutdown.sh" |
180 |
fi |
181 |
|
182 |
- elog " * Edit ${EROOT}${NEWST} and uncomment" |
183 |
- elog " the lines enabling ssh-agent." |
184 |
- elog " * Edit ${EROOT}${NEWSH} uncomment" |
185 |
- elog " the respective lines to properly kill the agent when the session ends." |
186 |
+ elog "To enable gpg-agent and/or ssh-agent in Plasma sessions," |
187 |
+ elog "edit ${EPREFIX}/etc/xdg/plasma-workspace/env/10-agent-startup.sh" |
188 |
+ elog "and ${EPREFIX}/etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh" |
189 |
} |
190 |
|
191 |
diff --git a/kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild b/kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild |
192 |
index 967f124f40..c6f09ef208 100644 |
193 |
--- a/kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild |
194 |
+++ b/kde-plasma/plasma-workspace/plasma-workspace-9999.ebuild |
195 |
@@ -12,6 +12,7 @@ VIRTUALX_REQUIRED="test" |
196 |
inherit ecm kde.org |
197 |
|
198 |
DESCRIPTION="KDE Plasma workspace" |
199 |
+ |
200 |
LICENSE="GPL-2" # TODO: CHECK |
201 |
SLOT="5" |
202 |
KEYWORDS="" |
203 |
@@ -127,15 +128,42 @@ PATCHES=( "${FILESDIR}/${PN}-5.14.2-split-libkworkspace.patch" ) |
204 |
|
205 |
RESTRICT+=" test" |
206 |
|
207 |
-# used for agent scripts migration |
208 |
-OLDST=/etc/plasma/startup/10-agent-startup.sh |
209 |
-NEWST=/etc/xdg/plasma-workspace/env/10-agent-startup.sh |
210 |
-OLDSH=/etc/plasma/shutdown/10-agent-shutdown.sh |
211 |
-NEWSH=/etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh |
212 |
+pkg_setup() { |
213 |
+ ecm_pkg_setup |
214 |
+ |
215 |
+ local md5 |
216 |
+ local srcfile=/etc/plasma/XX/10-agent-XX.sh |
217 |
+ local newdir="${EPREFIX}"/etc/xdg/plasma-workspace |
218 |
+ |
219 |
+ if [[ -f "${EROOT}"${srcfile//XX/startup} ]]; then |
220 |
+ md5=$(md5sum "${EROOT}"${srcfile//XX/startup}) |
221 |
+ if [[ ${md5%% *} != 90caaabb40b56bfbe65388841a6dd6ca ]]; then |
222 |
+ elog "Existing modified ${EPREFIX}${srcfile//XX/startup} detected." |
223 |
+ elog "Copying to ${newdir}/env/10-agent-startup.sh..." |
224 |
+ cp -v "${EROOT}"${srcfile//XX/startup} "${T}"/ || die |
225 |
+ fi |
226 |
+ fi |
227 |
+ |
228 |
+ if [[ -f "${EROOT}"${srcfile//XX/shutdown} ]]; then |
229 |
+ md5=$(md5sum "${EROOT}"${srcfile//XX/shutdown}) |
230 |
+ if [[ ${md5%% *} != d7bffa0273f92abd999c7c3c43dbc23d ]]; then |
231 |
+ elog "Existing modified ${EPREFIX}${srcfile//XX/shutdown} detected." |
232 |
+ elog "Copying to ${newdir}/shutdown/10-agent-shutdown.sh..." |
233 |
+ cp -v "${EROOT}"${srcfile//XX/shutdown} "${T}"/ || die |
234 |
+ fi |
235 |
+ fi |
236 |
+} |
237 |
|
238 |
src_prepare() { |
239 |
ecm_src_prepare |
240 |
|
241 |
+ if [[ ! -f "${T}"/10-agent-startup.sh ]]; then |
242 |
+ cp "${FILESDIR}"/10-agent-startup.sh "${T}"/ || die |
243 |
+ fi |
244 |
+ if [[ ! -f "${T}"/10-agent-shutdown.sh ]]; then |
245 |
+ cp "${FILESDIR}"/10-agent-shutdown.sh "${T}"/ || die |
246 |
+ fi |
247 |
+ |
248 |
cmake_comment_add_subdirectory libkworkspace |
249 |
# delete colliding libkworkspace translations |
250 |
if [[ ${KDE_BUILD_TYPE} = release ]]; then |
251 |
@@ -164,41 +192,28 @@ src_install() { |
252 |
ecm_src_install |
253 |
|
254 |
# default startup and shutdown scripts |
255 |
- insinto "$(dirname ${NEWST})" |
256 |
- doins "${FILESDIR}/$(basename ${NEWST})" |
257 |
- |
258 |
- insinto "$(dirname ${NEWSH})" |
259 |
- doins "${FILESDIR}/$(basename ${NEWSH})" |
260 |
- fperms +x "${NEWSH}" |
261 |
-} |
262 |
+ insinto /etc/xdg/plasma-workspace/env |
263 |
+ doins "${T}"/10-agent-startup.sh |
264 |
|
265 |
-pkg_preinst() { |
266 |
- ecm_pkg_preinst |
267 |
- |
268 |
- # migrate existing agent scripts to new layout if no files there yet |
269 |
- if [[ -r "${EROOT}${OLDST}" && ! -f "${EROOT}${NEWST}" ]]; then |
270 |
- mkdir -p "${EROOT}$(dirname ${NEWST})" && cp "${EROOT}${OLDST}" "${EROOT}${NEWST}" && \ |
271 |
- elog "${EROOT}${OLDST} has been migrated to ${EROOT}${NEWST}, please delete old file." |
272 |
- fi |
273 |
- if [[ -r "${EROOT}${OLDSH}" && ! -f "${EROOT}${NEWSH}" ]]; then |
274 |
- mkdir -p "${EROOT}$(dirname ${NEWSH})" && cp "${EROOT}${OLDSH}" "${EROOT}${NEWSH}" && \ |
275 |
- chmod +x "${EROOT}${NEWSH}" && \ |
276 |
- elog "${EROOT}${OLDSH} has been migrated to ${EROOT}${NEWSH}, please delete old file." |
277 |
- fi |
278 |
+ insinto /etc/xdg/plasma-workspace/shutdown |
279 |
+ doins "${T}"/10-agent-shutdown.sh |
280 |
+ fperms +x /etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh |
281 |
} |
282 |
|
283 |
pkg_postinst () { |
284 |
ecm_pkg_postinst |
285 |
|
286 |
- # warn about any leftover user scripts |
287 |
- if [[ -d "${EROOT}"/etc/plasma/startup && -n "$(ls "${EROOT}"/etc/plasma/startup)" ]] || \ |
288 |
- [[ -d "${EROOT}"/etc/plasma/shutdown && -n "$(ls "${EROOT}"/etc/plasma/shutdown)" ]]; then |
289 |
- elog "You appear to have scripts in ${EROOT}/etc/plasma/{startup,shutdown}." |
290 |
- elog "They will no longer work since plasma-workspace-5.17" |
291 |
+ # Clean up pre-5.17.4 scripts |
292 |
+ if [[ -e "${EROOT}"/etc/plasma/startup/10-agent-startup.sh ]]; then |
293 |
+ rm "${EROOT}"/etc/plasma/startup/10-agent-startup.sh || die |
294 |
+ elog "Removed obsolete ${EPREFIX}/etc/plasma/startup/10-agent-startup.sh" |
295 |
+ fi |
296 |
+ if [[ -e "${EROOT}"/etc/plasma/shutdown/10-agent-shutdown.sh ]]; then |
297 |
+ rm "${EROOT}"/etc/plasma/shutdown/10-agent-shutdown.sh || die |
298 |
+ elog "Removed obsolete ${EPREFIX}/etc/plasma/shutdown/10-agent-shutdown.sh" |
299 |
fi |
300 |
|
301 |
- elog " * Edit ${EROOT}${NEWST} and uncomment" |
302 |
- elog " the lines enabling ssh-agent." |
303 |
- elog " * Edit ${EROOT}${NEWSH} uncomment" |
304 |
- elog " the respective lines to properly kill the agent when the session ends." |
305 |
+ elog "To enable gpg-agent and/or ssh-agent in Plasma sessions," |
306 |
+ elog "edit ${EPREFIX}/etc/xdg/plasma-workspace/env/10-agent-startup.sh" |
307 |
+ elog "and ${EPREFIX}/etc/xdg/plasma-workspace/shutdown/10-agent-shutdown.sh" |
308 |
} |