makepkg: Allow using sources with :: in them

Git has the ability to use helper applications for interfacing with hg,
and from what we had before, the following url::

  foo::git+hg::http://foo.bar/foobar

would get converted to something along the lines of:

  filename: foo
  URL: http://foo.bar/foobar

and the 'git+hg' part would essentially be ignored when it's getting set
up in the 'get_protocol' and 'get_downloadclient' functions. With this
patch it is possible to have a source link with '::' in it, however it
is not possible to have a filename with '::', which is the current
behavior.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
William Giokas 2014-04-28 14:16:04 -05:00 committed by Allan McRae
parent 38b6de937c
commit 95e1a1ef82

View file

@ -275,10 +275,10 @@ get_url() {
get_protocol() { get_protocol() {
if [[ $1 = *://* ]]; then if [[ $1 = *://* ]]; then
# strip leading filename # strip leading filename
local proto="${1##*::}" local proto="${1#*::}"
printf "%s\n" "${proto%%://*}" printf "%s\n" "${proto%%://*}"
elif [[ $1 = *lp:* ]]; then elif [[ $1 = *lp:* ]]; then
local proto="${1##*::}" local proto="${1#*::}"
printf "%s\n" "${proto%%lp:*}" printf "%s\n" "${proto%%lp:*}"
else else
printf "%s\n" local printf "%s\n" local
@ -293,7 +293,7 @@ get_downloadclient() {
for i in "${DLAGENTS[@]}"; do for i in "${DLAGENTS[@]}"; do
local handler="${i%%::*}" local handler="${i%%::*}"
if [[ $proto = "$handler" ]]; then if [[ $proto = "$handler" ]]; then
local agent="${i##*::}" local agent="${i#*::}"
break break
fi fi
done done