summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2019-11-26 01:07:56 +0100
committerAndrew Gregory <andrew@archlinux.org>2020-01-14 10:26:52 +0100
commit6f1a9e6ea85a49b8aeb3b7bd2454215e9c34f565 (patch)
tree30efe70380d35d63983efa04e38679aaabb43bb7
parent41c3b1d78c3807beb4246624b20a31e374fb5af1 (diff)
downloadpacman-6f1a9e6ea85a49b8aeb3b7bd2454215e9c34f565.tar.gz
pacman-6f1a9e6ea85a49b8aeb3b7bd2454215e9c34f565.tar.xz
makepkg: fix regression that broke extraction of file:// sources
In commit 9c817b654996249b8022e189ee7e2692f4668431 we made these sources extendable, and heuristically determined the correct extraction functions to use. But our fallback for protos that didn't have an exact extract_* function didn't take into account that 'extract_file' matches an actual proto... so we passed the netfile in while the function expected a file. Solution: the function should expect a netfile too, thereby allowing us to delay an attempted resolution of netfile -> file, to the one case where it is actually used. This makes us slightly more efficient in the non-file case, makes our functions a bit more consistent, and makes file:// extraction work again. Fixes FS#64648 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> (cherry picked from commit 349c22d043290ccd0cce9f30981f5415e295442a)
-rw-r--r--scripts/libmakepkg/source.sh.in3
-rw-r--r--scripts/libmakepkg/source/file.sh.in3
2 files changed, 3 insertions, 3 deletions
diff --git a/scripts/libmakepkg/source.sh.in b/scripts/libmakepkg/source.sh.in
index 16db14af..4eaf6269 100644
--- a/scripts/libmakepkg/source.sh.in
+++ b/scripts/libmakepkg/source.sh.in
@@ -75,12 +75,11 @@ extract_sources() {
get_all_sources_for_arch 'all_sources'
for netfile in "${all_sources[@]}"; do
- local file=$(get_filename "$netfile")
local proto=$(get_protocol "$netfile")
if declare -f extract_$proto > /dev/null; then
extract_$proto "$netfile"
else
- extract_file "$file"
+ extract_file "$netfile"
fi
done
}
diff --git a/scripts/libmakepkg/source/file.sh.in b/scripts/libmakepkg/source/file.sh.in
index 7297a1c6..df4256f7 100644
--- a/scripts/libmakepkg/source/file.sh.in
+++ b/scripts/libmakepkg/source/file.sh.in
@@ -83,8 +83,9 @@ download_file() {
}
extract_file() {
- local file=$1
+ local netfile=$1
+ local file=$(get_filename "$netfile")
local filepath=$(get_filepath "$file")
rm -f "$srcdir/${file}"
ln -s "$filepath" "$srcdir/"