Adds the following functions to the `versions'
egg:
(define (local egg)
(irregex-replace
(format "~%")
(last
(string-split
(call-with-input-pipe
(string-append "chicken-status " egg)
read-all)))))
(define (remote egg #!optional url)
(let ((.url.
(if url
url
"http://chicken.kitten-technologies.co.uk/henrietta.cgi?name=")))
(version-sort
(string-split
(with-input-from-request
(string-append
.url.
(uri-encode-string egg)
"&listversions=1")
#f read-all)
(format "~%")))))
(define (update-available? egg #!optional
url)
(version-newer? (last (remote egg)) (local
egg)))
The above functions can/could be used as the basis for a more
flexible/powerful means of updating eggs, as in only updating
eggs that actually needed to be updated instead of just updating
all of them. The functions depend on the http-client, uri-generic,
and versions eggs; they also use the irregex, posix,
and utils units.
If these don't seem like a good fit for versions, then
that's okay: so long as these functions get added to some
egg, I'll live: I just felt that they'd be out of place in the readline
egg.
|