| 1 |
;; Ensure proper version of Gauche is used while building Gauche from repo. |
| 2 |
;; |
| 3 |
;; Some files required to build Gauche must be generated by Gauche. In the |
| 4 |
;; release tarball, such files are pre-generated by the packaging process, |
| 5 |
;; so users won't need to have Gauche pre-installed. |
| 6 |
;; However, if you build from the Git repo source, you need to have working |
| 7 |
;; Gauche on your machine to generate them. |
| 8 |
;; As a rule, you need the latest release of Gauche, to build from the repo. |
| 9 |
;; This small script checks that. |
| 10 |
|
| 11 |
(use gauche.version) |
| 12 |
|
| 13 |
(define (msg target-version) |
| 14 |
#"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\ |
| 15 |
\n\ |
| 16 |
\n To build Gauche from scratch, you need the latest release of Gauche\ |
| 17 |
\n on your machine. You seem to have ~(gauche-version)\ |
| 18 |
\n Update it to ~|target-version| before proceeding.\ |
| 19 |
\n\ |
| 20 |
\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n") |
| 21 |
|
| 22 |
(define (main args) |
| 23 |
(if (null? (cdr args)) |
| 24 |
(exit 1 "Usage: gosh check-build-version $BUILD_GOSH_VERSION") |
| 25 |
(let1 target-version (cadr args) |
| 26 |
(if (version<? (gauche-version) target-version) |
| 27 |
(exit 1 (msg target-version)) |
| 28 |
(exit 0))))) |
| 29 |
|
| 30 |
;; Local variables: |
| 31 |
;; mode: scheme |
| 32 |
;; end: |