Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37549874
en ru br
ALT Linux repos
S:0.2-alt4

Group :: Publishing
RPM: tex-common

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh -e
#
# Copyright (C) 2008 Grigory Batalov <bga@altlinux.org>
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# rehash condition
found=

# get texmf directory list
kpsewhich=/usr/bin/kpsewhich
[ -x "$kpsewhich" ] && dirs=`"$kpsewhich" --show-path=ls-R`

[ -n "$dirs" ] || exit 0

# get a list of files
while read -r f; do
if [ -n "$found" ]; then
break
fi
# directories are separated with the colon
OLDIFS="$IFS"
IFS=:
for i in $dirs; do
# check if the file starts with a known directory
if [ "${f#$i/}" != "$f" ]; then
found=1
break
fi
done
IFS="$OLDIFS"
done

# rehash all directories
# TODO: it is possible to specify necessary directories
# as arguments to texhash
texhash=/usr/bin/texhash
if [ -n "$found" ] && [ -x "$texhash" ]; then
"$texhash"
fi
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin