diff options
Diffstat (limited to 'reproduce/analysis/make')
-rw-r--r-- | reproduce/analysis/make/download.mk | 2 | ||||
-rw-r--r-- | reproduce/analysis/make/initialize.mk | 65 | ||||
-rw-r--r-- | reproduce/analysis/make/paper.mk | 8 | ||||
-rw-r--r-- | reproduce/analysis/make/verify.mk | 4 |
4 files changed, 59 insertions, 20 deletions
diff --git a/reproduce/analysis/make/download.mk b/reproduce/analysis/make/download.mk index d5f8cef..fb3f21e 100644 --- a/reproduce/analysis/make/download.mk +++ b/reproduce/analysis/make/download.mk @@ -84,9 +84,11 @@ $(inputdatasets): $(indir)/%: | $(indir) $(lockdir) sum=$$(md5sum $$unchecked | awk '{print $$1}') if [ $$sum = $$mdf ]; then mv $$unchecked $@ + echo "Integrity confirmed, using $@ in this project." else echo; echo; echo "Wrong MD5 checksum for input file '$$localname':" + echo " File location: $$unchecked"; \ echo " Expected MD5 checksum: $$mdf"; \ echo " Calculated MD5 checksum: $$sum"; \ echo; exit 1 diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index 6b25f02..fbd110f 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -302,27 +302,47 @@ $(project-package-contents): paper.pdf | $(texdir) sed -e's|\\newcommand{\\makepdf}{}|%\\newcommand{\\makepdf}{}|' \ paper.tex > $$dir/paper.tex - # Build the top-level directories. - mkdir $$dir/reproduce $$dir/tex $$dir/tex/tikz $$dir/tex/build - - # Copy all the necessary `reproduce' and `tex' contents. + # Copy ONLY the version-controlled files in 'reproduce' and + # 'tex/src'. This is important because files like 'LOCAL.conf' (in + # 'reproduce/software/config') should not be archived, they contain + # information about the host computer and are irrelevant for + # others. Also some project authors may have temporary files here + # that are not under version control and thus shouldn't be archived + # (although this is bad practice, but that is up to the user). + # + # To keep the sub-directory structure, we are packaging the files + # with Tar, piping it, and unpacking it in the archive + # directory. So afterwards we need to come back to the current + # directory. + tar -c -f - $$(git ls-files reproduce tex/src) \ + | (cd $$dir ; tar -x -f -) + cd $(curdir) + + # Build the other two subdirectories of 'tex/' that we need in the + # archive (in the actual project, these are symbolic links to the + # build directory). + mkdir $$dir/tex/tikz $$dir/tex/build + + # Copy the 'tex/build' directory into the archive (excluding the + # temporary archive directory that we are now copying to). We will + # be using Bash's extended globbing ('extglob') for excluding this + # directory. shopt -s extglob - cp -r tex/src $$dir/tex/src - cp -r tex/img $$dir/tex/img - cp tex/tikz/*.eps $$dir/tex/tikz - cp -r reproduce/* $$dir/reproduce + cp -r tex/img $$dir/tex/img + cp tex/tikz/*.eps $$dir/tex/tikz cp -r tex/build/!($(project-package-name)) $$dir/tex/build - # Clean up un-necessary/local files: 1) the $(texdir)/build* - # directories (when building in a group structure, there will be - # `build-user1', `build-user2' and etc), are just temporary LaTeX - # build files and don't have any relevant/hand-written files in - # them. 2) The `LOCAL.conf' and `gnuastro-local.conf' files just - # have this machine's local settings and are irrelevant for anyone - # else. + # Clean up the $(texdir)/build* directories in the archive (when + # building in a group structure, there will be `build-user1', + # `build-user2' and etc). These are just temporary LaTeX build + # files and don't have any relevant/hand-written files in them. rm -rf $$dir/tex/build/build* - rm $$dir/reproduce/software/config/LOCAL.conf - rm $$dir/reproduce/analysis/config/gnuastro/gnuastro-local.conf + + # If the project has any PDFs in its 'tex/tikz' directory (TiKZ or + # PGFPlots was used to generate them), copy them too. + if ls tex/tikz/*.pdf &> /dev/null; then + cp tex/tikz/*.pdf $$dir/tex/tikz + fi # When submitting to places like arXiv, they will just run LaTeX # once and won't run `biber'. So we need to also keep the `.bbl' @@ -474,3 +494,14 @@ $(mtexdir)/initialize.tex: | $(mtexdir) # Zenodo identifier (necessary for download link): v=$$(echo $(metadata-doi-zenodo) | sed -e's/\./ /g' | awk '{print $$NF}') echo "\newcommand{\projectzenodoid}{$$v}" >> $@ + + # Calculate the latest Maneage commit used to build this + # project: + # - The '--dirty' option (used in 'project-commit-hash') isn't + # applicable to "commit-ishes" (direct quote from Git's error + # message!). + # - The project may not have the 'maneage' branch (for example + # after cloning from a fork that didn't include it!). In this + # case, we'll just return the string a clear string. + v=$$(git describe --always --long maneage) || v=maneage-ref-missing + echo "\newcommand{\maneageversion}{$$v}" >> $@ diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk index 90d71c1..2c08847 100644 --- a/reproduce/analysis/make/paper.mk +++ b/reproduce/analysis/make/paper.mk @@ -115,7 +115,13 @@ $(texbdir)/paper.bbl: tex/src/references.tex $(mtexdir)/dependencies-bib.tex \ export TEXINPUTS=$$p: cd $(texbdir); - # Note: the option '-shell-escape' is "normally disallowed for + # Delete any possibly existing target (a '.bbl' file) to avoid + # complications with LaTeX being run before the command that + # generates it. Otherwise users will have to manually delete + # it. It will be built anyway once this rule is done. + rm -f $@ + + # The pdflatex option '-shell-escape' is "normally disallowed for # security reasons" according to the `info pdflatex' manual, but # is enabled here in order to allow the use of PGFPlots. If you # do not use PGFPlots, then you should remove the `-shell-escape' diff --git a/reproduce/analysis/make/verify.mk b/reproduce/analysis/make/verify.mk index dd224d6..fe828dd 100644 --- a/reproduce/analysis/make/verify.mk +++ b/reproduce/analysis/make/verify.mk @@ -22,7 +22,7 @@ # Verification functions # ---------------------- # -# These functions are used by the final rule in this Makefil +# These functions are used by the final rule in this Makefile verify-print-error-start = \ echo; \ echo "VERIFICATION ERROR"; \ @@ -87,7 +87,7 @@ verify-txt-no-comments-no-space = \ # ------------------------------------------- # # This is the FINAL analysis step (before going onto the paper. Please use -# this step to veryify the contents of the figures/tables used in the paper +# this step to verify the contents of the figures/tables used in the paper # and the LaTeX macros generated from all your processing. It should depend # on all the LaTeX macro files that are generated (their contents will be # checked), and any files that go into the tables/figures of the paper |