summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 4cafa945..fe0c0684 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -224,6 +224,17 @@ get_url() {
printf "%s\n" "${1#*::}"
}
+# extract the protocol from a source entry - return "local" for local sources
+get_protocol() {
+ if [[ $1 = *://* ]]; then
+ # strip leading filename
+ local proto="${1##*::}"
+ printf "%s\n" "${proto%%://*}"
+ else
+ printf "%s\n" local
+ fi
+}
+
get_downloadclient() {
# $1 = URL with valid protocol prefix
local url=$1