[pacman-dev] [PATCH] makepkg: Improvements to get_filename:

Gary van der Merwe garyvdm at gmail.com
Thu Aug 16 05:30:34 EDT 2012


* For any vcs other that git, the fall through resulted in being handled by the
  code for std url, hence fragments were being left on.
* Handle vcs urls than end in a slash correctly, eg http://example.com/project/

Signed-off-by: Gary van der Merwe <garyvdm at gmail.com>
---
 scripts/makepkg.sh.in | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index dd4066b..31dbef6 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -237,12 +237,12 @@ get_filename() {
 
 	case $proto in
 		git*|hg*|svn*)
-			filename=${netfile##*/}
-			filename=${filename%%#*}
-			# fall-through
-			;;&
-		git*)
-			filename=${filename%%.git*}
+			filename=${netfile%%#*}
+			filename=${filename%/}
+			filename=${filename##*/}
+			if [[ $proto = git* ]]; then
+				filename=${filename%%.git*}
+			fi
 			;;
 		*)
 			# if it is just an URL, we only keep the last component
-- 
1.7.11.5



More information about the pacman-dev mailing list