On 18 Feb 2001 at 19:26:41 +1000, Steve Youngs <youngs(a)xemacs.org> wrote:
I'll put some thought into how I can make the package-index file
reflect just the packages that are in that directory. And, more
importantly, keep everything in sync.
How about getting rid of package-index altogether? The package names
are very regular in form, so it shouldn't be too hard to parse them out
of a file list from FTP. Something like this should do it:
(defun make-package-list ()
"Make a list of package names and versions from an FTP directory listing in
the current buffer."
(let (list)
(while (search-forward "-pkg.tar.gz" nil t)
(search-backward "-")
(let* ((version-end (point))
(name-end (search-backward "-"))
(version-start (1+ name-end))
(package-version (buffer-substring version-start version-end))
package-name)
(skip-syntax-backward "^ ")
(setq package-name (buffer-substring (point) name-end)
list (nconc list (cons (list package-name package-version) nil)))
(end-of-line)))
list))
Then you would want to scan for duplicate package names, and just keep
the one with the highest version number. That way, you would get a list
of whatever your FTP server actually has. Does this approach have any
merit?
--
Jerry James