diff lisp/package-admin.el @ 1410:44de306310b8

[xemacs-hg @ 2003-04-14 03:40:26 by youngs] 2003-04-14 Steve Youngs <youngs@xemacs.org> * package-admin.el (package-admin-find-top-directory): Use 'directory-sep-char'. (package-admin-get-install-dir): Ditto. This is so PUI won't break on platforms that don't use '/' as the directory separator. * package-get.el (package-get-pgp-available-p): New. (package-get-require-signed-base-updates): Use it. (package-get-update-base-from-buffer): Move the code that finds the gpg stuff into `package-get-pgp-available-p'. Now if you have Mailcrypt and a PGP binary installed and set up on your system, PUI will automatically default to doing PGP verification, otherwise it'll default to off. (package-get-require-base): Use the DATUM arg to `error'. (package-get-locate-index-file): Ditto. (package-get-update-base): Ditto. (package-get-update-base-entries): Ditto. (package-get-all): Ditto. (package-get-dependencies): Ditto. (package-get-info): Ditto. (package-get): Ditto. * package-info.el (batch-update-package-info): Use the DATUM arg to `error'. * package-net.el (package-net-batch-generate-bin-ini): Use the DATUM arg to `error'. * package-ui.el (pui-toggle-package-key): Use the DATUM arg to `error'. (pui-toggle-package-delete-key): Ditto. (pui-install-selected-packages): Ditto. (pui-add-required-packages): Ditto. (pui-display-info): Ditto. (list-packages-mode): Ditto. * packages.el (package-require): Use the DATUM arg to `error'.
author youngs
date Mon, 14 Apr 2003 03:40:27 +0000
parents 69a674f5861f
children a939d086aa0f
line wrap: on
line diff
--- a/lisp/package-admin.el	Sun Apr 13 21:52:52 2003 +0000
+++ b/lisp/package-admin.el	Mon Apr 14 03:40:27 2003 +0000
@@ -1,6 +1,7 @@
 ;;; package-admin.el --- Installation and Maintenance of XEmacs packages
 
 ;; Copyright (C) 1997 by Free Software Foundation, Inc.
+;; Copyright (C) 2003, Steve Youngs.
 
 ;; Author: SL Baur <steve@xemacs.org>
 ;; Keywords: internal
@@ -172,12 +173,14 @@
 	(let ((path-list (paths-decode-directory-path env-value 'drop-empties)))
 	  (cond ((eq type 'std)
 		 (while path-list
-		   (if (equal (substring (car path-list) -16) "xemacs-packages/")
+		   (if (equal (substring (car path-list) -16) 
+			      (concat "xemacs-packages" directory-sep-char))
 		       (setq top-dir (car path-list)))
 		   (setq path-list (cdr path-list))))
 		((eq type 'mule)
 		 (while path-list
-		   (if (equal (substring (car path-list) -14) "mule-packages/")
+		   (if (equal (substring (car path-list) -14) 
+			      (concat "mule-packages" directory-sep-char))
 		       (setq top-dir (car path-list)))
 		   (setq path-list (cdr path-list)))))))
     ;; Wasn't in the environment, try `user-init-directory' if
@@ -197,12 +200,14 @@
 				 (packages-compute-package-locations user-init-directory)))))
 	  (cond ((eq type 'std)
 		 (while path-list
-		   (if (equal (substring (car path-list) -16) "xemacs-packages/")
+		   (if (equal (substring (car path-list) -16) 
+			      (concat "xemacs-packages" directory-sep-char))
 		       (setq top-dir (car path-list)))
 		   (setq path-list (cdr path-list))))
 		((eq type 'mule)
 		 (while path-list
-		   (if (equal (substring (car path-list) -14) "mule-packages/")
+		   (if (equal (substring (car path-list) -14) 
+			      (concat "mule-packages" directory-sep-char))
 		       (setq top-dir (car path-list)))
 		   (setq path-list (cdr path-list)))))))
     ;; Now return either the directory or nil.
@@ -259,7 +264,8 @@
 		  ((equal type "mule")
 		   (setq pkg-dir (package-admin-find-top-directory 'mule)))
 		  (t
-		   (error "Invalid package type")))
+		   (error 'invalid-operation
+			  "Invalid package type")))
 	    (if (and pkg-dir
 		     (file-writable-p (directory-file-name pkg-dir)))
 		pkg-dir
@@ -274,7 +280,8 @@
 			  ((equal type "mule")
 			   (setq pkg-dir (package-admin-find-top-directory 'mule 'user-dir)))
 			  (t
-			   (error "Invalid package type")))
+			   (error 'invalid-operation
+				  "Invalid package type")))
 		    ;; Turn on `package-get-install-to-user-init-directory'
 		    ;; so we don't get asked for each package we try to
 		    ;; install in this session.
@@ -282,7 +289,10 @@
 		    pkg-dir)
 		;; If we get to here XEmacs can't make up its mind and
 		;; neither can the user, nothing left to do except barf. :-(
-		(error "Can't find suitable installation directory for package: %s" package)))))))))
+		(error 'search-failed
+		       (format
+			"Can't find suitable installation directory for package: %s" 
+			package))))))))))
 
 (defun package-admin-get-manifest-file (pkg-topdir package)
   "Return the name of the MANIFEST file for package PACKAGE.