comparison lisp/packages.el @ 239:41f2f0e326e9 r20-5b18

Import from CVS: tag r20-5b18
author cvs
date Mon, 13 Aug 2007 10:15:48 +0200
parents 89ec2bb86eea
children f220cc83d72e
comparison
equal deleted inserted replaced
238:b5f2e56b938d 239:41f2f0e326e9
81 (defun package-require (name version) 81 (defun package-require (name version)
82 (let ((pkg (assq name packages-package-list))) 82 (let ((pkg (assq name packages-package-list)))
83 (cond ((null pkg) 83 (cond ((null pkg)
84 (error "Package %s has not been loaded into this XEmacsen" 84 (error "Package %s has not been loaded into this XEmacsen"
85 name)) 85 name))
86 ((< (cdr pkg) version) 86 ((< (package-get-key name :version) version)
87 (error "Need version %g of package %s, got version %g" 87 (error "Need version %g of package %s, got version %g"
88 version name (cdr pkg))) 88 version name (cdr pkg)))
89 (t t)))) 89 (t t))))
90 90
91 ;;; Build time stuff 91 ;;; Build time stuff
410 ;; Data-directory is really a list now. Provide something to search it for 410 ;; Data-directory is really a list now. Provide something to search it for
411 ;; files. 411 ;; files.
412 412
413 (defun locate-data-file (name &optional dir-list) 413 (defun locate-data-file (name &optional dir-list)
414 "Locate a file in a search path DIR-LIST (a list of directories). 414 "Locate a file in a search path DIR-LIST (a list of directories).
415 If no DIR-LIST is supplied, it defaults to `data-directory-list'." 415 If no DIR-LIST is supplied, it defaults to `data-directory-list'.
416 This function is basically a wrapper over `locate-file'."
416 (unless dir-list 417 (unless dir-list
417 (setq dir-list data-directory-list)) 418 (setq dir-list data-directory-list))
418 (let (found found-file) 419 (locate-file name dir-list))
419 (while (and (null found-file) dir-list)
420 (setq found (concat (car dir-list) name)
421 found-file (and (file-exists-p found)
422 (not (file-directory-p found))))
423 (or found-file
424 (setq found nil))
425 (setq dir-list (cdr dir-list)))
426 found))
427 420
428 ;; If we are being loaded as part of being dumped, bootstrap the rest of the 421 ;; If we are being loaded as part of being dumped, bootstrap the rest of the
429 ;; load-path for loaddefs. 422 ;; load-path for loaddefs.
430 (if (fboundp 'load-gc) 423 (if (fboundp 'load-gc)
431 (packages-find-packages package-path t t)) 424 (packages-find-packages package-path t t))