FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-26-2012, 10:58 PM
Allan McRae
 
Default makepkg: modify get_filepath to handle VCS sources

With VCS sources, get_filepath should return the directory of the
checkout. This allows backing up of the VCS checkout when using
--allsource. Fixes FS#21098.

Signed-off-by: Allan McRae <allan@archlinux.org>
---
scripts/makepkg.sh.in | 40 +++++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 6884272..0b282a5 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -191,19 +191,30 @@ enter_fakeroot() {
# 2) "http://path/to/file"

# Return the absolute filename of a source entry
-#
-# This function accepts a source entry or the already extracted filename of a
-# source entry as input
get_filepath() {
local file="$(get_filename "$1")"
+ local proto="$(get_protocol "$1")"

- if [[ -f "$startdir/$file" ]]; then
- file="$startdir/$file"
- elif [[ -f "$SRCDEST/$file" ]]; then
- file="$SRCDEST/$file"
- else
- return 1
- fi
+ case $proto in
+ git*)
+ 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
+ ;;
+ esac

printf "%s
" "$file"
}
@@ -367,18 +378,13 @@ download_git() {
unset fragment
fi

- local folder=$(get_filename "$netfile")
+ local folder=$(get_filepath "$netfile")
+ [[ -z "$folder" ]] && folder="$SRCDEST/$(get_filename "$netfile")"

local repo=${netfile##*/}
repo=${repo%%#*}
repo=${repo%%.git*}

- if [[ ! -d "$startdir"/$folder && -d "$SRCDEST"/$folder ]]; then
- folder="$SRCDEST"/$folder
- else
- folder="$startdir"/$folder
- fi
-
local url=$(get_url "$netfile")
url=${url##*git+}
url=${url%%#*}
--
1.7.11.1
 

Thread Tools




All times are GMT. The time now is 09:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org