quirks: Adjust patch to allow traveling back to Dec. 2018.

Fixes <https://bugs.gnu.org/42519>.

This fixes:

  guix time-machine --commit=897f303d2fa61497a931cf5fcb43349eb5f44c14

a commit dated Dec. 2018.

* guix/quirks.scm (%bug-41214-patch)[accesses-guile-2.2-optimization-options?]:
Add second 'match' clause.
This commit is contained in:
Ludovic Courtès 2020-07-24 17:45:55 +02:00
parent cb3bae900f
commit e85d7ed609
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -139,9 +139,10 @@ (define %bug-41214-patch
(define (accesses-guile-2.2-optimization-options? source commit)
(catch 'system-error
(lambda ()
(match (call-with-input-file
(string-append source "/guix/build/compile.scm")
read)
(call-with-input-file (string-append source
"/guix/build/compile.scm")
(lambda (port)
(match (read port)
(('define-module ('guix 'build 'compile)
_ ...
#:use-module ('language 'tree-il 'optimize)
@ -150,7 +151,18 @@ (define (accesses-guile-2.2-optimization-options? source commit)
'%lightweight-optimizations
'compile-files))
#t)
(_ #f)))
(_
;; Before v1.0.0 (ca. Dec. 2018), the 'use-modules' form
;; would show up in a subsequent 'cond-expand' clause.
;; See <https://bugs.gnu.org/42519>.
(match (read port)
(('cond-expand
('guile-2.2 ('use-modules ('language 'tree-il 'optimize)
_ ...))
_ ...)
#t)
(_
#f)))))))
(const #f)))
(define (build-with-guile-2.2 source)