# extract the filename from a source entry
get_filename() {
+ local netfile=$1
+
# if a filename is specified, use it
- local filename="${1%%::*}"
- # if it is just an URL, we only keep the last component
- printf "%s
" "${filename##*/}"
+ if [[ $netfile = *::* ]]; then
+ printf "%s
" ${netfile%%::*}
+ return
+ fi
+
+ local proto=$(get_protocol "$netfile")
+
+ case $proto in
+ git*)
+ filename=${netfile##*/}
+ filename=${filename%%#*}
+ filename=${filename%%.git*}
+ ;;
+ *)
+ # if it is just an URL, we only keep the last component
+ filename="${netfile##*/}"
+ ;;
+ esac
+ printf "%s
" "${filename}"
}
# extract the URL from a source entry
@@ -349,15 +367,12 @@ download_git() {
unset fragment
fi
- local folder=${netfile%%::*}
+ local folder=$(get_filename "$netfile")
+
local repo=${netfile##*/}
repo=${repo%%#*}
repo=${repo%%.git*}
- if [[ $folder = "$netfile" ]]; then
- folder="${repo}"
- fi
-
if [[ ! -d "$startdir"/$folder && -d "$SRCDEST"/$folder ]]; then
folder="$SRCDEST"/$folder
else
--
1.7.11.1