commit:     384863a639243bca26e457c3536c4c33cd32f9c1
Author:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 16 15:39:40 2015 +0000
Commit:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
CommitDate: Thu Jul 16 15:41:17 2015 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=384863a6

mozextension.eclass - add variable to allow setting of extension install 
basepath

 eclass/mozextension.eclass | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass
index ef410d3..bced3a1 100644
--- a/eclass/mozextension.eclass
+++ b/eclass/mozextension.eclass
@@ -1,14 +1,22 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/mozextension.eclass,v 1.8 2013/04/05 
15:27:40 floppym Exp $
+# $Header: $
 #
 # @ECLASS: mozextension.eclass
 # @MAINTAINER:
 # Mozilla team <[email protected]>
 # @BLURB: Install extensions for use in mozilla products.
-
+#
 if [[ ! ${_MOZEXTENSION} ]]; then
 
+# @ECLASS-VARIABLE: MOZEXTENSION_TARGET
+# @DESCRIPTION:
+# This variable allows the installation path for xpi_install
+# to be overridden from the default app-global extensions path.
+# Default is empty, which installs to predetermined hard-coded
+# paths specified in the eclass.
+: ${MOZEXTENSION_TARGET:=""}
+
 inherit eutils
 
 DEPEND="app-arch/unzip"
@@ -66,7 +74,9 @@ xpi_install() {
        # determine id for extension
        emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; 
s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)" \
                || die "failed to determine extension id"
-       if $(mozversion_extension_location) ; then
+       if [[ -n ${MOZEXTENSION_TARGET} ]]; then
+               insinto "${MOZILLA_FIVE_HOME}"/${MOZEXTENSION_TARGET%/}/${emid}
+       elif $(mozversion_extension_location) ; then
                insinto "${MOZILLA_FIVE_HOME}"/browser/extensions/${emid}
        else
                insinto "${MOZILLA_FIVE_HOME}"/extensions/${emid}

Reply via email to