summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-04-14 23:34:34 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-04-15 01:42:02 +0200
commit988ccfa58befb2960763275ef8589a6bd5495d5d (patch)
treec65d9c87d49bfb96447d3bbeec1143c794e24110 /eclass/mozextension.eclass
parentsys-kernel/linux-firmware: bump to 20200413 (diff)
downloadgentoo-988ccfa58befb2960763275ef8589a6bd5495d5d.tar.gz
gentoo-988ccfa58befb2960763275ef8589a6bd5495d5d.tar.bz2
gentoo-988ccfa58befb2960763275ef8589a6bd5495d5d.zip
mozextension.eclass: fix sed which determines extension id
Closes: https://bugs.gentoo.org/717348 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'eclass/mozextension.eclass')
-rw-r--r--eclass/mozextension.eclass16
1 files 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