commit:     988ccfa58befb2960763275ef8589a6bd5495d5d
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 14 21:34:34 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Apr 14 23:42:02 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=988ccfa5

mozextension.eclass: fix sed which determines extension id

Closes: https://bugs.gentoo.org/717348
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 eclass/mozextension.eclass | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass
index 68f401ee866..ea4f1eb143e 100644
--- a/eclass/mozextension.eclass
+++ b/eclass/mozextension.eclass
@@ -72,11 +72,11 @@ xpi_install() {
        #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 from install.rdf"
+               emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; 
s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)"
+               [[ -z "${emid}" ]] && 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"
+               emid="$( sed -n 's/.*"id": "\(.*\)".*/\1/p' 
"${x}"/manifest.json )"
+               [[ -z "${emid}" ]] && die "failed to determine extension id 
from manifest.json"
        else
                die "failed to determine extension id"
        fi
@@ -101,11 +101,11 @@ xpi_copy() {
        #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 from install.rdf"
+               emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; 
s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)"
+               [[ -z "${emid}" ]] && 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"
+               emid="$(sed -n 's/.*"id": "\([^"]*\)".*/\1/p' 
"${x}"/manifest.json)"
+               [[ -z "${emid}" ]] && die "failed to determine extension id 
from manifest.json"
        else
                die "failed to determine extension id"
        fi

Reply via email to