[pacman-dev] [PATCH] makepkg: allow fragment to contain a "#" character
The frament element of a vcs url may contain the "#" charcter in the (e.g) branch or tag name. Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 7e5aa95..aed6b8b 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -380,7 +380,7 @@ download_file() { download_git() { local netfile=$1 - local fragment=${netfile##*#} + local fragment=${netfile#*#} if [[ $fragment = "$netfile" ]]; then unset fragment fi @@ -460,7 +460,7 @@ download_git() { download_hg() { local netfile=$1 - local fragment=${netfile##*#} + local fragment=${netfile#*#} if [[ $fragment = "$netfile" ]]; then unset fragment fi @@ -520,7 +520,7 @@ download_hg() { download_svn() { local netfile=$1 - local fragment=${netfile##*#} + local fragment=${netfile#*#} if [[ $fragment = "$netfile" ]]; then unset fragment fi -- 1.7.12
The list of which download protocol should look in makepkg.conf for the download agent was hard coded into makepkg. Instead, fallback to checking the the download agents array for any non-local or (implemented) vcs source. Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index cad1f5e..7e5aa95 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -284,7 +284,7 @@ get_downloadclient() { # if we didn't find an agent, return an error if [[ -z $agent ]]; then - error "$(gettext "There is no agent set up to handle %s URLs. Check %s.")" "$proto" "$MAKEPKG_CONF" + error "$(gettext "Unknown download protocol: %s")" "$proto" plain "$(gettext "Aborting...")" exit 1 # $E_CONFIG_ERROR fi @@ -596,9 +596,6 @@ download_sources() { local) download_local "$netfile" ;; - ftp|http|https|rsync|scp) - download_file "$netfile" - ;; git*) (( GET_VCS )) && download_git "$netfile" ;; @@ -609,9 +606,7 @@ download_sources() { (( GET_VCS )) && download_svn "$netfile" ;; *) - error "$(gettext "Unknown download protocol: %s")" "$proto" - plain "$(gettext "Aborting...")" - exit 1 + download_file "$netfile" ;; esac done -- 1.7.12
participants (1)
-
Allan McRae