From 92c3438df1715fe7bdc8cb4d50a33c338e5fbc75 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Thu, 25 Feb 2010 13:32:20 +0100 Subject: [PATCH] More paranoid checks when building the commit id file. --- src/bare.lsp.in | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/bare.lsp.in b/src/bare.lsp.in index 3557d3062..a9e0214dc 100644 --- a/src/bare.lsp.in +++ b/src/bare.lsp.in @@ -33,13 +33,16 @@ (setq si::+commit-id+ "UNKNOWN") #-windows (when (probe-file "@top_srcdir@/../.git/") - (when (zerop (si::system "(cd \"@top_srcdir@\" && git log --format=oneline -1) > COMMIT-ID")) - (let* ((file (print (open "COMMIT-ID" :direction :input :element-type :default - :external-format :default))) - (line (print (read-line file)))) - (setq si::+commit-id+ (subseq line 0 40)) + (when (probe-file "COMMIT-ID") + (delete-file "COMMIT-ID")) + (when (and (zerop (si::system "(cd \"@top_srcdir@\" && git log --format=oneline -1) > COMMIT-ID")) + (probe-file "COMMIT-ID")) + (let* ((file (open "COMMIT-ID" :direction :input :element-type :default + :external-format :default)) + (line (read-line file)) + (l (length line))) + (setq si::+commit-id+ (subseq line 0 (min l 40))) (close file)))) -(print si::+commit-id+) ;;; ;;; * Load Common-Lisp base library