Commit 223761e5 authored by Antoine Martin's avatar Antoine Martin
Browse files

Use global variables for some parameters

Fixes #52
parent 52d1dd95
...@@ -57,17 +57,16 @@ ...@@ -57,17 +57,16 @@
(dolist (release (ql-dist:provided-releases t)) (dolist (release (ql-dist:provided-releases t))
(ql-dist:uninstall release))) (ql-dist:uninstall release)))
;; #### FIXME: consider making global variables for customizable aspects of
;; the library. This is done below for *MAKEINFo-PATH*, but you can also do it
;; the *LOG-ERRORS* etc.
(defparameter *makeinfo-path* "/usr/local/bin/makeinfo") (defparameter *makeinfo-path* "/usr/local/bin/makeinfo")
(defparameter *log-errors* t)
(defun refresh (&key (makeinfo-path *makeinfo-path*) (log-errors t) uninstall) (defun refresh (&key (makeinfo-path *makeinfo-path*) (log-errors *log-errors*) uninstall)
(let ((*makeinfo-path* makeinfo-path)) (let ((*makeinfo-path* makeinfo-path)
(*log-errors* log-errors))
(when uninstall (when uninstall
(uninstall-releases)) (uninstall-releases))
(ql:update-all-dists :prompt nil) (ql:update-all-dists :prompt nil)
(ql:update-client :prompt nil) (ql:update-client :prompt nil)
(build-releases) (build-releases)
(build-texis makeinfo-path :log-errors log-errors) (build-texis)
(build-index))) (build-index)))
...@@ -122,10 +122,10 @@ ...@@ -122,10 +122,10 @@
(print-columns dir-list length file)) (print-columns dir-list length file))
(format file "</body>~%")))) (format file "</body>~%"))))
(defun build-texi (texi makeinfo-path &key (log-errors t)) (defun build-texi (texi)
(let ((out (with-output-to-string (out) (let ((out (with-output-to-string (out)
(sb-ext:run-program (sb-ext:run-program
makeinfo-path *makeinfo-path*
(list "--html" (namestring texi) (list "--html" (namestring texi)
"-o" (namestring "-o" (namestring
(from-homedir (from-homedir
...@@ -137,15 +137,14 @@ ...@@ -137,15 +137,14 @@
;; enabled (see NCONC for example). ;; enabled (see NCONC for example).
"--force") "--force")
:output out)))) :output out))))
(when (and log-errors (when (and *log-errors*
(not (string= out ""))) (not (string= out "")))
(log-texi-error out texi)))) (log-texi-error out texi))))
;; #### FIXME: remove MAKEINFO-PATH everywhere and use the global variable (defun build-texis (&key (makeinfo-path *makeinfo-path*) (log-errors *log-errors*))
;; directly. Same goes for the directory components below. However, keep it if (let ((*makeinfo-path* makeinfo-path)
;; you plan on making the function in question another possible entry point. (*log-errors* log-errors))
(defun build-texis (makeinfo-path &key (log-errors t)) (clean-or-create (from-homedir "quickref/"))
(clean-or-create (from-homedir "quickref/")) (clean-or-create (from-homedir "texi-logfiles/"))
(clean-or-create (from-homedir "texi-logfiles/")) (dolist (texi (get-texi-pathnames))
(dolist (texi (get-texi-pathnames)) (build-texi texi))))
(build-texi texi makeinfo-path :log-errors log-errors)))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment