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_filename to handle VCS sources

Modify get_filename to return the name of the folder with VCS sources.
This fixes output issues in checksum checking.

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

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index f8d46f1..6884272 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -210,10 +210,28 @@ get_filepath() {

# extract the filename from a source entry
get_filename() {
+ local netfile=$1
+
# if a filename is specified, use it
- local filename="${1%%::*}"
- # if it is just an URL, we only keep the last component
- printf "%s
" "${filename##*/}"
+ if [[ $netfile = *::* ]]; then
+ printf "%s
" ${netfile%%::*}
+ return
+ fi
+
+ local proto=$(get_protocol "$netfile")
+
+ case $proto in
+ git*)
+ filename=${netfile##*/}
+ filename=${filename%%#*}
+ filename=${filename%%.git*}
+ ;;
+ *)
+ # if it is just an URL, we only keep the last component
+ filename="${netfile##*/}"
+ ;;
+ esac
+ printf "%s
" "${filename}"
}

# extract the URL from a source entry
@@ -349,15 +367,12 @@ download_git() {
unset fragment
fi

- local folder=${netfile%%::*}
+ local folder=$(get_filename "$netfile")
+
local repo=${netfile##*/}
repo=${repo%%#*}
repo=${repo%%.git*}

- if [[ $folder = "$netfile" ]]; then
- folder="${repo}"
- fi
-
if [[ ! -d "$startdir"/$folder && -d "$SRCDEST"/$folder ]]; then
folder="$SRCDEST"/$folder
else
--
1.7.11.1
 

Thread Tools




All times are GMT. The time now is 10:05 PM.

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