summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2018-01-25 14:18:09 -0500
committerIan Stakenvicius <axs@gentoo.org>2018-01-25 14:20:29 -0500
commitc612e2880512912ec76b414deb8d13fbcc40e190 (patch)
tree82a8c45ea0801e663d7916b7e51357c6be8f7743 /eclass/mozextension.eclass
parentapp-portage/gemato: Remove obsolete portage-postsync (diff)
downloadgentoo-c612e2880512912ec76b414deb8d13fbcc40e190.tar.gz
gentoo-c612e2880512912ec76b414deb8d13fbcc40e190.tar.bz2
gentoo-c612e2880512912ec76b414deb8d13fbcc40e190.zip
mozextension.eclass: initial support for manifest.json exensions
Thanks to Sven B. for some initial legwork on this. Work is not complete as the extension installations should somehow also auto-validate themselves, but it will at least prevent bugs such as bug 645636 Bug: http://bugs.gentoo.org/645754
Diffstat (limited to 'eclass/mozextension.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 9d22166e9d73..425da7e85bf1 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