libmakepkg: Always look in SRCDEST for sources, never startdir

Otherwise `verify()` would have to replicate the behavior of
`get_filepath` for each source it wants to check, and test both
`$startdir` and `$SRCDEST`.
This commit is contained in:
Jan Alexander Steffens (heftig) 2025-03-19 21:17:26 +01:00
parent 34f09204fa
commit 6b1fcc6030
No known key found for this signature in database
GPG key ID: B8AC08600F108CDF
2 changed files with 9 additions and 25 deletions

View file

@ -102,12 +102,12 @@ systems (see below).
*source (array)*::
An array of source files required to build the package. Source files
must either reside in the same directory as the PKGBUILD, or be a
fully-qualified URL that makepkg can use to download the file.
To simplify the maintenance of PKGBUILDs, use the `$pkgname` and `$pkgver`
variables when specifying the download location, if possible.
Compressed files will be extracted automatically unless found in the
noextract array described below.
must either reside in `$SRCDEST` (if set, otherwise the same directory
as the PKGBUILD) or be a fully-qualified URL that makepkg can use to
download the file. To simplify the maintenance of PKGBUILDs, use the
`$pkgname` and `$pkgver` variables when specifying the download
location, if possible. Compressed files will be extracted automatically
unless found in the noextract array described below.
+
Additional architecture-specific sources can be added by appending an
underscore and the architecture name e.g., 'source_x86_64=()'. There must be a

View file

@ -90,28 +90,12 @@ get_filename() {
# Return the absolute filename of a source entry
get_filepath() {
local file="$(get_filename "$1")"
local file="$SRCDEST/$(get_filename "$1")"
local proto="$(get_protocol "$1")"
case $proto in
bzr|git|hg|svn)
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
file="$startdir/$file"
elif [[ -f "$SRCDEST/$file" ]]; then
file="$SRCDEST/$file"
else
return 1
fi
;;
bzr|git|hg|svn) [[ -d $file ]] || return 1 ;;
*) [[ -f $file ]] || return 1 ;;
esac
printf "%s\n" "$file"