;;; A script to find packages possibly affected by GitHub ;;; infrastructure update that caused minor changes in the ;;; automatically generated tarballs. (use-modules (ice-9 match) (gnu packages) (guix download) (guix packages)) (define (problematic-uri? uri) (define (contains-github-archive? uri) (string-match "github.com/.*/archive/" uri)) ;; URI can be a string or a list of string. (match uri ((uri1 uri2 ...) ;match list of strings (filter contains-github-archive? uri)) (uri1 ;match string (contains-github-archive? uri1)))) (define (problematic-github-package? package) (let ((source (package-source package))) (and (origin? source) (eq? (origin-method source) url-fetch) (problematic-uri? (origin-uri source))))) (define (problematic-github-packages) "List of all the potentially problematic GitHub packages." (fold-packages (lambda (p r) (if (problematic-github-package? p) (cons p r) r)) '())) (define (main) "Find and print the names of the potentially problematic GitHub packages." (let ((packages (problematic-github-packages))) (format #t "Number of potentially problematic GitHub packages:~a~%" (length packages)) (for-each (lambda (p) (format #t "~a~%" (package-name p))) packages))) ;;; Run the program. (main)