aboutsummaryrefslogtreecommitdiff
path: root/reproduce
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce')
-rw-r--r--reproduce/software/make/high-level.mk60
1 files changed, 58 insertions, 2 deletions
diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk
index ffab19c..4480e19 100644
--- a/reproduce/software/make/high-level.mk
+++ b/reproduce/software/make/high-level.mk
@@ -1228,6 +1228,17 @@ $(ibidir)/xlsxio: $(ibidir)/cmake \
# the final PDF). So we'll make a simple ASCII file called
# `texlive-ready-tlmgr' and use its contents to mark if we can use it or
# not.
+# TeX tarball are updated yearly, and because of that, it may crash when trying
+# to re-configure the project. As an example: an already present TeX tarball of
+# year 2019 and try to re-configure the project when the official version is of
+# the year 2020. In that case the installation will do the following:
+#
+# - Install the 2019 (but the official version is 2020!), so it will complain
+# about that, and the error will be saved into a log file.
+# - Check if the error mesage correspond to this problem.
+# - If yes, it will move the old tarball, and download and install the new one.
+# - If not, it will complain about not being able to install it (for any other
+# reason).
# TeX Live mirror
# ---------------
@@ -1257,7 +1268,11 @@ $(itidir)/texlive-ready-tlmgr: reproduce/software/config/texlive.conf \
# TeX Live's installation may fail due to any reason. But TeX Live
# is optional (only necessary for building the final PDF). So we
# don't want the configure script to fail if it can't run.
- if ./install-tl --profile=texlive.conf -repository $(tlmirror); then
+ # Possible error messages will be saved into `log.tx'. After that, this
+ # file will be checked to see if the error during the installation is
+ # due to the different version of the current tarball while it expects
+ # to have a newer version.
+ if ./install-tl --profile=texlive.conf -repository $(tlmirror) 2> log.txt; then
# Put a symbolic link of the TeX Live executables in `ibdir' to
# avoid all the complexities of its sub-directories and additions
@@ -1266,8 +1281,49 @@ $(itidir)/texlive-ready-tlmgr: reproduce/software/config/texlive.conf \
# Register that the build was successful.
echo "TeX Live is ready." > $@
+
else
- echo "NOT!" > $@
+ # Print on the command line the error messages during the installation
+ cat log.txt
+
+ # Look for words `repository:' and `local:' in `log.txt'
+ version_check=$$(grep -w 'repository:\|local:' log.txt)
+
+ # If these words exists, then there is a conflict with tarball
+ # versions. So it is necessary to move the old tarball and download
+ # the new one to install it.
+ if [ x"$$version_check" != x ]; then
+ cd $$topdir
+
+ # Don't remove the tarball, just rename it
+ mv $(tdir)/install-tl-unx.tar.gz $(tdir)/install-tl-unx-OLD.tar.gz
+
+ # Download using the script specially defined for this job.
+ tarballurl=http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
+ touch $(lockdir)/download
+ downloader="wget --no-use-server-timestamps -O"
+ if $(downloadwrapper) "$$downloader" $(lockdir)/download \
+ $$tarballurl "$(tdir)/install-tl-unx.tar.gz" \
+ "$(backupservers)"; then
+ # If the download of new tarball success, install it (same lines
+ # than above). If not, record the fail into the target.
+ cd $(ddir)
+ rm -rf install-tl-*
+ tar xf $(tdir)/install-tl-unx.tar.gz
+ cd install-tl-*
+ sed -e's|@installdir[@]|$(idir)|g' \
+ $$topdir/reproduce/software/config/texlive.conf \
+ > texlive.conf
+ if ./install-tl --profile=texlive.conf -repository $(tlmirror); then
+ ln -fs $(idir)/texlive/maneage/bin/*/* $(ibdir)/
+ echo "TeX Live is ready." > $@
+ else
+ echo "NOT!" > $@
+ fi
+ else
+ echo "NOT!" > $@
+ fi
+ fi
fi
# Clean up