diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2018-05-29 05:14:03 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-01-22 00:38:21 +0100 |
commit | ac0e21a6df65c3770920be39b3fe14d8b49f637b (patch) | |
tree | 11ae21146559e9bebe0222b3ea102f58450458d3 /scripts/libmakepkg/source.sh.in | |
parent | 1b9e358f1d7ff806c62a7170f57342dd0e2338bf (diff) | |
download | pacman-ac0e21a6df65c3770920be39b3fe14d8b49f637b.tar.gz pacman-ac0e21a6df65c3770920be39b3fe14d8b49f637b.tar.xz |
libmakepkg: optimize get_protocol to always return proto, not proto+uri
e.g. git+https:// is commonly used for git repositories cloned over
HTTPS, but we assume a proto with a plus in it is actually a protocol
followed by some URI handler. So we might as well simplify the return
value and not have to always add glob matching everywhere when checking
the proto in use.
This is required in order to use the proto directly in function calls,
which will be used in a followup patch.
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/libmakepkg/source.sh.in')
-rw-r--r-- | scripts/libmakepkg/source.sh.in | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/libmakepkg/source.sh.in b/scripts/libmakepkg/source.sh.in index 5d7df732..198efd5e 100644 --- a/scripts/libmakepkg/source.sh.in +++ b/scripts/libmakepkg/source.sh.in @@ -63,16 +63,16 @@ download_sources() { local) download_local "$netfile" ;; - bzr*) + bzr) (( get_vcs )) && download_bzr "$netfile" ;; - git*) + git) (( get_vcs )) && download_git "$netfile" ;; - hg*) + hg) (( get_vcs )) && download_hg "$netfile" ;; - svn*) + svn) (( get_vcs )) && download_svn "$netfile" ;; *) @@ -93,16 +93,16 @@ extract_sources() { local file=$(get_filename "$netfile") local proto=$(get_protocol "$netfile") case "$proto" in - bzr*) + bzr) extract_bzr "$netfile" ;; - git*) + git) extract_git "$netfile" ;; - hg*) + hg) extract_hg "$netfile" ;; - svn*) + svn) extract_svn "$netfile" ;; *) |