-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathupstream-cvs.lisp
63 lines (54 loc) · 2.33 KB
/
upstream-cvs.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
;;;; upstream-cvs.lisp
(in-package #:quicklisp-controller)
(defclass cvs-source (vcs-source)
()
(:default-initargs
:command "cvs"))
(defclass cvs-oddmodule-source (cvs-source)
((module-name
:initarg :module-name
:accessor module-name
:documentation "Some CVS sources have modules that don't
correspond to their project name, e.g. Scott Burson's
misc-extensions. Allow an explicit module name in the source.")))
(defmethod source-location-initargs ((source cvs-oddmodule-source))
(list :location :module-name))
(defmethod source-host ((source cvs-source))
(let* ((location (location source))
(host-start (1+ (position #\@ location)))
(host-end (position #\: location :start host-start)))
(subseq location host-start host-end)))
(defmethod source-description ((source cvs-source))
(format nil "cvs -d ~A co ~A"
(location source)
(module-name source)))
(defmethod vcs-checkout ((source cvs-source) checkout-directory)
(let* ((pathname checkout-directory)
(parent (parent-directory pathname))
(enough (enough-namestring pathname parent)))
(ensure-directories-exist parent)
(with-posix-cwd parent
(run "cvs" "-qz3" "-d" (location source)
"co" "-d" (string-right-trim "/" enough) (module-name source)))))
(defmethod vcs-update-arguments ((source cvs-source) checkout-directory)
(list "cvs" "-qz3" "-d" (location source)
"update" "-dP"))
(defmethod make-release-tarball ((source cvs-source) output-file)
(let ((prefix (release-tarball-prefix source))
(checkout (ensure-source-cache source)))
(with-posix-cwd checkout
(in-temporary-directory "release/"
;; This garbage is because sourceforge CVS chokes on something like:
;; cvs export -r HEAD -d foo/bar myproject
;; Work around it.
(let ((output (merge-pathnames prefix))
(ftso-sourceforge (format nil "XXX-FROBBLEDOBBLE-~D-XXX"
(random 42))))
(with-posix-cwd ".."
(run "cvs" "-qz3" "export" "-r" "HEAD"
"-d" ftso-sourceforge
(module-name source))
(run "mv" ftso-sourceforge output))
(run "tar" "cvf" "package.tar" prefix)
(run "gzip" "-vn9" "package.tar")
(copy "package.tar.gz" output-file))))))