Commit e61dd22d authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Merge tarball release fixes from master.

parent b8969954
...@@ -31,69 +31,74 @@ ...@@ -31,69 +31,74 @@
(defun tarname (name) (strcat name ".tar.gz")) (defun tarname (name) (strcat name ".tar.gz"))
(deftestcmd make-tarball-from-git (name base files (type "tar.gz")) (defun make-tarball-under-build (name base files)
(with-asdf-dir (base) (check-type name string)
(let ((tarball (strcat name "." type))) (ensure-pathname base :want-absolute t :want-existing t :want-directory t)
(git `(archive -o ,(pn "build" tarball) (dolist (f files)
:prefix (,name /) ,*version* -- ,@files) :show t)))) (check-type f string))
(let* ((base
(deftestcmd make-tarball-from-git-plus (name base files asdf-lisp version-file) (ensure-pathname
;; make a tarball, then add build/asdf.lisp to it base
(make-tarball-from-git name base files "tar") :want-absolute t :want-directory t
(let* ((tarball (strcat name ".tar"))) :want-existing t :truename t))
(with-asdf-dir ("build/") (destination
(when asdf-lisp (ensure-pathname
(build-asdf) name
(ensure-directories-exist (pn "build" name "build/")) :defaults *build-dir*
(run* `(cp -a asdf.lisp (,name /build/))) :want-relative t :ensure-absolute t
;; TODO: find which tar it is and tell --uid 0 --gid 0 to BSD tar :ensure-subpath t :ensure-directory t))
;; and --owner root --group root to GNU tar, (tarball
;; falling back to nothing. Sigh. (ensure-pathname
(run* `(env "COPYFILE_DISABLE=1" (tarname name)
tar "-rf" ,tarball (,name /build/asdf.lisp)) :show t) :defaults *build-dir*
(run* `(rm -f (,name /build/asdf.lisp))) :want-relative t :ensure-absolute t
(delete-empty-directory (pn "build" name "build/"))) :ensure-subpath t :want-file t
(when version-file :ensure-directories-exist t)))
(ensure-directories-exist (pn "build" name "")) (assert (< 6 (length (pathname-directory destination))))
(run* `(cp -a ../version.lisp-expr (,name /))) (when (probe-file* destination)
(run* `(env "COPYFILE_DISABLE=1" (error "Destination ~S already exists, not taking chances - you can delete it yourself."
tar "-rf" ,tarball (,name /version.lisp-expr)) :show t) destination))
(run* `(rm -f (,name /version.lisp-expr)))) (ensure-directories-exist destination)
(let ((dir (pn "build" name ""))) (run `(cp "-pHux" --parents ,@files ,destination) :directory base :show t)
(when (directory-exists-p dir) (delete-empty-directory dir))) (run `(tar "zcfC" ,tarball ,*build-dir*
(run* `(gzip -f9 ,tarball) :show t)))) ;; TODO: Have better autodetection for which tar is being used,
;; and fall back to no option if not recognized.
#+linux (* :owner root :group root) ;; assume GNU tar on Linux.
#+darwin (* :uid 0 :gid 0) ;; assume BSD tar on Darwin.
(,name /)) :show t)
(delete-directory-tree destination :validate #'(lambda (x) (equal x destination)))
(defun uiop-files () (defun uiop-files ()
"list files in uiop" "list files in uiop"
(list* "README" "uiop.asd" "asdf-driver.asd" (system-source-files :uiop))) (list* "" "uiop.asd" "asdf-driver.asd" (system-source-files "uiop")))
(defun driver-name () (defun uiop-name ()
(format nil "uiop-~A" *version*)) (format nil "uiop-~A" *version*))
(defun make-driver-tarball () (deftestcmd make-uiop-tarball ()
(make-tarball-from-git-plus (make-tarball-under-build (uiop-name) *uiop-dir* (uiop-files)))
(driver-name) "uiop/"
(remove "version.lisp-expr" (uiop-files) :test 'equal)
nil t))
(defun asdf-defsystem-files () (defun asdf-defsystem-files ()
"list files in asdf/defsystem" "list files in asdf/defsystem"
(list* "asdf.asd" "version.lisp-expr" "header.lisp" (list* "build/asdf.lisp" ;; for bootstrap purposes
(system-source-files :asdf/defsystem))) "asdf.asd" "version.lisp-expr" "header.lisp"
(system-source-files "asdf/defsystem")))
(defun asdf-defsystem-name () (defun asdf-defsystem-name ()
(format nil "asdf-defsystem-~A" *version*)) (format nil "asdf-defsystem-~A" *version*))
(defun make-asdf-defsystem-tarball () (deftestcmd make-asdf-defsystem-tarball ()
(make-tarball-from-git-plus (build-asdf)
(asdf-defsystem-name) "" (asdf-defsystem-files))) (make-tarball-under-build (asdf-defsystem-name) *asdf-dir* (asdf-defsystem-files)))
(defun asdf-git-name () (defun asdf-all-name ()
(strcat "asdf-" *version*)) (strcat "asdf-" *version*))
(defun asdf-all-files ()
(defun make-git-tarball () (remove-if #'(lambda (x) (string-prefix-p "ext/" x))
(make-tarball-from-git-plus (asdf-git-name) "" nil)) (with-asdf-dir () (run/lines '(git ls-files)))))
(deftestcmd make-asdf-all-tarball ()
(make-tarball-under-build (asdf-all-name) *asdf-dir* (asdf-all-files)))
(defun asdf-lisp-name () (defun asdf-lisp-name ()
(format nil "asdf-~A.lisp" *version*)) (format nil "asdf-~A.lisp" *version*))
(deftestcmd make-asdf-lisp () (deftestcmd make-asdf-lisp ()
(build-asdf) (build-asdf)
(concatenate-files (list (pn "build/asdf.lisp")) (concatenate-files (list (pn "build/asdf.lisp"))
...@@ -101,9 +106,9 @@ ...@@ -101,9 +106,9 @@
(deftestcmd make-archive () (deftestcmd make-archive ()
"build tarballs for release" "build tarballs for release"
(make-driver-tarball) (make-uiop-tarball)
(make-asdf-defsystem-tarball) (make-asdf-defsystem-tarball)
(make-git-tarball) (make-asdf-all-tarball)
(make-asdf-lisp)) (make-asdf-lisp))
Markdown is supported
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