From b910b2e493972db368874752ac033ab7c41696dd Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 14 Dec 2020 02:14:34 +0000 Subject: Better warnings when maneage branch not present and PDF not built Until now, there was no warning when the 'maneage' branch didn't exist in the Git history. This can happen when you forget to push the 'maneage' branch to a remote for your project, and you later clone your project from that remote (for example on another computer). We use the 'maneage' branch to report the latest commit hash and date in the final paper (which can greatly help future readers). Since we check the 'maneage' branch on every run of './project make' (in 'initialize.mk') this would result in a printed statement like this: fatal: Not a valid object name maneage Also until now, the description of what to do when TeXLive wasn't installed properly wasn't complete: it didn't mention that it is necessary to delete the TeXLive target files. This could confuse users (they would re-run './project configure -e', but with no effect). With this commit, for the 'maneage' branch issue a complete warning will be printed. Telling the user what to do to get the 'maneage' branch (and thus fix this warning). Also, the LaTeX macros that go in the paper are now red when the 'maneage' branch doesn't exist, telling the user to see the printed warning (thus encouraging the user to get the branch). For the TeXLive issue, the necessary commands to run are now also printed in the warning. --- reproduce/analysis/make/initialize.mk | 28 +++++++++++++++++++++++----- reproduce/analysis/make/paper.mk | 15 ++++++++------- 2 files changed, 31 insertions(+), 12 deletions(-) (limited to 'reproduce/analysis') diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index 3649fd2..ce0ac95 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -489,13 +489,31 @@ $(mtexdir)/initialize.tex: | $(mtexdir) # Calculate the latest Maneage commit used to build this # project: + # - 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 print a descriptive warning, telling the user what + # should be done (reporting the last merged commit and its date + # is very useful for the future). # - 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 - d=$$(git show -s --format=%aD $$v | awk '{print $$2, $$3, $$4}') + if git log maneage -1 &> /dev/null; then + c=$$(git merge-base HEAD maneage) + v=$$(git describe --always --long $$c) + d=$$(git show -s --format=%aD $$v | awk '{print $$2, $$3, $$4}') + else + echo + echo "WARNING: no 'maneage' branch found! Without it, the latest merge of " + echo "this project with Maneage can't be reported in the paper (which is bad " + echo "for your readers; that includes yourself in a few years). Please run " + echo "the commands below to fetch the 'maneage' branch from its own server " + echo "and remove this warning (these commands will not affect your project):" + echo " $ git remote add origin-maneage http://git.maneage.org/project.git" + echo " $ git fetch origin-maneage" + echo " $ git branch maneage --track origin-maneage/maneage" + echo + v="\textcolor{red}{NO-MANEAGE-BRANCH (see printed warning to fix this)}" + d="\textcolor{red}{NO-MANEAGE-DATE}" + fi echo "\newcommand{\maneagedate}{$$d}" >> $@ echo "\newcommand{\maneageversion}{$$v}" >> $@ diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk index fc10699..2d8a0c9 100644 --- a/reproduce/analysis/make/paper.mk +++ b/reproduce/analysis/make/paper.mk @@ -72,14 +72,15 @@ $(mtexdir)/project.tex: $(mtexdir)/verify.tex echo "LaTeX-built PDF paper will not be built." echo if [ x$(more-on-building-pdf) = x1 ]; then - echo "To build the PDF, make sure you have LaTeX within the " - echo "project (you can check by running " - echo "'./.local/bin/latex --version'), _AND_ make sure that " - echo "the 'pdf-build-final' variable has a value of 'yes', it " - echo "is defined in: 'reproduce/analysis/config/pdf-build.conf'." + echo "To build the PDF, make sure that the 'pdf-build-final' " + echo "variable has a value of 'yes' (it is defined in this file)" + echo " reproduce/analysis/config/pdf-build.conf" echo - echo "If you don't have LaTeX within the project, please re-run" - echo "'./project configure -e' when you have internet access." + echo "If you still see this message, there was a problem with " + echo "building LaTeX within the project. You can re-try building" + echo "it when you have internet access with the two commands below:" + echo " $ rm .local/version-info/tex/texlive*" + echo " $./project configure -e" else echo "For more, run './project make more-on-building-pdf=1'" fi -- cgit v1.2.1 From ff43476c4d293fda8765cfddbb1378f1b910218c Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sat, 2 Jan 2021 15:52:31 +0000 Subject: Copyright year updated in all source files Having entered 2021, it was necessary to update the copyright years at the top of the source files. We recommend that you do this for all your project-specific source files also. --- reproduce/analysis/bash/download-multi-try | 2 +- reproduce/analysis/config/INPUTS.conf | 2 +- reproduce/analysis/config/delete-me-squared-num.conf | 2 +- reproduce/analysis/config/metadata.conf | 2 +- reproduce/analysis/config/pdf-build.conf | 2 +- reproduce/analysis/config/verify-outputs.conf | 2 +- reproduce/analysis/make/delete-me.mk | 2 +- reproduce/analysis/make/download.mk | 2 +- reproduce/analysis/make/initialize.mk | 2 +- reproduce/analysis/make/paper.mk | 2 +- reproduce/analysis/make/prepare.mk | 2 +- reproduce/analysis/make/top-make.mk | 2 +- reproduce/analysis/make/top-prepare.mk | 2 +- reproduce/analysis/make/verify.mk | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) (limited to 'reproduce/analysis') diff --git a/reproduce/analysis/bash/download-multi-try b/reproduce/analysis/bash/download-multi-try index e4ccd26..76eb859 100755 --- a/reproduce/analysis/bash/download-multi-try +++ b/reproduce/analysis/bash/download-multi-try @@ -26,7 +26,7 @@ # reason, you don't want to use a lock file, set the `lockfile' name to # `nolock'. # -# Copyright (C) 2019-2020 Mohammad Akhlaghi +# Copyright (C) 2019-2021 Mohammad Akhlaghi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/reproduce/analysis/config/INPUTS.conf b/reproduce/analysis/config/INPUTS.conf index 60abd49..b969945 100644 --- a/reproduce/analysis/config/INPUTS.conf +++ b/reproduce/analysis/config/INPUTS.conf @@ -36,7 +36,7 @@ # (including the file-name) that can be used to download the dataset # when necessary. Also, see the description above on local filename. # -# Copyright (C) 2018-2020 Mohammad Akhlaghi +# Copyright (C) 2018-2021 Mohammad Akhlaghi # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice and diff --git a/reproduce/analysis/config/delete-me-squared-num.conf b/reproduce/analysis/config/delete-me-squared-num.conf index c86f841..13068e4 100644 --- a/reproduce/analysis/config/delete-me-squared-num.conf +++ b/reproduce/analysis/config/delete-me-squared-num.conf @@ -1,6 +1,6 @@ # Number of samples in the demonstration analysis (to be deleted). # -# Copyright (C) 2019-2020 Mohammad Akhlaghi +# Copyright (C) 2019-2021 Mohammad Akhlaghi # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice and diff --git a/reproduce/analysis/config/metadata.conf b/reproduce/analysis/config/metadata.conf index 533d927..e92a057 100644 --- a/reproduce/analysis/config/metadata.conf +++ b/reproduce/analysis/config/metadata.conf @@ -2,7 +2,7 @@ # final paper. Please set the values here and use them in your analysis or # paper, don't repeat them # -# Copyright (C) 2020 Mohammad Akhlaghi +# Copyright (C) 2020-2021 Mohammad Akhlaghi # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice and diff --git a/reproduce/analysis/config/pdf-build.conf b/reproduce/analysis/config/pdf-build.conf index 48585b4..015bf2e 100644 --- a/reproduce/analysis/config/pdf-build.conf +++ b/reproduce/analysis/config/pdf-build.conf @@ -12,7 +12,7 @@ # LaTeX. Otherwise, a notice will just printed that, no PDF will be # created. # -# Copyright (C) 2018-2020 Mohammad Akhlaghi +# Copyright (C) 2018-2021 Mohammad Akhlaghi # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice and diff --git a/reproduce/analysis/config/verify-outputs.conf b/reproduce/analysis/config/verify-outputs.conf index c9287e8..d96f293 100644 --- a/reproduce/analysis/config/verify-outputs.conf +++ b/reproduce/analysis/config/verify-outputs.conf @@ -1,6 +1,6 @@ # To enable verification of output datasets set this variable to 'yes'. # -# Copyright (C) 2019-2020 Mohammad Akhlaghi +# Copyright (C) 2019-2021 Mohammad Akhlaghi # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice and diff --git a/reproduce/analysis/make/delete-me.mk b/reproduce/analysis/make/delete-me.mk index bc94bf1..f275051 100644 --- a/reproduce/analysis/make/delete-me.mk +++ b/reproduce/analysis/make/delete-me.mk @@ -1,6 +1,6 @@ # Dummy Makefile to create a random dataset for plotting. # -# Copyright (C) 2018-2020 Mohammad Akhlaghi +# Copyright (C) 2018-2021 Mohammad Akhlaghi # # This Makefile is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/reproduce/analysis/make/download.mk b/reproduce/analysis/make/download.mk index 0eb28ff..0ea3432 100644 --- a/reproduce/analysis/make/download.mk +++ b/reproduce/analysis/make/download.mk @@ -5,7 +5,7 @@ # recipes in this Makefile all use a single file lock to have one download # script running at every instant. # -# Copyright (C) 2018-2020 Mohammad Akhlaghi +# Copyright (C) 2018-2021 Mohammad Akhlaghi # # This Makefile is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index ce0ac95..6e17877 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -1,6 +1,6 @@ # Project initialization. # -# Copyright (C) 2018-2020 Mohammad Akhlaghi +# Copyright (C) 2018-2021 Mohammad Akhlaghi # # This Makefile is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/reproduce/analysis/make/paper.mk b/reproduce/analysis/make/paper.mk index 2d8a0c9..b5b5b29 100644 --- a/reproduce/analysis/make/paper.mk +++ b/reproduce/analysis/make/paper.mk @@ -1,6 +1,6 @@ # Build the final PDF paper/report. # -# Copyright (C) 2018-2020 Mohammad Akhlaghi +# Copyright (C) 2018-2021 Mohammad Akhlaghi # # This Makefile is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/reproduce/analysis/make/prepare.mk b/reproduce/analysis/make/prepare.mk index 0391956..995132c 100644 --- a/reproduce/analysis/make/prepare.mk +++ b/reproduce/analysis/make/prepare.mk @@ -1,6 +1,6 @@ # Basic preparations, called by `./project prepare'. # -# Copyright (C) 2019-2020 Mohammad Akhlaghi +# Copyright (C) 2019-2021 Mohammad Akhlaghi # # This Makefile is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/reproduce/analysis/make/top-make.mk b/reproduce/analysis/make/top-make.mk index 140b026..026220e 100644 --- a/reproduce/analysis/make/top-make.mk +++ b/reproduce/analysis/make/top-make.mk @@ -1,6 +1,6 @@ # Top-level Makefile (first to be loaded). # -# Copyright (C) 2018-2020 Mohammad Akhlaghi +# Copyright (C) 2018-2021 Mohammad Akhlaghi # # This Makefile is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/reproduce/analysis/make/top-prepare.mk b/reproduce/analysis/make/top-prepare.mk index 0f4f124..f81ac07 100644 --- a/reproduce/analysis/make/top-prepare.mk +++ b/reproduce/analysis/make/top-prepare.mk @@ -4,7 +4,7 @@ # are not included here. Please see that file for thorough comments on each # step. # -# Copyright (C) 2019-2020 Mohammad Akhlaghi +# Copyright (C) 2019-2021 Mohammad Akhlaghi # # This Makefile is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/reproduce/analysis/make/verify.mk b/reproduce/analysis/make/verify.mk index fc76b96..7e16add 100644 --- a/reproduce/analysis/make/verify.mk +++ b/reproduce/analysis/make/verify.mk @@ -1,6 +1,6 @@ # Verify the project outputs before building the paper. # -# Copyright (C) 2020 Mohammad Akhlaghi +# Copyright (C) 2020-2021 Mohammad Akhlaghi # # This Makefile is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.1 From b1bd282bc3bcd11573fc064edfbab1bd65564348 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sat, 2 Jan 2021 15:59:49 +0000 Subject: ./project make: new texclean target Until now there was only a 'clean' (to delete all files created during the 'make' phase) and the 'distclean' (to delete all files during configuration and make). But sometimes we don't want to delete all the files created during the full 'make' phase, we only want to delete the files that were created by LaTeX for building the paper. Witht this commit, a new target has been added for this job. You can now run the following command for this job: ./project make texclean Only the files in '$(BDIR)/tex/build' will be deleted (and the 'tikz' directory under that location is recreated, ready for a future build). --- reproduce/analysis/make/initialize.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'reproduce/analysis') diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index 6e17877..a5d5b92 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -219,13 +219,18 @@ project-package-contents = $(texdir)/$(project-package-name) # we want to ensure that the file is always built in every run: it contains # the project version which may change between two separate runs, even when # no file actually differs. -.PHONY: all clean dist dist-zip dist-lzip distclean clean-mmap \ +.PHONY: all clean dist dist-zip dist-lzip texclean distclean clean-mmap \ $(project-package-contents) $(mtexdir)/initialize.tex # --------- Delete for no Gnuastro --------- clean-mmap:; rm -f reproduce/config/gnuastro/mmap* # ------------------------------------------ +texclean: + rm *.pdf + rm -rf $(BDIR)/tex/build/* + mkdir $(BDIR)/tex/build/tikz # 'tikz' is assumed to already exist. + clean: clean-mmap # Delete the top-level PDF file. rm -f *.pdf -- cgit v1.2.1