make-tarball 1.95 KB
Newer Older
1
2
":" ; exec sbcl --script "$0" "$@" ; exit # -*- Lisp -*-
;;;;; Really runs on any decent Common Lisp implementation
3

4
5
(load (make-pathname :name "prelude" :type "lisp" :defaults *load-pathname*)
  :verbose nil :print nil)
6

7
;;;;; create tarball for the current version.
8

9
10
11
12
13
14
15
(in-package :asdf)

(asdf-debug)

(describe (find-system :asdf))

(defparameter *ad* (find-system :asdf-driver))
16
17
18
19
20
21
22
23
24
(defparameter *asdf-dir*
  (ensure-pathname (system-source-directory *ad*)
                   :want-existing t :want-absolute t))
(defun apath (x) (subpathname *asdf-dir* x))
(defun ann (x) (native-namestring (apath x)))
(defparameter *build-dir* (apath "build/"))
(defparameter /build-dir/ (ann "build/"))
(defun bpath (x) (subpathname *build-dir* x))
(defun bnn (x) (native-namestring (bpath x)))
25
(defparameter *files*
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  (list* "asdf-driver.asd" "version.lisp-expr"
         (loop :for c :in (operated-components
                           *ad* :goal-operation 'load-op
                                :keep-operation 'load-op)
               :for n = (enough-namestring (component-pathname c)
                                           *asdf-directory*)
               :when (typep c 'cl-source-file)
                 :collect n)))
(defparameter *version*
  (safe-read-first-file-form (apath "version.lisp-expr")))
(defparameter *name* (format nil "asdf-driver-~A" *version*))
(defparameter *tarname* (strcat *name* ".tar.gz"))
(defparameter dirname/ (strcat *name* "/"))
(defparameter *destination*
  (ensure-pathname (bpath dirname/)
                   :want-directory t :want-absolute t))
(assert (< 6 (length (pathname-directory *destination*))))
(defparameter /destination/ (native-namestring *destination*))
(run-program/ `("rm" "-rf" ,/destination/))
(ensure-directory-exists *destination*)
(run-program/ `("ln" ,@(mapcar 'ann *files*) ,/destination/))
(run-program/ (format nil "cd ~S && tar zcf ~S ~S"
                      ,/build-dir/, ,*tarname* ,dirname/))
(run-program/ `("rm" "-rf" ,/destination/))