From 38a6b4968d660fbfb95c02c80dc5ed187d9e93cb Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Tue, 1 Aug 2017 19:20:15 +0200 Subject: [PATCH] Improve bundle building. Now when building a bundle file for source distribution of pgloader, always test it by building a binary image from the bundle tarball in a test directory. Also make it easy to target "latest" Quicklisp distribution with the following spelling: make BUNDLEDIST=latest bundle --- Makefile | 18 ++++++++++++++---- bundle/ql.lisp | 6 ++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f0a29ce..183808e 100644 --- a/Makefile +++ b/Makefile @@ -21,9 +21,12 @@ LIBS = $(BUILDDIR)/libs.stamp QLDIR = $(BUILDDIR)/quicklisp MANIFEST = $(BUILDDIR)/manifest.ql LATEST = $(BUILDDIR)/pgloader-latest.tgz + +BUNDLEDIST = 2017-04-03 BUNDLENAME = pgloader-bundle-$(VERSION) BUNDLEDIR = $(BUILDDIR)/bundle/$(BUNDLENAME) BUNDLE = $(BUILDDIR)/$(BUNDLENAME).tgz +BUNDLETESTD= $(BUILDDIR)/bundle/test ifeq ($(OS),Windows_NT) EXE = .exe @@ -164,12 +167,16 @@ test: $(PGLOADER) clean-bundle: rm -rf $(BUNDLEDIR) + rm -rf $(BUNDLETESTD)/$(BUNDLENAME)/* + +$(BUNDLETESTD): + mkdir -p $@ $(BUNDLEDIR): mkdir -p $@ $(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \ --eval '(defvar *bundle-dir* "$@")' \ - --eval '(defvar *ql-dist* "2017-04-03")' \ + --eval '(defvar *ql-dist* "$(BUNDLEDIST)")' \ --load bundle/ql.lisp $(BUNDLE): $(BUNDLEDIR) @@ -181,9 +188,12 @@ $(BUNDLE): $(BUNDLEDIR) tar -C build/bundle \ --exclude bin \ --exclude test/sqlite \ - -czf $@ pgloader-bundle-$(VERSION) + -czf $@ $(BUNDLENAME) -bundle: $(BUNDLE) +bundle: clean-bundle $(BUNDLE) $(BUNDLETESTD) + tar -C $(BUNDLETESTD) -xf $(BUNDLE) + make -C $(BUNDLETESTD)/$(BUNDLENAME) + $(BUNDLETESTD)/$(BUNDLENAME)/bin/pgloader --version test-bundle: $(MAKE) -C $(BUNDLEDIR) test @@ -231,4 +241,4 @@ latest: check: test ; -.PHONY: test pgloader-standalone docs +.PHONY: test pgloader-standalone docs bundle diff --git a/bundle/ql.lisp b/bundle/ql.lisp index df84e4d..26e0138 100644 --- a/bundle/ql.lisp +++ b/bundle/ql.lisp @@ -12,9 +12,11 @@ (defvar *ql-dist-url-format* "http://beta.quicklisp.org/dist/quicklisp/~a/distinfo.txt") -(let ((dist (if (eq :latest *ql-dist*) +(let ((dist (if (or (eq :latest *ql-dist*) + (string= "latest" *ql-dist*)) (cdr - ;; available-versions is an alist of (date . url) + ;; available-versions is an alist of (date . url), and the + ;; first one is the most recent one (first (ql-dist:available-versions (ql-dist:dist "quicklisp")))) (format nil *ql-dist-url-format* *ql-dist*))))