aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/glibc-no-ld-so-cache.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/glibc-no-ld-so-cache.patch')
0 files changed, 0 insertions, 0 deletions
ip-to-org-heading input) (dump-port input output) #t)) (else (display line output) (newline output) (loop)))))) (define (enumeration->paragraph lst) "Turn LST, a list of strings, into a single string that is a ready-to-print paragraph." (fill-paragraph (string-join (sort lst string<?) ", ") 75)) (define (write-packages-added news-file old new) "Write to NEWS-FILE the list of packages added between OLD and NEW." (let ((added (lset-difference string=? (map car new) (map car old)))) (with-atomic-file-replacement news-file (lambda (input output) (rewrite-org-section input output (make-regexp "^(\\*+).*new packages") (lambda (match port) (let ((stars (match:substring match 1))) (format port "~a ~a new packages~%~%" stars (length added))))))))) (define (write-packages-updates news-file old new) "Write to NEWS-FILE the list of packages upgraded between OLD and NEW." (define important '("gcc-toolchain" "glibc" "binutils" "gdb" ;toolchain "shepherd" "linux-libre" "xorg-server" "cups" ;OS "gnome" "xfce" "enlightenment" "lxde" "mate" ;desktop env. "guile" "bash" "python" "python2" "perl" ;languages "ghc" "rust" "go" "julia" "r" "ocaml" "icedtea" "openjdk" "clojure" "sbcl" "racket" "emacs" "gimp" "inkscape" "libreoffice" ;applications "octave" "icecat" "gnupg")) (let* ((table (fold (lambda (package table) (match package ((name . version) (vhash-cons name version table)))) vlist-null new)) (latest (lambda (name) (let ((versions (vhash-fold* cons '() name table))) (match (sort versions version>?) ((latest . _) latest))))) (upgraded (filter-map (match-lambda ((package . new-version) (match (assoc package old) ((_ . old-version) (and (string=? new-version (latest package)) (version>? new-version old-version) (cons package new-version))) (_ #f)))) new)) (noteworthy (filter (match-lambda ((package . version) (member package important))) upgraded))) (with-atomic-file-replacement news-file (lambda (input output) (rewrite-org-section input output (make-regexp "^(\\*+).*package updates") (lambda (match port) (let ((stars (match:substring match 1)) (lst (map (match-lambda ((package . version) (string-append package " " version))) noteworthy))) (format port "~a ~a package updates~%~%Noteworthy updates:~%~a~%~%" stars (length upgraded) (enumeration->paragraph lst))))))))) (define (main . args) (match args ((news-file data-directory) ;; Don't browse things listed in the user's $GUIX_PACKAGE_PATH and ;; in external channels. (parameterize ((%package-module-path %default-package-module-path)) (define (package-file version) (string-append data-directory "/packages-" version ".txt")) (define (package<? p1 p2) (string<? (package-full-name p1) (package-full-name p2))) (let-values (((previous-version new-version) (call-with-input-file news-file NEWS->versions))) (format (current-error-port) "Updating NEWS for ~a to ~a...~%" previous-version new-version) (let* ((old (call-with-input-file (package-file previous-version) read)) (all-packages/sorted (sort (fold-packages (lambda (p r) (cons p r)) '()) package<?)) (new (map (lambda (p) (cons (package-name p) (package-version p))) all-packages/sorted))) (call-with-output-file (package-file new-version) (lambda (port) (pretty-print new port))) (write-packages-added news-file old new) (write-packages-updates news-file old new))))) (x (format (current-error-port) "Usage: update-NEWS NEWS-FILE DATA-DIRECTORY Update the list of new and updated packages in NEWS-FILE using the previous-version package list from DATA-DIRECTORY.\n") (exit 1)))) (apply main (cdr (command-line)))