Merge pull request #178390 from aszlig/firefox-fix-signing-required-detection

This commit is contained in:
Martin Weinelt 2022-06-25 11:42:47 +02:00 committed by GitHub
commit b45a1a2e82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,12 +97,15 @@ let
nameArray = builtins.map(a: a.name) (if usesNixExtensions then nixExtensions else []);
requiresSigning = browser ? MOZ_REQUIRE_SIGNING
-> toString browser.MOZ_REQUIRE_SIGNING != "";
# Check that every extension has a unqiue .name attribute
# and an extid attribute
extensions = if nameArray != (lib.unique nameArray) then
throw "Firefox addon name needs to be unique"
else if ! (lib.hasSuffix "esr" browser.name) then
throw "Nix addons are only supported in Firefox ESR"
else if requiresSigning && !lib.hasSuffix "esr" browser.name then
throw "Nix addons are only supported without signature enforcement (eg. Firefox ESR)"
else builtins.map (a:
if ! (builtins.hasAttr "extid" a) then
throw "nixExtensions has an invalid entry. Missing extid attribute. Please use fetchfirefoxaddon"