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: add function to return download protocol

Extract the download protocol from a source entry. Returns "local"
for local source files.

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

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 4299816..0d87cba 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -222,6 +222,17 @@ get_url() {
printf "%s
" "${1#*::}"
}

+# extract the protocol from a source entry - return "local" for local sources
+get_protocol() {
+ if [[ $1 = *://* ]]; then
+ # strip leading filename
+ local proto="${1##*::}"
+ printf "%s
" "${proto%%://*}"
+ else
+ printf "%s
" local
+ fi
+}
+
get_downloadclient() {
# $1 = URL with valid protocol prefix
local url=$1
--
1.7.11.1
 

Thread Tools




All times are GMT. The time now is 10:46 AM.

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