mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
maint: update-NEWS: Sort packages prior writing to the data file.
* build-aux/update-NEWS.scm (main): Sort packages.
This commit is contained in:
parent
7418a20074
commit
ed2d4d52dd
1 changed files with 10 additions and 4 deletions
|
@ -166,16 +166,22 @@ (define (package-file version)
|
||||||
(string-append data-directory "/packages-"
|
(string-append data-directory "/packages-"
|
||||||
version ".txt"))
|
version ".txt"))
|
||||||
|
|
||||||
|
(define (package<? p1 p2)
|
||||||
|
(string<? (package-full-name p1) (package-full-name p2)))
|
||||||
|
|
||||||
(let-values (((previous-version new-version)
|
(let-values (((previous-version new-version)
|
||||||
(call-with-input-file news-file NEWS->versions)))
|
(call-with-input-file news-file NEWS->versions)))
|
||||||
(format (current-error-port) "Updating NEWS for ~a to ~a...~%"
|
(format (current-error-port) "Updating NEWS for ~a to ~a...~%"
|
||||||
previous-version new-version)
|
previous-version new-version)
|
||||||
(let* ((old (call-with-input-file (package-file previous-version)
|
(let* ((old (call-with-input-file (package-file previous-version)
|
||||||
read))
|
read))
|
||||||
(new (fold-packages (lambda (p r)
|
(all-packages/sorted (sort (fold-packages (lambda (p r)
|
||||||
(alist-cons (package-name p) (package-version p)
|
(cons p r))
|
||||||
r))
|
'())
|
||||||
'())))
|
package<?))
|
||||||
|
(new (map (lambda (p)
|
||||||
|
(cons (package-name p) (package-version p)))
|
||||||
|
all-packages/sorted)))
|
||||||
(call-with-output-file (package-file new-version)
|
(call-with-output-file (package-file new-version)
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(pretty-print new port)))
|
(pretty-print new port)))
|
||||||
|
|
Loading…
Reference in a new issue