aboutsummaryrefslogtreecommitdiff
path: root/licenses
ModeNameSize
-rw-r--r--agpl-3.0.txt34195logplainabout
-rw-r--r--cc-by-4.0.txt18657logplainabout
-rw-r--r--cc-by-sa-4.0.txt20138logplainabout
-rw-r--r--cc0.txt7048logplainabout
-rw-r--r--gpl-2.txt18004logplainabout
-rw-r--r--gpl-3.0.txt35149logplainabout
'del'>-map_del_instr() {
- printf 'unset %s__%s' "$1" "$2"
-}
-
-map_del() {
- eval "$(map_del_instr "$@")"
-}
-
-sanitize() {
- printf %s "$1" | tr /.- _
-}
-
-escape_regex_special() {
- printf %s "$1" | sed 's/\([]\.*?{},()[-]\)/\\\1/g'
-}
-
-# Note: We don't actually parse JSON. We extract needed keys with sed regexes
-# which does not work in the general case but is sufficient for now.
-get_json_key() {
- local KEY_REG="$(escape_regex_special "$1")"
- printf %s "$2" |
- sed 's/\(.*"'"$KEY_REG"'"[[:space:]]*:[[:space:]]*"\([^"]*\)"\)\?.*/\2/' |
- grep . | head -1
-}
diff --git a/upload_amo.sh b/upload_amo.sh
index 71e12ca..3739c9c 100755
--- a/upload_amo.sh
+++ b/upload_amo.sh
@@ -23,6 +23,27 @@ API_KEY="$2"
SECRET="$3"
XPI_PATH="$4"
+escape_regex_special() {
+ printf %s "$1" | sed 's/\([]\.*[-]\)/\\\1/g'
+}
+
+# Note: We don't actually parse JSON. We extract needed keys with sed regexes
+# which does not work in the general case but is sufficient for now.
+_get_json_key() {
+ local KEY_REG="$(escape_regex_special "$1")"
+ printf %s "$2" |
+ awk '{printf "%s", $0}' |
+ sed 's/^.*\("'"$KEY_REG"'"[[:space:]]*:[[:space:]]*"\([^"]*\)"\).*$/\2/'
+}
+
+get_json_key() {
+ local JSON="$2"
+ local VALUE="$(_get_json_key "$@")"
+ if [ "x$VALUE" != "x$JSON" ]; then
+ printf %s "$VALUE"
+ fi
+}
+
base64url() {
printf %s "$1" | base64 -w 0 | tr '/+' '_-' | tr -d '='
}