summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/mozextension.eclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass
index 9d22166e9d7..425da7e85bf 100644
--- a/eclass/mozextension.eclass
+++ b/eclass/mozextension.eclass
@@ -69,10 +69,18 @@ xpi_install() {
[[ ${#} -ne 1 ]] && die "$FUNCNAME takes exactly one argument, please specify an xpi to unpack"
x="${1}"
- cd ${x}
+ #cd ${x}
# determine id for extension
+ if [[ -f "${x}"/install.rdf ]]; then
emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)" \
- || die "failed to determine extension id"
+ || die "failed to determine extension id from install.rdf"
+ elif [[ -f "${x}"/manifest.json ]]; then
+ emid="$( sed -n 's/.*"id": "\(.*\)",/\1/p' "${x}"/manifest.json )" \
+ || die "failed to determine extension id from manifest.json"
+ else
+ die "failed to determine extension id"
+ fi
+
if [[ -n ${MOZEXTENSION_TARGET} ]]; then
insinto "${MOZILLA_FIVE_HOME}"/${MOZEXTENSION_TARGET%/}/${emid}
elif $(mozversion_extension_location) ; then