summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2018-01-27 14:23:16 +0100
committerMartin Väth <martin@mvath.de>2018-01-27 14:23:16 +0100
commit45d898ec1a50fff6b9818bc072266ebb086f0632 (patch)
tree5474f852744ef04792131b50d8e1515af44fcbac /eclass/mv_mozextension-r1.eclass
parentapp-portage/eix: Alpha version bump. Enable available spectre mitigation (diff)
downloadmv-45d898ec1a50fff6b9818bc072266ebb086f0632.tar.gz
mv-45d898ec1a50fff6b9818bc072266ebb086f0632.tar.bz2
mv-45d898ec1a50fff6b9818bc072266ebb086f0632.zip
mv_mozextension-r1.eclass: manifest.json: search "id" only inside "gecko"
Diffstat (limited to 'eclass/mv_mozextension-r1.eclass')
-rw-r--r--eclass/mv_mozextension-r1.eclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/eclass/mv_mozextension-r1.eclass b/eclass/mv_mozextension-r1.eclass
index 1f25a6a4..7062cd3a 100644
--- a/eclass/mv_mozextension-r1.eclass
+++ b/eclass/mv_mozextension-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 2017 Gentoo Foundation
+# Copyright 2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: mv_mozextension-r1.eclass
@@ -356,9 +356,10 @@ moz_getid() {
res=$(sed -n -e '/install-manifest/,$ '"${sub}" -- "${file}") || res=
else file=${dir}/manifest.json
test -f "${file}" || die "cannot find ${dir}/{install.rdf,manifest.json}"
- sub='^[[:space:]]*["'\''][iI][dD]["'\''][[:space:]]*:[[:space:]]*'
- sub=${sub}'["'\'']\(.*\)["'\''][[:space:]]*,\?[[:space:]]*$/\1'
- res=$(sed -n -e "s/${sub}/p" -- "${file}") || res=
+ sub='/^[[:space:]]*["'\'']gecko["'\''][[:space:]]*:/,/\}/s/'
+ sub=${sub}'^[[:space:]]*["'\'']id["'\''][[:space:]]*:[[:space:]]*'
+ sub=${sub}'["'\'']\(.*\)["'\''][[:space:]]*,\?[[:space:]]*$/\1/p'
+ res=$(sed -n -e "${sub}" -- "${file}") || res=
fi
[ -n "${res}" ] || die "failed to determine id from ${file}"
eval ${var}=\${res}