diff lisp/package-get.el @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents 90d73dddcdc4
children 57709be46d1b
line wrap: on
line diff
--- a/lisp/package-get.el	Mon Aug 13 10:33:19 2007 +0200
+++ b/lisp/package-get.el	Mon Aug 13 10:34:13 2007 +0200
@@ -256,16 +256,15 @@
 	  ))
       (if (not (file-exists-p (package-get-staging-dir filename)))
 	  (error "Unable to find file %s" filename))
-      ;;
       ;; Validate the md5 checksum
-      ;; Unfortunately we cannot do this in XEmacs due to Mule lossage.
-      ;;
+      ;; Doing it with XEmacs removes the need for an external md5 program
       (with-temp-buffer
-	(call-process "md5sum" (package-get-staging-dir filename) t)
-	(goto-char (point-min))
-	(looking-at "[a-z0-9]+")
-	(if (not (string= (buffer-substring (match-beginning 0) (match-end 0))
-			  (package-get-info-prop this-package 'md5sum)))
+	; What ever happened to i-f-c-literally
+	(let (file-name-handler-alist)
+	  (insert-file-contents-internal (package-get-staging-dir filename)))
+	(if (not (string= (md5 (current-buffer))
+			  (package-get-info-prop this-package
+						 'md5sum)))
 	    (error "Package %s does not match md5 checksum" filename)))
       (message "Retrieved package %s" filename) (sit-for 0)
       (let ((status