diff --git a/scripts/libmakepkg/util/source.sh.in b/scripts/libmakepkg/util/source.sh.in index 17e44664..5092347d 100644 --- a/scripts/libmakepkg/util/source.sh.in +++ b/scripts/libmakepkg/util/source.sh.in @@ -85,8 +85,9 @@ get_filename() { # Return the absolute filename of a source entry get_filepath() { - local file="$(get_filename "$1")" - local proto="$(get_protocol "$1")" + local netfile="$1" + local file="$(get_filename "$netfile")" + local proto="$(get_protocol "$netfile")" case $proto in bzr*|git*|hg*|svn*) @@ -98,6 +99,23 @@ get_filepath() { return 1 fi ;; + local) + if [[ "$netfile" == /* ]]; then + # absolute path + if [[ -f "$netfile" ]]; then + file="$netfile" + else + return 1 + fi + elif [[ -f "$startdir/$netfile" ]]; then + # relative path + file="$startdir/$netfile" + elif [[ -f "$SRCDEST/$netfile" ]]; then + file="$SRCDEST/$netfile" + else + return 1 + fi + ;; *) if [[ -f "$startdir/$file" ]]; then file="$startdir/$file"