summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <eva@gentoo.org>2015-11-24 18:53:06 +0100
committerGilles Dartiguelongue <eva@gentoo.org>2015-11-24 22:57:27 +0100
commite09622cc4d6d804df011c678391e2950de048668 (patch)
treef3e43b62fdd3d3d942cccd6c0e42e5cef17e8e8a /eclass/xdg.eclass
parentxdg-utils.eclass: add phase check (diff)
downloadgentoo-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
Diffstat (limited to 'eclass/xdg.eclass')
-rw-r--r--eclass/xdg.eclass9
1 files changed, 6 insertions, 3 deletions
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