[pacman-dev] [PATCH 2/2] libmakepkg: Use the correct path in extract_sources

Vladimir Panteleev archlinux at thecybershadow.net
Sat Apr 28 09:31:08 UTC 2018

When extracting sources, we need to get the full path to the file
being extracted (so that we can operate on it), instead of just the
filename component.

Previously, the filename coincidentally resolved to the same file as
the one we should be working on (due to the working directory being
appropriately set), but this assumption no longer holds now that a
source may reside in a different directory.

Fix this fragile assumption by correctly using the full path instead.
 scripts/libmakepkg/source.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/libmakepkg/source.sh.in b/scripts/libmakepkg/source.sh.in
index 02bb16f5..0bdd9602 100644
--- a/scripts/libmakepkg/source.sh.in
+++ b/scripts/libmakepkg/source.sh.in
@@ -90,7 +90,7 @@ extract_sources() {
 	get_all_sources_for_arch 'all_sources'
 	for netfile in "${all_sources[@]}"; do
-		local file=$(get_filename "$netfile")
+		local file=$(get_filepath "$netfile")
 		local proto=$(get_protocol "$netfile")
 		case "$proto" in

More information about the pacman-dev mailing list