comparison lisp/package-admin.el @ 2456:f4e405a9d18d

[xemacs-hg @ 2004-12-27 12:25:14 by michaels] 2004-12-18 Mike Sperber <mike@xemacs.org> * package-admin.el: * startup.el: Reflect the changes made in packages.el. * packages.el: * loadup.el: * make-docfile.el: * package-admin.el: * startup.el: * update-elc.el (early-package-hierarchies) (late-package-hierarchies) (last-package-hierarchies): Renamed these from `early-packages', `late-packages' and `last-packages'. * packages.el: Rewrote package-finding logic to separate the concepts of "package directories" and "package hierarchies". Added explanation of these concepts. * setup-paths.el: * find-paths.el: Added parameter descriptions to some of the docstrings. * packages.el, setup-paths.el: Make terminology more explicit about "package hierarchies" * startup.el (emacs-roots, emacs-data-roots) (user-init-directory-base, user-init-directory) (user-init-file-base, user-init-file-base-list) (user-home-init-file-base-list) (load-home-init-file, load-user-init-file-p) (startup-find-load-path, startup-setup-paths) (startup-find-load-path-for-packages): Moved these back from setup-paths.el where they belong---setup-paths.el now again, as documented, contains no code that sets global variables. (They were moved from startup.el to setup-paths.el on 2003-02-28.) Clarify that in the comment at the top. * setup-paths.el (paths-find-emacs-roots): Restored `invocation-directory' 'invocation-name' parameters removed on 2003-02-28; they're useful for debugging.
author michaels
date Mon, 27 Dec 2004 12:27:05 +0000
parents 6f4c71266175
children 15139dbf89f4
comparison
equal deleted inserted replaced
2455:3e06061baa0e 2456:f4e405a9d18d
195 ((eq type 'mule) 195 ((eq type 'mule)
196 (setq top-dir (file-name-as-directory 196 (setq top-dir (file-name-as-directory
197 (expand-file-name "mule-packages" user-init-directory)))))) 197 (expand-file-name "mule-packages" user-init-directory))))))
198 ;; Finally check the normal places 198 ;; Finally check the normal places
199 (if (not top-dir) 199 (if (not top-dir)
200 (let ((path-list (nth 1 (packages-find-packages 200 (let ((path-list (nth 1 (packages-find-all-package-hierarchies
201 emacs-data-roots 201 emacs-data-roots))))
202 (packages-compute-package-locations user-init-directory)))))
203 (cond ((eq type 'std) 202 (cond ((eq type 'std)
204 (while path-list 203 (while path-list
205 (if (equal (substring (car path-list) -16) 204 (if (equal (substring (car path-list) -16)
206 (concat "xemacs-packages" (char-to-string directory-sep-char))) 205 (concat "xemacs-packages" (char-to-string directory-sep-char)))
207 (setq top-dir (car path-list))) 206 (setq top-dir (car path-list)))
224 223
225 If PKG-DIR is non-nil and writable, return that. Otherwise check to 224 If PKG-DIR is non-nil and writable, return that. Otherwise check to
226 see if the PACKAGE is already installed and return that location, if 225 see if the PACKAGE is already installed and return that location, if
227 it is writable. Finally, fall back to the `user-init-directory' if 226 it is writable. Finally, fall back to the `user-init-directory' if
228 all else fails. As a side effect of installing packages under 227 all else fails. As a side effect of installing packages under
229 `user-init-directory' these packages become part of `early-packages'." 228 `user-init-directory' these packages become part of `early-package-hierarchies'."
230 ;; If pkg-dir specified, return that if writable. 229 ;; If pkg-dir specified, return that if writable.
231 (if (and pkg-dir 230 (if (and pkg-dir
232 (file-writable-p (directory-file-name pkg-dir))) 231 (file-writable-p (directory-file-name pkg-dir)))
233 pkg-dir 232 pkg-dir
234 ;; If the user want her packages under ~/.xemacs/, do so. 233 ;; If the user want her packages under ~/.xemacs/, do so.
253 ;; Find the corresponding entry in late-package 252 ;; Find the corresponding entry in late-package
254 (setq pkg-dir 253 (setq pkg-dir
255 (car-safe (member-if (lambda (h) 254 (car-safe (member-if (lambda (h)
256 (string-match (concat "^" (regexp-quote h)) 255 (string-match (concat "^" (regexp-quote h))
257 autoload-dir)) 256 autoload-dir))
258 (append (cdr early-packages) late-packages))))) 257 (append (cdr early-package-hierarchies) late-package-hierarchies)))))
259 (if (and pkg-dir 258 (if (and pkg-dir
260 (file-writable-p (directory-file-name pkg-dir))) 259 (file-writable-p (directory-file-name pkg-dir)))
261 pkg-dir 260 pkg-dir
262 ;; OK, the package hasn't been previously installed so we need 261 ;; OK, the package hasn't been previously installed so we need
263 ;; to guess where it should go. 262 ;; to guess where it should go.