mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
makepkg: modify get_filename to handle VCS sources
Modify get_filename to return the name of the folder with VCS sources. This fixes output issues in checksum checking. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
682c9af846
commit
aa6fe1160b
@ -212,10 +212,28 @@ get_filepath() {
|
|||||||
|
|
||||||
# extract the filename from a source entry
|
# extract the filename from a source entry
|
||||||
get_filename() {
|
get_filename() {
|
||||||
|
local netfile=$1
|
||||||
|
|
||||||
# if a filename is specified, use it
|
# if a filename is specified, use it
|
||||||
local filename="${1%%::*}"
|
if [[ $netfile = *::* ]]; then
|
||||||
# if it is just an URL, we only keep the last component
|
printf "%s\n" ${netfile%%::*}
|
||||||
printf "%s\n" "${filename##*/}"
|
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\n" "${filename}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# extract the URL from a source entry
|
# extract the URL from a source entry
|
||||||
@ -351,15 +369,12 @@ download_git() {
|
|||||||
unset fragment
|
unset fragment
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local dir=${netfile%%::*}
|
local dir=$(get_filename "$netfile")
|
||||||
|
|
||||||
local repo=${netfile##*/}
|
local repo=${netfile##*/}
|
||||||
repo=${repo%%#*}
|
repo=${repo%%#*}
|
||||||
repo=${repo%%.git*}
|
repo=${repo%%.git*}
|
||||||
|
|
||||||
if [[ $dir = "$netfile" ]]; then
|
|
||||||
dir="${repo}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d "$startdir"/$dir ]]; then
|
if [[ ! -d "$startdir"/$dir ]]; then
|
||||||
dir="$SRCDEST"/$dir
|
dir="$SRCDEST"/$dir
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user