[Lunar-commits] <lunar> Bugfix: the '/' at the end of a URL may be missing like in the case of mirrors. You should account for BOTH situations. This forces proper termination of any URL.

Auke Kok sofar at lunar-linux.org
Mon Jul 2 04:43:06 CEST 2012


commit 09434bad6eaa900725177669e3f494dff091000e
Author: Auke Kok <sofar at lunar-linux.org>
Date:   Wed Jul 27 07:24:37 2005 +0000

    Bugfix: the '/' at the end of a URL may be missing like in the case of mirrors. You should account for BOTH situations. This forces proper termination of any URL.
---
 var/lib/lunar/functions/download.lunar |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/var/lib/lunar/functions/download.lunar b/var/lib/lunar/functions/download.lunar
index d174836..6e9cd6d 100644
--- a/var/lib/lunar/functions/download.lunar
+++ b/var/lib/lunar/functions/download.lunar
@@ -35,9 +35,7 @@ lget_unlock() {
 
 download_url() {
     local RETVAL
-    local CLEAN_URL
 	debug_msg "download_url($@)"
-	CLEAN_URL=`echo $1 | sed "s:\([^:]/\)/*:\1:g"`
 	verbose_msg "trying to download \"$CLEAN_URL\""
 	connect &&
 	plugin_call SOURCE_DOWNLOAD $CLEAN_URL $2 $3
@@ -85,7 +83,8 @@ download_module() {
 		add_url() {
 			if [ -n "$1" ]; then
 				if ! echo " $ALL_URLS " | grep -q " $1 "; then
-					ALL_URLS="$ALL_URLS $1"
+					# make sure the URL has ONE "/" at the end
+					ALL_URLS="$ALL_URLS $(echo "$1/" | sed "s:\([^:]/\)/*:\1:g")"
 				fi
 			fi
 		}


More information about the Lunar-commits mailing list