From 988ccfa58befb2960763275ef8589a6bd5495d5d Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Tue, 14 Apr 2020 23:34:34 +0200 Subject: [PATCH] mozextension.eclass: fix sed which determines extension id Closes: https://bugs.gentoo.org/717348 Signed-off-by: Thomas Deutschmann --- eclass/mozextension.eclass | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass index 68f401ee8661..ea4f1eb143e9 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 -- 2.26.2