Commit 8315d238 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

tools: improve git support and debian packaging.

parent 8772c1a3
......@@ -59,8 +59,7 @@ build_asdf build/asdf.lisp: force
# The text below was automaticaly generated by `make --silent makefile-targets`
# then manually inserted here to provide for completion:
.PHONY: archive build-asdf bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc extract extract-all-tagged-asdf extract-tagged-asdf fix-local-git-tags fix-remote-git-tags git-all-committed-p help install install-asdf link-archive load make-and-publish-archive make-archive makefile-targets merge-master-into-release publish-archive publish-debian-package push re show-commands t test test-all test-all-clean-load test-all-no-stop test-all-no-upgrade test-all-no-upgrade-no-stop test-all-scripts test-all-scripts-no-stop test-all-upgrade test-all-upgrade-no-stop test-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website
.PHONY: archive build-asdf bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc ext-clear ext-init ext-reset ext-update extract extract-all-tagged-asdf extract-tagged-asdf fix-local-git-tags fix-remote-git-tags git-all-committed-p help install install-asdf link-archive load make-and-publish-archive make-archive makefile-targets merge-master-into-release publish-archive publish-debian-package push re show-commands t test test-all test-all-clean-load test-all-no-stop test-all-no-upgrade test-all-no-upgrade-no-stop test-all-scripts test-all-scripts-no-stop test-all-upgrade test-all-upgrade-no-stop test-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website
archive build-asdf bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc extract extract-all-tagged-asdf extract-tagged-asdf fix-local-git-tags fix-remote-git-tags git-all-committed-p help install install-asdf link-archive load make-and-publish-archive make-archive makefile-targets merge-master-into-release publish-archive publish-debian-package push re show-commands t test test-all test-all-clean-load test-all-no-stop test-all-no-upgrade test-all-no-upgrade-no-stop test-all-scripts test-all-scripts-no-stop test-all-upgrade test-all-upgrade-no-stop test-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website: force
archive build-asdf bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc ext-clear ext-init ext-reset ext-update extract extract-all-tagged-asdf extract-tagged-asdf fix-local-git-tags fix-remote-git-tags git-all-committed-p help install install-asdf link-archive load make-and-publish-archive make-archive makefile-targets merge-master-into-release publish-archive publish-debian-package push re show-commands t test test-all test-all-clean-load test-all-no-stop test-all-no-upgrade test-all-no-upgrade-no-stop test-all-scripts test-all-scripts-no-stop test-all-upgrade test-all-upgrade-no-stop test-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website: force
${MAKE_SCRIPT} l='$l' L='$L' u='$u' U='$u' v='$v' s='$s' t='$t' $@
......@@ -48,4 +48,29 @@
(deftestcmd git-all-committed-p ()
"is your checkout clean, with all files committed?"
(null (nth-value 2 (git '(status -s) :output :lines))))
(let ((uncommitted (nth-value 2 (git '(status -s) :output :lines))))
(success-if (null uncommitted)
"git reports uncommitted files:~{~% ~A~}~%" uncommitted)))
(defun get-git-branch ()
"What is the current checked out branch?"
(match (first (nth-value 2 (git '(status) :output :lines)))
((ppcre "^# On branch (.*)$" x) x)))
(deftestcmd ext-init ()
"Populate the ext/ directory if not already populated.
Same as `make ext` in the bootstrap make script."
(git '(submodule update --init)))
(deftestcmd ext-clear ()
"Depopulate the ext/ directory.
Same as `make noext` in the bootstrap make script."
(git '(submodule deinit ".")))
(deftestcmd ext-reset ()
"Reset the ext/ directory to the contents specified by the current git checkout."
(git '(submodule update --init)))
(deftestcmd ext-update ()
"Update the ext/ directory to the latest version from remote repositories."
(git '(submodule update --remote)))
......@@ -45,6 +45,7 @@ The UNIX-y name will be downcased, and any % prefix will be dropped."
;; :when (and (eq x (find-command x)) (documentation x 'function)) :collect x)
'(build-asdf doc website wc ;; build
clean %push merge-master-into-release fix-local-git-tags fix-remote-git-tags ;; git
ext-init ext-clear ext-reset ext-update ;; extension
git-all-committed-p
bump-version bump ;; version
test-load-systems test-clean-load test-basic test-ascii %load install-asdf ;; test-basic
......
......@@ -150,18 +150,29 @@
(defalias archive make-and-publish-archive)
(defalias install make-and-publish-archive)
(defun get-debian-packager-keyid ()
(or (getenv "DEBSIGN_KEYID")
(error "Please export variable DEBSIGN_KEYID to be the 8-hex hash of your GnuPG secret key")))
;;; Making a debian package
(deftestcmd debian-package ((release "release"))
"build a debian package"
(let* ((debian-version (debian-version-from-file release))
(version (version-from-file release)))
(version (version-from-file release))
(has-ext-p (probe-file* (pn "ext/inferior-shell/inferior-shell.asd")))
(branch (get-git-branch))
(keyid (get-debian-packager-keyid)))
(unless (equal version (parse-debian-version debian-version))
(error "Debian version ~A doesn't match asdf version ~A" debian-version version))
(git-all-committed-p)
(clean)
(ext-clear)
(git '(checkout release))
(format t "building package version ~A~%" (debian-version-from-file))
(run* `(git-buildpackage
;; --git-ignore-new ;; for testing purpose
;; Override of the signing key, don't extract the name from the Changelog:
(--git-builder="debuild -k0x",keyid" -i -I")
(--git-debian-branch= ,release)
(--git-upstream-tag="%(version)s")
;;--git-upstream-tree=tag ;; if the changelog says 3.1.2, looks at that tag
......@@ -170,7 +181,10 @@
;; --git-no-pristine-tar
--git-force-create
--git-ignore-branch)
:directory (pn) :show t)))
:directory (pn) :show t)
(git `(checkout ,branch))
(when has-ext-p (ext-reset))
(success)))
(defun debian-architecture ()
(run/ss `(dpkg --print-architecture)))
......@@ -195,21 +209,20 @@
(when (nth-value 1 (run '(dpkg-parsechangelog) :output nil :error-output :lines))
(error "Malformed debian/changelog entry")))
scripts ;; TODO: needs to be passed as argument!
(and ;; need a better combinator, that tells us about progress, etc.
(git-all-committed-p)
(test-all-no-stop) ;; TODO: NEED ARGUMENTS!
(test-load-systems lisps systems)
(bump new-version)
(when releasep
(and
(debian-package)
(publish-debian-package)
(merge-master-into-release)))
;; SUCCESS! now publish more widely
(%push)
(archive)
(website)
(when releasep
(log! log t "Don't forget to send a debian mentors request!"))
(log! log "Don't forget to send announcement to asdf-announce, asdf-devel, etc.")
(log! log "Don't forget to move all fixed bugs from Fix Committed -> Fix Released on launchpad")))))
(git-all-committed-p)
(test-all-no-stop) ;; TODO: NEED ARGUMENTS!
(test-load-systems lisps systems)
(bump new-version)
(when releasep
(and
(debian-package)
(publish-debian-package)
(merge-master-into-release)))
;; SUCCESS! now publish more widely
(%push)
(archive)
(website)
(when releasep
(log! log t "Don't forget to send a debian mentors request!"))
(log! log "Don't forget to send announcement to asdf-announce, asdf-devel, etc.")
(log! log "Don't forget to move all fixed bugs from Fix Committed -> Fix Released on launchpad"))))
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