diff options
author | Gilles Dartiguelongue <eva@gentoo.org> | 2015-11-24 18:53:06 +0100 |
---|---|---|
committer | Gilles Dartiguelongue <eva@gentoo.org> | 2015-11-24 22:57:27 +0100 |
commit | e09622cc4d6d804df011c678391e2950de048668 (patch) | |
tree | f3e43b62fdd3d3d942cccd6c0e42e5cef17e8e8a | |
parent | xdg-utils.eclass: add phase check (diff) | |
download | gentoo-e09622cc4d6d804df011c678391e2950de048668.tar.gz gentoo-e09622cc4d6d804df011c678391e2950de048668.tar.bz2 gentoo-e09622cc4d6d804df011c678391e2950de048668.zip |
xdg*.eclass: add support for EAPI 0, 1 and 2
Until bug #566728 is fixed.
https://bugs.gentoo.org/show_bug.cgi?id=566728
-rw-r--r-- | eclass/xdg-utils.eclass | 2 | ||||
-rw-r--r-- | eclass/xdg.eclass | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass index ff22b39ce110..61d5e9d8066d 100644 --- a/eclass/xdg-utils.eclass +++ b/eclass/xdg-utils.eclass @@ -16,7 +16,7 @@ # * XDG mime information database management case "${EAPI:-0}" in - 4|5|6) ;; + 0|1|2|3|4|5|6) ;; *) die "EAPI=${EAPI} is not supported" ;; esac diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass index 26c41c351071..19146878a6a7 100644 --- a/eclass/xdg.eclass +++ b/eclass/xdg.eclass @@ -15,7 +15,7 @@ inherit xdg-utils case "${EAPI:-0}" in - 4|5|6) + 0|1|2|3|4|5|6) EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm ;; *) die "EAPI=${EAPI} is not supported" ;; @@ -41,8 +41,11 @@ xdg_src_prepare() { # Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES # respectively. xdg_pkg_preinst() { - export XDG_ECLASS_DESKTOPFILES=( $(cd "${D}" && find 'usr/share/applications' -type f -print0 2> /dev/null) ) - export XDG_ECLASS_MIMEINFOFILES=( $(cd "${D}" && find 'usr/share/mime' -type f -print0 2> /dev/null) ) + has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}" + pushd "${ED}" > /dev/null || die + export XDG_ECLASS_DESKTOPFILES=( $(find 'usr/share/applications' -type f -print0 2> /dev/null) ) + export XDG_ECLASS_MIMEINFOFILES=( $(find 'usr/share/mime' -type f -print0 2> /dev/null) ) + popd > /dev/null || die } # @FUNCTION: xdg_pkg_postinst |