comparison lisp/package-ui.el @ 394:7d59cb494b73 r21-2-12

Import from CVS: tag r21-2-12
author cvs
date Mon, 13 Aug 2007 11:11:37 +0200
parents bbff43aa5eb7
children 74fd4e045ea6
comparison
equal deleted inserted replaced
393:2e030b8965b1 394:7d59cb494b73
360 (display-completion-list (sort 360 (display-completion-list (sort
361 (mapcar '(lambda (pkg) 361 (mapcar '(lambda (pkg)
362 (symbol-name pkg) 362 (symbol-name pkg)
363 ) 363 )
364 pui-deleted-packages) 364 pui-deleted-packages)
365 'string<) 365 'string<)
366 :activate-callback nil 366 :activate-callback nil
367 :help-string "Packages selected for removal:\n" 367 :help-string "Packages selected for removal:\n"
368 :completion-string t 368 :completion-string t
369 )) 369 ))
370 (setq tmpbuf (get-buffer-create tmpbuf)) 370 (setq tmpbuf (get-buffer-create tmpbuf))
371 (display-buffer tmpbuf) 371 (display-buffer tmpbuf)
372 (setq do-delete (yes-or-no-p "Remove these packages? ")) 372 (setq do-delete (yes-or-no-p "Remove these packages? "))
373 (kill-buffer tmpbuf)) 373 (kill-buffer tmpbuf))
374 (when do-delete 374 (when do-delete
375 (message "Deleting selected packages ...") (sit-for 0) 375 (message "Deleting selected packages ...") (sit-for 0)
376 (when (catch 'done 376 (mapcar (lambda (pkg)
377 (mapcar (lambda (pkg) 377 (package-admin-delete-binary-package
378 (if (not 378 pkg (package-admin-get-install-dir pkg nil)))
379 (package-admin-delete-binary-package 379 pui-deleted-packages)
380 pkg (package-admin-get-install-dir pkg nil))) 380 (message "Packages deleted"))))
381 (throw 'done nil)))
382 pui-deleted-packages)
383 t)
384 (message "Packages deleted")
385 ))))
386 381
387 (let ( (tmpbuf "*Packages-To-Install*") do-install) 382 (let ( (tmpbuf "*Packages-To-Install*") do-install)
388 (if pui-selected-packages 383 (if pui-selected-packages
389 (progn 384 (progn
390 ;; Don't change window config when asking the user if he really 385 ;; Don't change window config when asking the user if he really
428 (progn 423 (progn
429 (pui-list-packages) 424 (pui-list-packages)
430 (message "Packages installed") 425 (message "Packages installed")
431 )) 426 ))
432 ) 427 )
433 (clear-message) 428 (clear-message)
434 ) 429 )
435 ) 430 )
436 (if pui-deleted-packages 431 (if pui-deleted-packages
437 (pui-list-packages) 432 (pui-list-packages)
438 (error "No packages have been selected!"))) 433 (error "No packages have been selected!")))
439 )) 434 ))
452 (package-get-info-prop 447 (package-get-info-prop
453 (package-get-info-version 448 (package-get-info-version
454 (package-get-info-find-package 449 (package-get-info-find-package
455 package-get-base pkg) nil) 450 package-get-base pkg) nil)
456 'version))) 451 'version)))
457 (if (< (if (stringp installed) 452 (if (or (null installed)
453 (< (if (stringp installed)
458 (string-to-number installed) 454 (string-to-number installed)
459 installed) 455 installed)
460 (if (stringp current) 456 (if (stringp current)
461 (string-to-number current) 457 (string-to-number current)
462 current)) 458 current)))
463 pkg 459 pkg
464 nil))) 460 nil)))
465 (package-get-dependencies pui-selected-packages))))) 461 (package-get-dependencies pui-selected-packages)))))
466 ;; Don't change window config when asking the user if he really 462 ;; Don't change window config when asking the user if he really
467 ;; wants to add the packages. We do this to avoid messing up 463 ;; wants to add the packages. We do this to avoid messing up