From 5914bd43867b5fc0dd195b0aa3a95c92abb7ace9 Mon Sep 17 00:00:00 2001 From: Lionel Flandrin Date: Mon, 9 Nov 2009 12:59:11 +0100 Subject: [PATCH] Use the output of "git describe" in *version* when a ".git" exists. --- version.lisp.in | 8 ++++++-- wrappers.lisp | 13 +++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/version.lisp.in b/version.lisp.in index 7dfe360..205c784 100644 --- a/version.lisp.in +++ b/version.lisp.in @@ -28,9 +28,13 @@ (export '(*version* version)) (defparameter *version* - #.(concatenate 'string "@PACKAGE_VERSION@ Compiled On " + #.(concatenate 'string + (if (probe-file ".git") + (string-trim '(#\Newline) (run-shell-command "git describe" t)) + "@PACKAGE_VERSION@") + " Compiled On " (format-expand *time-format-string-alist* - *time-format-string-default*))) + *time-format-string-default*))) (defcommand version () () (message *version*)) diff --git a/wrappers.lisp b/wrappers.lisp index 58a0667..cdd3344 100644 --- a/wrappers.lisp +++ b/wrappers.lisp @@ -101,10 +101,15 @@ (sb-ext:run-program prog args :output s :error s :wait t ;; inject the DISPLAY variable in so programs show up ;; on the right screen. - :environment (cons (screen-display-string (current-screen)) - (remove-if (lambda (str) - (string= "DISPLAY=" str :end2 (min 8 (length str)))) - (sb-ext:posix-environ))))) + :environment + (let ((env (remove-if (lambda (str) + (string= "DISPLAY=" str :end2 (min 8 (length str)))) + (sb-ext:posix-environ))) + (current-screen (current-screen))) + (if current-screen + (cons (screen-display-string (current-screen)) + env) + env)))) #+ccl (with-output-to-string (s) (ccl:run-program prog (mapcar (lambda (s) (if (simple-string-p s) s (coerce s 'simple-string))) -- 1.6.5.2