From 45d898ec1a50fff6b9818bc072266ebb086f0632 Mon Sep 17 00:00:00 2001 From: Martin Väth Date: Sat, 27 Jan 2018 14:23:16 +0100 Subject: mv_mozextension-r1.eclass: manifest.json: search "id" only inside "gecko" --- eclass/ChangeLog | 5 ++++- eclass/mv_mozextension-r1.eclass | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'eclass') diff --git a/eclass/ChangeLog b/eclass/ChangeLog index e7f513ac..bf4c76a6 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,5 +1,5 @@ # ChangeLog for eclass directory -# Copyright 2017 Gentoo Foundation; Distributed under the GPL v2 +# Copyright 2018 Gentoo Foundation; Distributed under the GPL v2 12 May 2012; Martin Väth : Created ChangeLog @@ -74,3 +74,6 @@ 27 Dec 2017; Martin Väth : Remove meson_optional.eclass since meson.eclass in gentoo repository is fixed + + 27 Jan 2018; Martin Väth : + mv_mozextension-r1.eclass: manifest.json: search "id" only inside "gecko" 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} -- cgit v1.2.3-65-gdbad