Mercurial > hg > xemacs-beta
comparison lisp/package-get.el @ 306:9ea74add5d37 r21-0b51
Import from CVS: tag r21-0b51
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:41:58 +0200 |
parents | 70ad99077275 |
children | 341dac730539 |
comparison
equal
deleted
inserted
replaced
305:18920a7e9a86 | 306:9ea74add5d37 |
---|---|
165 (defun package-get-update-all () | 165 (defun package-get-update-all () |
166 "Fetch and install the latest versions of all currently installed packages." | 166 "Fetch and install the latest versions of all currently installed packages." |
167 (interactive) | 167 (interactive) |
168 ;; Load a fresh copy | 168 ;; Load a fresh copy |
169 (mapcar (lambda (pkg) | 169 (mapcar (lambda (pkg) |
170 (package-get-all | 170 (package-get (car pkg) nil 'never)) |
171 (car pkg) nil)) | |
172 packages-package-list)) | 171 packages-package-list)) |
173 | 172 |
174 ;;;###autoload | 173 ;;;###autoload |
175 (defun package-get-all (package version &optional fetched-packages) | 174 (defun package-get-all (package version &optional fetched-packages) |
176 "Fetch PACKAGE with VERSION and all other required packages. | 175 "Fetch PACKAGE with VERSION and all other required packages. |
210 (setq this-requires (cdr this-requires))) | 209 (setq this-requires (cdr this-requires))) |
211 fetched-packages | 210 fetched-packages |
212 )) | 211 )) |
213 | 212 |
214 ;;;###autoload | 213 ;;;###autoload |
215 (defun package-get (package &optional version conflict) | 214 (defun package-get (package &optional version conflict install-dir) |
216 "Fetch PACKAGE from remote site. | 215 "Fetch PACKAGE from remote site. |
217 Optional arguments VERSION indicates which version to retrieve, nil | 216 Optional arguments VERSION indicates which version to retrieve, nil |
218 means most recent version. CONFLICT indicates what happens if the | 217 means most recent version. CONFLICT indicates what happens if the |
219 package is already installed. Valid values for CONFLICT are: | 218 package is already installed. Valid values for CONFLICT are: |
220 'always always retrieve the package even if it is already installed | 219 'always always retrieve the package even if it is already installed |
221 'never do not retrieve the package if it is installed. | 220 'never do not retrieve the package if it is installed. |
221 INSTALL-DIR, if non-nil, specifies the package directory where | |
222 fetched packages should be installed. | |
222 | 223 |
223 The value of `package-get-base' is used to determine what files should | 224 The value of `package-get-base' is used to determine what files should |
224 be retrieved. The value of `package-get-remote' is used to determine | 225 be retrieved. The value of `package-get-remote' is used to determine |
225 where a package should be retrieved from. The sites are tried in | 226 where a package should be retrieved from. The sites are tried in |
226 order so one is better off listing easily reached sites first. | 227 order so one is better off listing easily reached sites first. |
269 'md5sum))) | 270 'md5sum))) |
270 (error "Package %s does not match md5 checksum" filename))) | 271 (error "Package %s does not match md5 checksum" filename))) |
271 (message "Retrieved package %s" filename) (sit-for 0) | 272 (message "Retrieved package %s" filename) (sit-for 0) |
272 (let ((status | 273 (let ((status |
273 (package-admin-add-binary-package | 274 (package-admin-add-binary-package |
274 (package-get-staging-dir filename)))) | 275 (package-get-staging-dir filename) |
276 install-dir))) | |
275 (when (not (= status 0)) | 277 (when (not (= status 0)) |
276 (message "Package failed.") | 278 (message "Package failed.") |
277 (switch-to-buffer package-admin-temp-buffer))) | 279 (switch-to-buffer package-admin-temp-buffer))) |
278 (sit-for 0) | 280 (sit-for 0) |
279 (message "Added package") (sit-for 0) | 281 (message "Added package") (sit-for 0) |