index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz93@gmail.com> | 2017-01-03 15:10:18 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2017-01-04 13:59:15 +1000 |
commit | eaa82b4d0775252856a4e54a6f2a9ea191cf0b8f (patch) | |
tree | 9d974f15a153a11c619ba44e42957aeb70ea7858 /scripts/libmakepkg/util/source.sh.in | |
parent | 42e7020281d3ae260e1e9693495f527b7f476625 (diff) |
-rw-r--r-- | scripts/libmakepkg/util/source.sh.in | 27 |
diff --git a/scripts/libmakepkg/util/source.sh.in b/scripts/libmakepkg/util/source.sh.in index 1e781118..238d1f58 100644 --- a/scripts/libmakepkg/util/source.sh.in +++ b/scripts/libmakepkg/util/source.sh.in @@ -65,6 +65,7 @@ get_filename() { case $proto in bzr*|git*|hg*|svn*) filename=${netfile%%#*} + filename=${filename%%\?*} filename=${filename%/} filename=${filename##*/} if [[ $proto = bzr* ]]; then @@ -111,6 +112,32 @@ get_filepath() { printf "%s\n" "$file" } +# extract the VCS revision/branch specifier from a source entry +get_uri_fragment() { + local netfile=$1 + + local fragment=${netfile#*#} + if [[ $fragment = "$netfile" ]]; then + unset fragment + fi + fragment=${fragment%\?*} + + printf "%s\n" "$fragment" +} + +# extract the VCS "signed" status from a source entry +get_uri_query() { + local netfile=$1 + + local query=${netfile#*\?} + if [[ $query = "$netfile" ]]; then + unset query + fi + query=${query%#*} + + printf "%s\n" "$query" +} + get_downloadclient() { local proto=$1 |