summaryrefslogtreecommitdiffstats
path: root/scripts/libmakepkg/source.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/libmakepkg/source.sh.in')
-rw-r--r--scripts/libmakepkg/source.sh.in47
1 files changed, 10 insertions, 37 deletions
diff --git a/scripts/libmakepkg/source.sh.in b/scripts/libmakepkg/source.sh.in
index 198efd5e..2cb7dae1 100644
--- a/scripts/libmakepkg/source.sh.in
+++ b/scripts/libmakepkg/source.sh.in
@@ -59,26 +59,11 @@ download_sources() {
pushd "$SRCDEST" &>/dev/null
local proto=$(get_protocol "$netfile")
- case "$proto" in
- local)
- download_local "$netfile"
- ;;
- bzr)
- (( get_vcs )) && download_bzr "$netfile"
- ;;
- git)
- (( get_vcs )) && download_git "$netfile"
- ;;
- hg)
- (( get_vcs )) && download_hg "$netfile"
- ;;
- svn)
- (( get_vcs )) && download_svn "$netfile"
- ;;
- *)
- download_file "$netfile"
- ;;
- esac
+ if declare -f download_$proto > /dev/null; then
+ download_$proto "$netfile"
+ else
+ download_file "$netfile"
+ fi
popd &>/dev/null
done
@@ -92,22 +77,10 @@ extract_sources() {
for netfile in "${all_sources[@]}"; do
local file=$(get_filename "$netfile")
local proto=$(get_protocol "$netfile")
- case "$proto" in
- bzr)
- extract_bzr "$netfile"
- ;;
- git)
- extract_git "$netfile"
- ;;
- hg)
- extract_hg "$netfile"
- ;;
- svn)
- extract_svn "$netfile"
- ;;
- *)
- extract_file "$file"
- ;;
- esac
+ if declare -f extract_$proto > /dev/null; then
+ extract_$proto "$netfile"
+ else
+ extract_file "$file"
+ fi
done
}