Gentoo Archives: gentoo-commits

From: Gilles Dartiguelongue <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 24 Nov 2015 21:59:00
Message-Id: 1448402247.e09622cc4d6d804df011c678391e2950de048668.eva@gentoo
1 commit: e09622cc4d6d804df011c678391e2950de048668
2 Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 24 17:53:06 2015 +0000
4 Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 24 21:57:27 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e09622cc
7
8 xdg*.eclass: add support for EAPI 0, 1 and 2
9
10 Until bug #566728 is fixed.
11
12 https://bugs.gentoo.org/show_bug.cgi?id=566728
13
14 eclass/xdg-utils.eclass | 2 +-
15 eclass/xdg.eclass | 9 ++++++---
16 2 files changed, 7 insertions(+), 4 deletions(-)
17
18 diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
19 index ff22b39..61d5e9d 100644
20 --- a/eclass/xdg-utils.eclass
21 +++ b/eclass/xdg-utils.eclass
22 @@ -16,7 +16,7 @@
23 # * XDG mime information database management
24
25 case "${EAPI:-0}" in
26 - 4|5|6) ;;
27 + 0|1|2|3|4|5|6) ;;
28 *) die "EAPI=${EAPI} is not supported" ;;
29 esac
30
31
32 diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
33 index 26c41c3..1914687 100644
34 --- a/eclass/xdg.eclass
35 +++ b/eclass/xdg.eclass
36 @@ -15,7 +15,7 @@
37 inherit xdg-utils
38
39 case "${EAPI:-0}" in
40 - 4|5|6)
41 + 0|1|2|3|4|5|6)
42 EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm
43 ;;
44 *) die "EAPI=${EAPI} is not supported" ;;
45 @@ -41,8 +41,11 @@ xdg_src_prepare() {
46 # Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES
47 # respectively.
48 xdg_pkg_preinst() {
49 - export XDG_ECLASS_DESKTOPFILES=( $(cd "${D}" && find 'usr/share/applications' -type f -print0 2> /dev/null) )
50 - export XDG_ECLASS_MIMEINFOFILES=( $(cd "${D}" && find 'usr/share/mime' -type f -print0 2> /dev/null) )
51 + has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
52 + pushd "${ED}" > /dev/null || die
53 + export XDG_ECLASS_DESKTOPFILES=( $(find 'usr/share/applications' -type f -print0 2> /dev/null) )
54 + export XDG_ECLASS_MIMEINFOFILES=( $(find 'usr/share/mime' -type f -print0 2> /dev/null) )
55 + popd > /dev/null || die
56 }
57
58 # @FUNCTION: xdg_pkg_postinst