[Lunar-commits] r15279 - lunar/branches/stable/var/lib/lunar/functions

Auke Kok sofar at lunar-linux.org
Tue Jun 7 14:26:16 UTC 2005


Author: sofar
Date: 2005-06-07 14:26:15 +0000 (Tue, 07 Jun 2005)
New Revision: 15279

Modified:
   lunar/branches/stable/var/lib/lunar/functions/download.lunar
Log:
bugfix hack: testpack is *THE* ideal location to use name-based checking of tarballs etc. This will catch virtually all 404 error pages and continue downloading from other URLs. afterwards sha1sum's are still checked but only prior to installation.


Modified: lunar/branches/stable/var/lib/lunar/functions/download.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/download.lunar	2005-06-07 10:42:02 UTC (rev 15278)
+++ lunar/branches/stable/var/lib/lunar/functions/download.lunar	2005-06-07 14:26:15 UTC (rev 15279)
@@ -147,26 +147,33 @@
 		FILENAME=$SOURCE_CACHE/$1
 	fi
 	if [ -f "$FILENAME" ] ; then
-		case $(file -b $FILENAME | cut -d ' ' -f1) in
-			bzip2)
+		case $FILENAME in
+			*.tar.bz2|*.tbz2|*.tbz|*.tgz|*.tar.gz)
+				tar tf $FILENAME > /dev/null 2>&1
+				;;
+			*.bz2)
 				bzip2 -tf $FILENAME > /dev/null 2>&1
 				;;
-			gzip)
+			*.gz)
 				gzip -tf $FILENAME > /dev/null 2>&1
 				;;
-			compress*)
+			*.Z|*.z)
 				gzip -tf $FILENAME > /dev/null 2>&1
 				;;
-			Zip)
+			*.zip)
 				unzip -tq $FILENAME > /dev/null 2>&1
 				;;
-			RPM)
+			*.rpm)
 				rpmunpack < $FILENAME | gzip -t > /dev/null 2>&1
 				;;
 			*)
+				# we don't know how to handle this type of file
 				true
 				;;
 	  	esac
+	else
+		# filename does not exist!
+		false
 	fi
 }
 



More information about the Lunar-commits mailing list