unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* First attempt at package-update-all for package.el
@ 2011-09-12 16:32 Donald Curtis
  2011-09-14 19:05 ` Phil Hagelberg
  0 siblings, 1 reply; 4+ messages in thread
From: Donald Curtis @ 2011-09-12 16:32 UTC (permalink / raw)
  To: emacs-devel

I know there is a feature freeze but one of the most requested features (myself included) seems to be an "update" for packages in package.el.  

https://gist.github.com/1211655

(defun package-update-all ()
  "Update all packages"
  (interactive)
  (dolist (elt package-alist)
    (let* ((name (car elt))
           (file-name (symbol-name name))
           (available-pkg (assq name package-archive-contents))
           (available-version (and available-pkg
                                   (package-desc-vers (cdr available-pkg))))
           (current-version (package-desc-vers (cdr elt)))
           )
      (when (and available-version
                 (version-list-< current-version available-version))
        (message "Updating to: %s - %s" file-name
                 (package-version-join available-version))
        (package-install name)
        (package-delete file-name (package-version-join current-version))))))


At least this is available if anyone wants to just put it in their own init file.  It's probably not completely right as I am very new to programming this lisp stuff.

Thanks,
Donald


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-15  2:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-12 16:32 First attempt at package-update-all for package.el Donald Curtis
2011-09-14 19:05 ` Phil Hagelberg
2011-09-14 20:06   ` Chong Yidong
2011-09-15  2:14     ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).