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

Message ID 20180428093108.8263-3-archlinux@thecybershadow.net
State Changes Requested
Headers show
Series makepkg: Allow placing local sources in subdirectories | expand

Commit Message

Vladimir Panteleev April 28, 2018, 9:31 a.m. UTC
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(-)

Patch

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
 			bzr*)