Created
July 31, 2016 05:37
-
-
Save jl2/c06248a1426d61e192a3a329fee5c359 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/lisp --script | |
;; -*-lisp-*- | |
(defmacro home (path) | |
`(merge-pathnames ,path (user-homedir-pathname))) | |
#-quicklisp | |
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | |
(user-homedir-pathname)))) | |
(when (probe-file quicklisp-init) | |
(load quicklisp-init))) | |
(let* ((git-out-string (make-array '(0) :element-type 'base-char | |
:fill-pointer 0 :adjustable t)) | |
(done-str "Already up-to-date") | |
(len-done (length done-str)) | |
(force-build (string= "--force" (second sb-ext:*posix-argv*)))) | |
(with-output-to-string (s git-out-string) | |
(run-program "git" (list "pull") :search t :output s :input t :error :output :wait t :directory (home "oss_src/sbcl"))) | |
(if (or force-build (not (string= done-str (subseq git-out-string 0 len-done)))) | |
(progn | |
(format t git-out-string) | |
(run-program "sh" (list "make.sh" "--dynamic-space-size=8192" "--fancy") :search t :output t :input t :error :output :wait t :directory (home "oss_src/sbcl")) | |
(run-program "sudo" (list "sh" "install.sh") :search t :output t :input t :error :output :wait t :directory (home "oss_src/sbcl"))) | |
(format t "Already up to date!~%"))) | |
(ql:update-dist "quicklisp") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment