Subject: [alpine-devel] [PATCH] abuild: another trivial update to the saveas-* support

From: Matt Smith <[email-masked]>
Date: Fri, 7 Jan 2011 18:13:45 -0600

I opted for ncopa's method to fix saveas-* URIs, obtained from his sourcecheck()
function, also in abuild.
---
 abuild.in |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/abuild.in b/abuild.in
index 904b1c3..528fba5 100755
--- a/abuild.in
+++ b/abuild.in
@@ -195,9 +195,10 @@ uri_fetch() {
 
 	# fix saveas-*://* URIs
 	case "$uri" in
-		# remove 'saveas-' from beginning and
-		# '/filename' from end of URI
-		saveas-*://*) uri="${uri:7:$(expr ${#uri} - 7 - ${#d} - 1)}";;
+		saveas-*://*)
+			uri=${uri#saveas-}   # remove 'saveas-' from beginning
+			uri=${uri%/*}        # remove '/<filename>' from end
+			;;
 	esac
 
 	# we need GNU wget for this
-- 
1.7.3.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---