diff lisp/package-get.el @ 327:03446687b7cc r21-0-61

Import from CVS: tag r21-0-61
author cvs
date Mon, 13 Aug 2007 10:48:16 +0200
parents f2b5d7006b0a
children 58bac07dfa74
line wrap: on
line diff
--- a/lisp/package-get.el	Mon Aug 13 10:47:36 2007 +0200
+++ b/lisp/package-get.el	Mon Aug 13 10:48:16 2007 +0200
@@ -254,13 +254,17 @@
 (defvar package-get-was-current nil
   "Non-nil we did our best to fetch a current database.")
 
+
+;Shouldn't this be in package-ui?
 ;;;###autoload
 (defun package-get-download-menu ()
   "Build the `Add Download Site' menu."
   (mapcar (lambda (site)
             (vector (car site)
-                    `(push (quote ,(cdr site))
-                           package-get-remote)))
+                    `(lambda ()
+		       (interactive) (package-ui-add-site (quote ,(cdr site))))
+		    :style 'toggle :selected
+		    `(member (quote ,(cdr site)) package-get-remote)))
           package-get-download-sites))
 
 ;;;###autoload
@@ -705,8 +709,10 @@
 	 (package-status t)
 	 filenames full-package-filename)
     (if (null this-package)
-	(error "Couldn't find package %s with version %s"
-	       package version))
+	(if package-get-remote
+	    (error "Couldn't find package %s with version %s"
+		   package version)
+	  (error "No download sites or local package locations specified.")))
     (if (null base-filename)
 	(error "No filename associated with package %s, version %s"
 	       package version))
@@ -807,7 +813,10 @@
 
       (if (or (not full-package-filename)
 	      (not (file-exists-p full-package-filename)))
-	  (error "Unable to find file %s" base-filename))
+	  (if package-get-remote
+	      (error "Unable to find file %s" base-filename)
+	    (error
+	     "No download sites or local package locations specified.")))
       ;; Validate the md5 checksum
       ;; Doing it with XEmacs removes the need for an external md5 program
       (message "Validating checksum for `%s'..." package) (sit-for 0)
@@ -940,7 +949,9 @@
   (if (efs-ftp-path filename)
       filename
     (let ((dir (cadr search)))
-      (concat "/"
+      (concat (if (string-match "@" (car search))
+		  "/"
+		"/anonymous@")
 	      (car search) ":"
 	      (if (string-match "/$" dir)
 		  dir