comparison lisp/package-ui.el @ 377:d883f39b8495 r21-2b4

Import from CVS: tag r21-2b4
author cvs
date Mon, 13 Aug 2007 11:05:42 +0200
parents a300bb07d72d
children bbff43aa5eb7
comparison
equal deleted inserted replaced
376:e2295b4d9f2e 377:d883f39b8495
211 )) 211 ))
212 212
213 (defun pui-package-symbol-char (pkg-sym version) 213 (defun pui-package-symbol-char (pkg-sym version)
214 (progn 214 (progn
215 (if (package-get-info-find-package packages-package-list pkg-sym) 215 (if (package-get-info-find-package packages-package-list pkg-sym)
216 (if (package-get-installedp pkg-sym version) 216 (let ((installed (package-get-key pkg-sym :version)))
217 (list " " pui-up-to-date-package-face) 217 (if (>= (if (stringp installed)
218 (list "*" pui-outdated-package-face)) 218 (string-to-number installed)
219 installed)
220 (if (stringp version)
221 (string-to-number version)
222 version))
223 (list " " pui-up-to-date-package-face)
224 (list "*" pui-outdated-package-face)))
219 (list "-" pui-uninstalled-package-face)) 225 (list "-" pui-uninstalled-package-face))
220 )) 226 ))
221 227
222 (defun pui-update-package-display (extent &optional pkg-sym version) 228 (defun pui-update-package-display (extent &optional pkg-sym version)
223 "Update the package status for EXTENT. 229 "Update the package status for EXTENT.
330 (erase-buffer package-admin-temp-buffer) 336 (erase-buffer package-admin-temp-buffer)
331 ) 337 )
332 (message "Installing selected packages ...") (sit-for 0) 338 (message "Installing selected packages ...") (sit-for 0)
333 (if (catch 'done 339 (if (catch 'done
334 (mapcar (lambda (pkg) 340 (mapcar (lambda (pkg)
335 (if (not (package-get pkg 341 (if (not (package-get pkg nil nil
336 pui-package-install-dest-dir)) 342 pui-package-install-dest-dir))
337 (throw 'done nil))) 343 (throw 'done nil)))
338 pui-selected-packages) 344 pui-selected-packages)
339 t) 345 t)
340 (progn 346 (progn
341 (pui-list-packages) 347 (pui-list-packages)
351 (defun pui-add-required-packages () 357 (defun pui-add-required-packages ()
352 "Select packages required by those already selected for installation." 358 "Select packages required by those already selected for installation."
353 (interactive) 359 (interactive)
354 (let ((tmpbuf "*Required-Packages*") do-select) 360 (let ((tmpbuf "*Required-Packages*") do-select)
355 (if pui-selected-packages 361 (if pui-selected-packages
356 (let ((dependencies (package-get-dependencies pui-selected-packages))) 362 (let ((dependencies
363 (delq nil (mapcar
364 (lambda (pkg)
365 (let ((installed
366 (package-get-key pkg :version))
367 (current
368 (package-get-info-prop
369 (package-get-info-version
370 (package-get-info-find-package
371 package-get-base pkg) nil)
372 'version)))
373 (if (< (if (stringp installed)
374 (string-to-number installed)
375 installed)
376 (if (stringp current)
377 (string-to-number current)
378 current))
379 pkg
380 nil)))
381 (package-get-dependencies pui-selected-packages)))))
357 ;; Don't change window config when asking the user if he really 382 ;; Don't change window config when asking the user if he really
358 ;; wants to add the packages. We do this to avoid messing up 383 ;; wants to add the packages. We do this to avoid messing up
359 ;; the window configuration if errors occur (we don't want to 384 ;; the window configuration if errors occur (we don't want to
360 ;; display random buffers in addition to the error buffer, if 385 ;; display random buffers in addition to the error buffer, if
361 ;; errors occur, which would normally be caused by display-buffer). 386 ;; errors occur, which would normally be caused by display-buffer).
469 The package name, version, and description are displayed. From the displayed 494 The package name, version, and description are displayed. From the displayed
470 buffer, the user can see which packages are installed, which are not, and 495 buffer, the user can see which packages are installed, which are not, and
471 which are out-of-date (a newer version is available). The user can then 496 which are out-of-date (a newer version is available). The user can then
472 select packages for installation via the keyboard or mouse." 497 select packages for installation via the keyboard or mouse."
473 (interactive) 498 (interactive)
474 (package-get-require-base) 499 (package-get-require-base t)
475 (let ( (outbuf (get-buffer-create pui-info-buffer)) 500 (let ( (outbuf (get-buffer-create pui-info-buffer))
476 (sep-string "===============================================================================\n") 501 (sep-string "===============================================================================\n")
477 start ) 502 start )
478 (message "Creating package list ...") (sit-for 0) 503 (message "Creating package list ...") (sit-for 0)
479 (set-buffer outbuf) 504 (set-buffer outbuf)