diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-05-10 12:23:55 -0400 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-05-10 13:48:02 -0400 |
| commit | ed2d4d52dde00bdccc1bb2c93b24ffcc72a7fcd3 (patch) | |
| tree | 155553a29cb40327a0b909f07a39c66280e45a4c | |
| parent | 7418a200742768d21b567916b25e4d3351472230 (diff) | |
maint: update-NEWS: Sort packages prior writing to the data file.
* build-aux/update-NEWS.scm (main): Sort packages.
| -rw-r--r-- | build-aux/update-NEWS.scm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/build-aux/update-NEWS.scm b/build-aux/update-NEWS.scm index e916f3f1e81..c029d2f0dab 100644 --- a/build-aux/update-NEWS.scm +++ b/build-aux/update-NEWS.scm | |||
| @@ -166,16 +166,22 @@ paragraph." | |||
| 166 | (string-append data-directory "/packages-" | 166 | (string-append data-directory "/packages-" |
| 167 | version ".txt")) | 167 | version ".txt")) |
| 168 | 168 | ||
| 169 | (define (package<? p1 p2) | ||
| 170 | (string<? (package-full-name p1) (package-full-name p2))) | ||
| 171 | |||
| 169 | (let-values (((previous-version new-version) | 172 | (let-values (((previous-version new-version) |
| 170 | (call-with-input-file news-file NEWS->versions))) | 173 | (call-with-input-file news-file NEWS->versions))) |
| 171 | (format (current-error-port) "Updating NEWS for ~a to ~a...~%" | 174 | (format (current-error-port) "Updating NEWS for ~a to ~a...~%" |
| 172 | previous-version new-version) | 175 | previous-version new-version) |
| 173 | (let* ((old (call-with-input-file (package-file previous-version) | 176 | (let* ((old (call-with-input-file (package-file previous-version) |
| 174 | read)) | 177 | read)) |
| 175 | (new (fold-packages (lambda (p r) | 178 | (all-packages/sorted (sort (fold-packages (lambda (p r) |
| 176 | (alist-cons (package-name p) (package-version p) | 179 | (cons p r)) |
| 177 | r)) | 180 | '()) |
| 178 | '()))) | 181 | package<?)) |
| 182 | (new (map (lambda (p) | ||
| 183 | (cons (package-name p) (package-version p))) | ||
| 184 | all-packages/sorted))) | ||
| 179 | (call-with-output-file (package-file new-version) | 185 | (call-with-output-file (package-file new-version) |
| 180 | (lambda (port) | 186 | (lambda (port) |
| 181 | (pretty-print new port))) | 187 | (pretty-print new port))) |
