From 1c0e339fdbd973e66680353f837dea9db8e2b5f0 Mon Sep 17 00:00:00 2001 From: Raul Infante-Sainz Date: Wed, 27 May 2020 12:00:50 +0100 Subject: TeX installation crash because of different tarball versions fixed Until this commit, when the user have previous TeX tarball already present, the project crashed when trying to re-configure, if there was a newer version of TeX. This is because TeX are updated yearly. With this commit, this bug has been fixed. Now, during the installation of TeX, it checks if this problem happens. If this is the case, then it moves the old tarball, download the new one and install it. If not, it will just install the already present tarball or crash because of any other reason. This probem was recurrent, and each time TeX was updated, the previous tarball had to be removed manually. But now, with this commit, it is done automatically. The detection and fix of this bug has been possible with the help of Mohammad Akhlaghi, thanks! --- reproduce/software/make/high-level.mk | 60 +++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) (limited to 'reproduce/software') 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 -- cgit v1.2.1