summaryrefslogtreecommitdiff
path: root/scripts/libmakepkg/util/source.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/libmakepkg/util/source.sh.in')
-rw-r--r--scripts/libmakepkg/util/source.sh.in27
1 files changed, 27 insertions, 0 deletions
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