mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-03 02:41:53 -05:00
makepkg: modify get_filepath to handle VCS sources
With VCS sources, get_filepath should return the directory of the checkout. This allows backing up of the VCS checkout when using --allsource. Fixes FS#21098. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
aa6fe1160b
commit
cca9849fc2
@ -193,12 +193,21 @@ enter_fakeroot() {
|
|||||||
# 2) "http://path/to/file"
|
# 2) "http://path/to/file"
|
||||||
|
|
||||||
# Return the absolute filename of a source entry
|
# Return the absolute filename of a source entry
|
||||||
#
|
|
||||||
# This function accepts a source entry or the already extracted filename of a
|
|
||||||
# source entry as input
|
|
||||||
get_filepath() {
|
get_filepath() {
|
||||||
local file="$(get_filename "$1")"
|
local file="$(get_filename "$1")"
|
||||||
|
local proto="$(get_protocol "$1")"
|
||||||
|
|
||||||
|
case $proto in
|
||||||
|
git*)
|
||||||
|
if [[ -d "$startdir/$file" ]]; then
|
||||||
|
file="$startdir/$file"
|
||||||
|
elif [[ -d "$SRCDEST/$file" ]]; then
|
||||||
|
file="$SRCDEST/$file"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
if [[ -f "$startdir/$file" ]]; then
|
if [[ -f "$startdir/$file" ]]; then
|
||||||
file="$startdir/$file"
|
file="$startdir/$file"
|
||||||
elif [[ -f "$SRCDEST/$file" ]]; then
|
elif [[ -f "$SRCDEST/$file" ]]; then
|
||||||
@ -206,6 +215,8 @@ get_filepath() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
printf "%s\n" "$file"
|
printf "%s\n" "$file"
|
||||||
}
|
}
|
||||||
@ -369,18 +380,13 @@ download_git() {
|
|||||||
unset fragment
|
unset fragment
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local dir=$(get_filename "$netfile")
|
local dir=$(get_filepath "$netfile")
|
||||||
|
[[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")"
|
||||||
|
|
||||||
local repo=${netfile##*/}
|
local repo=${netfile##*/}
|
||||||
repo=${repo%%#*}
|
repo=${repo%%#*}
|
||||||
repo=${repo%%.git*}
|
repo=${repo%%.git*}
|
||||||
|
|
||||||
if [[ ! -d "$startdir"/$dir ]]; then
|
|
||||||
dir="$SRCDEST"/$dir
|
|
||||||
else
|
|
||||||
dir="$startdir"/$dir
|
|
||||||
fi
|
|
||||||
|
|
||||||
local url=$(get_url "$netfile")
|
local url=$(get_url "$netfile")
|
||||||
url=${url##*git+}
|
url=${url##*git+}
|
||||||
url=${url%%#*}
|
url=${url%%#*}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user