I've written some utility functions for working with
package-get-base.el The first of these is for reading in an
incremental update (e.g, package-get-base.incremental-1998-10-01). The
second function writes a new package-get-base.el file, using the
current value of (the lisp variable) package-get-base.
In a typical session, the user would
1) use package-base-update-from-file to read in the
incremental changes (new or updated packages).
2) use package-dump-base to write a new package-get-base.el
file.
3) byte-compile the new package-get-base.el.
;;; package-base-update.el
(require 'package-get-base)
(defun package-base-update-from-file (file)
"Update package-get-base with new or modified package description
entries from FILE."
(interactive "fFile: ")
(find-file file)
(save-excursion
(save-restriction
(widen)
(let ((standard-input (current-buffer)))
(goto-char (point-min))
(do ((entry (read)
(ignore-errors (read))))
((null entry))
(if (assq (car entry) package-get-base)
(setcdr (assq (car entry) package-get-base)
(cdr entry))
(setq package-get-base (cons entry package-get-base))))))))
(defun package-print-entry (entry)
(insert (format " (%S\n (\n" (car entry)))
(do ((list (car (cdr entry)) (cdr (cdr list))))
((null list))
(insert (format " %S %S\n"
(car list)
(car (cdr list)))))
(insert " ))\n"))
(defun package-dump-base (file)
"Make a new package-get-base.el file using the current contents of
package-get-base."
(interactive "FFile: ")
(when (or (not (file-exists-p file))
(yes-or-no-p "File %s exists. Overwrite? "))
(set-buffer (find-file file))
(erase-buffer)
(insert ";;; package-get-base " (current-time-string) "\n")
(insert "(setq package-get-base\n'(\n")
(dolist (entry package-get-base)
(print-entry entry))
(insert "))\n")
(insert "(provide 'package-get-base)\n")))
Show replies by date