migrate Gentoo Prefix changes
authorJeremy Olexa <darkside@gentoo.org>
Tue, 9 Aug 2011 18:47:40 +0000 (18:47 +0000)
committerJeremy Olexa <darkside@gentoo.org>
Tue, 9 Aug 2011 18:47:40 +0000 (18:47 +0000)
eclass/fdo-mime.eclass
eclass/nsplugins.eclass

index e37699979ac4d424447717fe02e70af698e8095c..eae5c1f5b89aadf9e0fdb09d09c4b3dacf9478a6 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/fdo-mime.eclass,v 1.10 2011/04/21 21:21:26 eva Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/fdo-mime.eclass,v 1.11 2011/08/09 18:43:05 darkside Exp $
 
 # @ECLASS: fdo-mime.eclass
 # @MAINTAINER: freedesktop-bugs@gentoo.org
 # Updates the desktop database.
 # Generates a list of mimetypes linked to applications that can handle them
 fdo-mime_desktop_database_update() {
-       if [ -x "/usr/bin/update-desktop-database" ]
+       has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+       if [ -x "${EPREFIX}/usr/bin/update-desktop-database" ]
        then
                einfo "Updating desktop mime database ..."
-               "/usr/bin/update-desktop-database" -q "${ROOT}/usr/share/applications"
+               "${EPREFIX}/usr/bin/update-desktop-database" -q "${EROOT}/usr/share/applications"
        fi
 }
 
@@ -27,9 +28,10 @@ fdo-mime_desktop_database_update() {
 # Update the mime database.
 # Creates a general list of mime types from several sources
 fdo-mime_mime_database_update() {
-       if [ -x "/usr/bin/update-mime-database" ]
+       has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+       if [ -x "${EPREFIX}/usr/bin/update-mime-database" ]
        then
                einfo "Updating shared mime info database ..."
-               "/usr/bin/update-mime-database" "${ROOT}/usr/share/mime"
+               "${EPREFIX}/usr/bin/update-mime-database" "${EROOT%/}/usr/share/mime"
        fi
 }
index fc95ed3f89e2512c8c497559b2cd949ca1d451a3..fa456c8eeb82d32b7e2022cc0000d9c3400d7808 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/nsplugins.eclass,v 1.24 2009/05/01 23:03:00 nirbheek Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/nsplugins.eclass,v 1.25 2011/08/09 18:47:40 darkside Exp $
 #
 # Author: Martin Schlemmer <azarah@gentoo.org>
 #
@@ -16,12 +16,13 @@ PLUGINS_DIR="nsbrowser/plugins"
 # ${D}/usr/$(get_libdir)/${PLUGIN_DIR}.  First argument should be
 # the full path (without $D) to old plugin dir.
 src_mv_plugins() {
+       has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
 
        # Move plugins dir.  We use keepdir so that it might not be unmerged
        # by mistake ...
        keepdir /usr/$(get_libdir)/${PLUGINS_DIR}
-       cp -a "${D}"/$1/* "${D}"/usr/$(get_libdir)/${PLUGINS_DIR}
-       rm -rf "${D}"/$1
+       cp -a "${ED}"/$1/* "${ED}"/usr/$(get_libdir)/${PLUGINS_DIR}
+       rm -rf "${ED}"/$1
        dosym /usr/$(get_libdir)/${PLUGINS_DIR} $1
 }
 
@@ -29,13 +30,14 @@ src_mv_plugins() {
 # ${ROOT}/usr/$(get_libdir)/${PLUGIN_DIR}.  First argument should be
 # the full path (without $ROOT) to old plugin dir.
 pkg_mv_plugins() {
+       has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${ROOT}"
 
        # Move old plugins dir
        if [ -d "${ROOT}/$1" -a ! -L "${ROOT}/$1" ]
        then
-               mkdir -p "${ROOT}"/usr/$(get_libdir)/${PLUGINS_DIR}
-               cp -a "${ROOT}"/$1/* "${ROOT}"/usr/$(get_libdir)/${PLUGINS_DIR}
-               rm -rf "${ROOT}"/$1
+               mkdir -p "${EROOT}"/usr/$(get_libdir)/${PLUGINS_DIR}
+               cp -a "${EROOT}"/$1/* "${EROOT}"/usr/$(get_libdir)/${PLUGINS_DIR}
+               rm -rf "${EROOT}"/$1
        fi
 }