From 7f369445b8a14389da58d81fc66b2b4341aa1407 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 3 Jan 2016 14:29:09 -0700 Subject: [PATCH] dist/update-copyright.scm: Translate last-copyright-year. --- dist/update-copyright.scm | 21 +++++++++++++++++++-- src/runtime/version.scm | 4 +++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/dist/update-copyright.scm b/dist/update-copyright.scm index 9c32aa8d1..cb58204f5 100644 --- a/dist/update-copyright.scm +++ b/dist/update-copyright.scm @@ -196,8 +196,25 @@ USA. "Massachusetts" "Institute" "of" "Technology")) #f) results)))) - (and (pair? results) - (reverse results))))))) + (translate-suffix leader start end results)))))) + +(define (translate-suffix leader start end results) + (let ((regs (re-substring-search-forward + "^[(]define last-copyright-year [0-9]+ *[)].*$\n" + leader start end))) + (if regs + (reverse + (cons + (list (re-match-start-index 0 regs) + (re-match-end-index 0 regs) + "" "" (list + (list + "(define" "last-copyright-year" + (number->string (this-year)) ")")) + #f) + results)) + (and (pair? results) + (reverse results))))) (define (match-copyright leader start end) (let ((regs diff --git a/src/runtime/version.scm b/src/runtime/version.scm index b46f12e3b..9998f840c 100644 --- a/src/runtime/version.scm +++ b/src/runtime/version.scm @@ -31,10 +31,12 @@ USA. (define copyright-years) +(define last-copyright-year 2014 ) + (add-boot-init! (lambda () (set! copyright-years - (let ((now 2014) + (let ((now last-copyright-year) (then 1986)) (iota (+ (- now then) 1) then))) (add-subsystem-identification! "Release" '(9 2 1)) -- 2.25.1