diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 9b865c022..12fb8012b 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -63,6 +63,4 @@ Therefore: * If a series of changes are being made or several pull requests are being merged at once, the PDF updates can be batched up and just made once at the end. * Conversely, if there are changes pending to several (even unrelated) PDFs, there is no reason not to commit them all at once. -If you are working on several PDFs at once, be careful in step 3 and perhaps use `make clean new/VCFv4.2.pdf new/VCFv4.3.pdf; make VCFv4.2.pdf VCFv4.3.pdf` to ensure that spurious “-dirty” commit hashes don't make their way into your PDFs. - diff --git a/Makefile b/Makefile index a5a06bdae..fc24e4b71 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,12 @@ new/%.pdf: %.tex pdflatex --output-directory new $< while grep -q 'Rerun to get [a-z-]* right' new/$*.log; do pdflatex --output-directory new $< || exit; done +new/CRAMv2.1.ver new/CRAMv3.ver: img/CRAMFileFormat2-1-fig001.png img/CRAMFileFormat2-1-fig002.png img/CRAMFileFormat2-1-fig003.png img/CRAMFileFormat2-1-fig004.png img/CRAMFileFormat2-1-fig005.png img/CRAMFileFormat2-1-fig006.png img/CRAMFileFormat2-1-fig007.png + +new/VCFv4.1.ver new/VCFv4.2.ver new/VCFv4.3.ver: img/all_orientations-400x296.png img/derivation-400x267.png img/erosion-400x211.png img/inserted_contig-400x247.png img/inserted_sequence-400x189.png img/inversion-400x95.png img/microhomology-400x248.png img/multiple_mates-400x280.png img/phasing-400x259.png img/reciprocal_rearrangement-400x192.png img/telomere-400x251.png + new/%.ver: %.tex - echo "@newcommand*@commitdesc{`git describe --always --dirty`}@newcommand*@headdate{`git rev-list -n1 --format=%aD HEAD $< | sed '1d;s/.*, *//;s/ *[0-9]*:.*//'`}" | tr @ \\ > $@ + ./genversion.sh $^ > $@ mostlyclean: diff --git a/_config.yml b/_config.yml index fccf7e4b0..8f191b38f 100644 --- a/_config.yml +++ b/_config.yml @@ -7,7 +7,7 @@ description: > baseurl: "/hts-specs" url: "http://samtools.github.io" github_username: samtools -exclude: ["*.tex", img, new, Makefile, MAINTAINERS.md, README.md] +exclude: ["*.sh", "*.tex", img, new, Makefile, MAINTAINERS.md, README.md] # Build settings markdown: kramdown diff --git a/genversion.sh b/genversion.sh new file mode 100755 index 000000000..e7527da14 --- /dev/null +++ b/genversion.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Add "-dirty" only if any of *this* PDF's source files is dirty +test -n "$(git status --porcelain "$@")" && dirty=-dirty + +git rev-list -n1 --format='date %cD' HEAD -- "$@" | while read key value +do + case $key in + commit) + value=$(git describe --always $value) + echo "@newcommand*@commitdesc{$value$dirty}" + ;; + date) + # Cut unwanted fields from "[Day, ]DD Mon YYYY[ HH:MM:SS +ZZZZ]" + value=$(echo $value | sed 's/.*, *//;s/ *[0-9]*:.*//') + echo "@newcommand*@headdate{$value}" + ;; + esac +done | tr @ \\