From fc29adfb894e68ad9fc1b4c60815938048534f9b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 8 Sep 2021 16:59:02 +0930 Subject: [PATCH] web: create "versioned" tarballs. Fixes: https://github.com/rustyrussell/ccan/issues/90 Signed-off-by: Rusty Russell --- Makefile-web | 10 +++++++--- web/staticall.php | 6 +++--- web/staticindex.php | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile-web b/Makefile-web index 29ca254e..ae388c0c 100644 --- a/Makefile-web +++ b/Makefile-web @@ -18,6 +18,7 @@ JUNKPAGES=$(JUNKDIRS:%=$(WEBDIR)/%.html) JUNKBALLS=$(JUNKDIRS:%=$(WEBDIR)/%.tar.bz2) PRETTIFY=$(WEBDIR)/prettify/src/run_prettify.js $(WEBDIR)/prettify/src/prettify.css +VERSION_NUM := $(shell git describe | cut -d- -f2) clean-tree: [ "$(WEBDEV)" ] || ! git status --porcelain | grep . @@ -40,14 +41,17 @@ $(WEBDIR)/junkcode/%.html: $(WEBDIR)/junkcode/%.tar.bz2 cd $(WEBDIR) && tar xfj junkcode/$*.tar.bz2 URLPREFIX=../ $(PHP) web/staticjunkcode.php junkcode/$* $* > $@ +$(WEBDIR)/ccan.tar.bz2: $(WEBDIR)/ccan-$(VERSION_NUM).tar.bz2 + ln -sf ccan-$(VERSION_NUM).tar.bz2 ccan.tar.bz2 + # We want tarball to contain ccan/; we put junkcode in, but don't depend on it. -$(WEBDIR)/ccan.tar.bz2: config.h Makefile $(shell git ls-files ccan tools licenses) +$(WEBDIR)/ccan-$(VERSION_NUM).tar.bz2: config.h Makefile $(shell git ls-files ccan tools licenses) DIR=`pwd` && cd /tmp && ln -sf "$$DIR" ccan && tar cvfj $@ `for f in $^; do echo ccan/$$f; done` ccan/junkcode && rm ccan $(ALL_PAGES): tools/doc_extract web/staticmoduleinfo.php $(WEBDIR)/list.html: web/staticall.php tools/doc_extract $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(JUNKBALLS) - $(PHP) web/staticall.php ccan/ junkcode/ $(WEBDIR) $(MODS) > $@ + $(PHP) web/staticall.php ccan/ junkcode/ $(WEBDIR) ccan-$(VERSION_NUM).tar.bz2 $(MODS) > $@ $(WEBDIR)/upload.html: web/staticupload.php $(PHP) web/staticupload.php > $@ @@ -57,7 +61,7 @@ $(WEBDIR)/uploader.php: web/uploader.php.cpp cpp -w -C -P $< | grep . > $@ $(WEBDIR)/index.html: web/staticindex.php - $(PHP) web/staticindex.php > $@ + $(PHP) web/staticindex.php ccan-$(VERSION_NUM).tar.bz2 > $@ $(WEBDIR)/example-config.h: config.h cp $< $@ diff --git a/web/staticall.php b/web/staticall.php index 3e9d445a..c82a8bdb 100644 --- a/web/staticall.php +++ b/web/staticall.php @@ -4,7 +4,7 @@ include('logo.html'); include('menulist.html'); include('static-configuration'); -$tarballsize=round((filesize($argv[3]."/ccan.tar.bz2") + 1023) / 1024); +$tarballsize=round((filesize($argv[3]."/".$argv[4]) + 1023) / 1024); ?>

List of all CCAN modules:

@@ -16,7 +16,7 @@ download.

-Or you can just download the tarball of everything including CCAN tools (K). +Or you can just download the tarball of everything including CCAN tools (K).

@@ -25,7 +25,7 @@ Or you can just download the tarball of everything includ Get The Code

You can get each module as a tarball (see -list), get a tarball of the whole repository with tools, +list), get a tarball of the whole repository with tools, or clone our git repository (git clone git://git.ozlabs.org/~ccan/ccan) or the one on github.

-- 2.39.2
Download