From 8cdae35bd9c4d681e02433a0e663220b5e49791f Mon Sep 17 00:00:00 2001 From: Martynas Date: Wed, 18 Oct 2023 11:32:31 +0200 Subject: [PATCH] Added urlencode functions to scripts --- scripts/admin/acl/create-authorization.sh | 5 +++++ scripts/admin/acl/create-group.sh | 5 +++++ scripts/create-container.sh | 1 + scripts/create-item.sh | 5 +++++ scripts/imports/create-file.sh | 5 +++++ 5 files changed, 21 insertions(+) diff --git a/scripts/admin/acl/create-authorization.sh b/scripts/admin/acl/create-authorization.sh index 30e8a74f8..bfbdf93ac 100755 --- a/scripts/admin/acl/create-authorization.sh +++ b/scripts/admin/acl/create-authorization.sh @@ -31,6 +31,11 @@ print_usage() hash turtle 2>/dev/null || { echo >&2 "turtle not on \$PATH. Need to set \$JENA_HOME. Aborting."; exit 1; } +urlencode() { + python -c 'import urllib, sys; print urllib.quote(sys.argv[1], sys.argv[2])' \ + "$1" "$urlencode_safe" +} + args=() while [[ $# -gt 0 ]] do diff --git a/scripts/admin/acl/create-group.sh b/scripts/admin/acl/create-group.sh index 2ed7628bb..6a6432f1a 100755 --- a/scripts/admin/acl/create-group.sh +++ b/scripts/admin/acl/create-group.sh @@ -23,6 +23,11 @@ print_usage() hash turtle 2>/dev/null || { echo >&2 "turtle not on \$PATH. Need to set \$JENA_HOME. Aborting."; exit 1; } +urlencode() { + python -c 'import urllib, sys; print urllib.quote(sys.argv[1], sys.argv[2])' \ + "$1" "$urlencode_safe" +} + args=() while [[ $# -gt 0 ]] do diff --git a/scripts/create-container.sh b/scripts/create-container.sh index 11e1529d4..cdccb6d97 100755 --- a/scripts/create-container.sh +++ b/scripts/create-container.sh @@ -21,6 +21,7 @@ print_usage() } hash turtle 2>/dev/null || { echo >&2 "turtle not on \$PATH. Need to set \$JENA_HOME. Aborting."; exit 1; } + urlencode() { python -c 'import urllib, sys; print urllib.quote(sys.argv[1], sys.argv[2])' \ "$1" "$urlencode_safe" diff --git a/scripts/create-item.sh b/scripts/create-item.sh index 544e6ed0c..8626e097b 100755 --- a/scripts/create-item.sh +++ b/scripts/create-item.sh @@ -21,6 +21,11 @@ print_usage() hash turtle 2>/dev/null || { echo >&2 "turtle not on \$PATH. Need to set \$JENA_HOME. Aborting."; exit 1; } +urlencode() { + python -c 'import urllib, sys; print urllib.quote(sys.argv[1], sys.argv[2])' \ + "$1" "$urlencode_safe" +} + args=() while [[ $# -gt 0 ]] do diff --git a/scripts/imports/create-file.sh b/scripts/imports/create-file.sh index aa3816abd..f951ff19b 100755 --- a/scripts/imports/create-file.sh +++ b/scripts/imports/create-file.sh @@ -24,6 +24,11 @@ print_usage() hash curl 2>/dev/null || { echo >&2 "curl not on \$PATH. Aborting."; exit 1; } +urlencode() { + python -c 'import urllib, sys; print urllib.quote(sys.argv[1], sys.argv[2])' \ + "$1" "$urlencode_safe" +} + args=() while [[ $# -gt 0 ]] do