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 @@
(dolist (release (ql-dist:provided-releases t))
(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 *log-errors* t)
(defun refresh (&key (makeinfo-path *makeinfo-path*) (log-errors t) uninstall)
(let ((*makeinfo-path* makeinfo-path))
(defun refresh (&key (makeinfo-path *makeinfo-path*) (log-errors *log-errors*) uninstall)
(let ((*makeinfo-path* makeinfo-path)
(*log-errors* log-errors))
(when uninstall
(uninstall-releases))
(ql:update-all-dists :prompt nil)
(ql:update-client :prompt nil)
(build-releases)
(build-texis makeinfo-path :log-errors log-errors)
(build-texis)
(build-index)))
......@@ -122,10 +122,10 @@
(print-columns dir-list length file))
(format file "</body>~%"))))
(defun build-texi (texi makeinfo-path &key (log-errors t))
(defun build-texi (texi)
(let ((out (with-output-to-string (out)
(sb-ext:run-program
makeinfo-path
*makeinfo-path*
(list "--html" (namestring texi)
"-o" (namestring
(from-homedir
......@@ -137,15 +137,14 @@
;; enabled (see NCONC for example).
"--force")
:output out))))
(when (and log-errors
(when (and *log-errors*
(not (string= out "")))
(log-texi-error out texi))))
;; #### FIXME: remove MAKEINFO-PATH everywhere and use the global variable
;; directly. Same goes for the directory components below. However, keep it if
;; you plan on making the function in question another possible entry point.
(defun build-texis (makeinfo-path &key (log-errors t))
(clean-or-create (from-homedir "quickref/"))
(clean-or-create (from-homedir "texi-logfiles/"))
(dolist (texi (get-texi-pathnames))
(build-texi texi makeinfo-path :log-errors log-errors)))
(defun build-texis (&key (makeinfo-path *makeinfo-path*) (log-errors *log-errors*))
(let ((*makeinfo-path* makeinfo-path)
(*log-errors* log-errors))
(clean-or-create (from-homedir "quickref/"))
(clean-or-create (from-homedir "texi-logfiles/"))
(dolist (texi (get-texi-pathnames))
(build-texi texi))))
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