Skip to content

Instantly share code, notes, and snippets.

@fcolista fcolista/fix-texlive.sh
Last active Aug 23, 2017

Embed
What would you like to do?
AlpineLinux: Fix LaTex
#!/bin/sh
#
# Simple script used to get the latest laTeX package working with Alpine
# It assumes that testing repository is already added.
# If not:
# echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && apk update
#
# (c) 2017 Francesco Colista
# Email: fcolista@alpinelinux.org
#
TMP="/tmp/tlxmgr-install"
URL="ftp://ftp.tug.org/historic/systems/texlive/$(date +%Y)/"
apk info -qe texlive-full || apk add texlive-full
apk info -qe curl || apk add curl
mkdir -p $TMP && cd $TMP
curl -s $URL > /dev/null
if [ $? -ne "0" ]; then
URL="ftp://ftp.tug.org/historic/systems/texlive/$(date --date '-1 year' +%Y)/"
fi
latest_tlmgr=$(curl -s $URL | grep texmf | grep -v sha | awk '{print $9}')
latest_tlmgr_sum=$(curl -s $URL | grep texmf | grep sha512 | head -1 | awk '{print $9}' )
echo "Downloading the latest texlive-full package ..."
wget -q ${URL}${latest_tlmgr}
wget -q ${URL}${latest_tlmgr_sum}
echo "Checking integrity of $latest_tlmgr ..."
sha512sum -c $TMP/$latest_tlmgr_sum || ( echo "$latest_tlmgr is corrupted, download it again."; exit 1 )
tar -C /usr/share --strip-components=1 -xvf $latest_tlmgr
apk fix texlive
rm -rf $TMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.