Let the user override the version strings produced in org-fixup.

* UTILITIES/org-fixup.el (org-fixup): Let the user override the
  version strings produced in org-fixup whith strings stored in
  org-fake-release and org-fake-git-version.  Skip loading them from a
  pre-existing org-version.el or trying to determine them from git in
  this case.  This is predominantly useful if Git is not available,
  but the user wants to install from a Git tarball which is missing a
  pre-configured org-version.el file.
This commit is contained in:
Achim Gratz 2012-07-11 19:32:33 +02:00 committed by Bastien Guerry
parent be56d706ae
commit b050afa06f
1 changed files with 21 additions and 16 deletions

View File

@ -140,22 +140,27 @@ oldorg: # do what the old Makfile did by default
(dirgit (concat dirorg ".git/" )) (dirgit (concat dirorg ".git/" ))
(org-version "N/A-fixup") (org-version "N/A-fixup")
(org-git-version "N/A-fixup !!check installation!!")) (org-git-version "N/A-fixup !!check installation!!"))
(if (load (concat dirlisp "org-version.el") 'noerror 'nomessage 'nosuffix) (if (and (boundp 'org-fake-release) (stringp org-fake-release)
(setq org-version (org-release) (boundp 'org-fake-git-version) (stringp org-fake-git-version))
org-git-version (org-git-version)) (setq org-version org-fake-release
(when (and (file-exists-p dirgit) org-git-version org-fake-git-version)
(executable-find "git")) (if (load (concat dirlisp "org-version.el") 'noerror 'nomessage 'nosuffix)
(unwind-protect (setq org-version (org-release)
(progn org-git-version (org-git-version))
(cd dirorg) (when (and (file-exists-p dirgit)
(let ((git6 (substring (shell-command-to-string "git describe --abbrev=6 HEAD") 0 -1)) (executable-find "git"))
(git0 (substring (shell-command-to-string "git describe --abbrev=0 HEAD") 0 -1)) (unwind-protect
(gitd (string-match "\\S-" (shell-command-to-string "git status -uno --porcelain")))) (progn
(setq org-git-version (concat git6 (when gitd ".dirty"))) (cd dirorg)
(if (string-match "^release_" git0) (let ((git6 (substring (shell-command-to-string "git describe --abbrev=6 HEAD") 0 -1))
(setq org-version (substring git0 8)) (git0 (substring (shell-command-to-string "git describe --abbrev=0 HEAD") 0 -1))
(setq org-version git0)))) (gitd (string-match "\\S-"
(cd origin)))) (shell-command-to-string "git status -uno --porcelain"))))
(setq org-git-version (concat git6 (when gitd ".dirty")))
(if (string-match "^release_" git0)
(setq org-version (substring git0 8))
(setq org-version git0))))
(cd origin)))))
`(progn `(progn
(defun org-release () ,org-version) (defun org-release () ,org-version)
(defun org-git-version () ,org-git-version) (defun org-git-version () ,org-git-version)