[arch-commits] Commit in texlive-langgreek/trunk (PKGBUILD texlive.install)
François Charette
francois at archlinux.org
Tue Aug 18 08:56:42 UTC 2009
Date: Tuesday, August 18, 2009 @ 04:56:42
Author: francois
Revision: 49979
better handling of mapfiles during install
Modified:
texlive-langgreek/trunk/PKGBUILD
texlive-langgreek/trunk/texlive.install
-----------------+
PKGBUILD | 8 ++++---
texlive.install | 59 +++++++++++++++++++++++++++++++++++++-----------------
2 files changed, 46 insertions(+), 21 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2009-08-18 08:56:31 UTC (rev 49978)
+++ PKGBUILD 2009-08-18 08:56:42 UTC (rev 49979)
@@ -2,17 +2,18 @@
pkgname=texlive-langgreek
pkgver=2009.14450
-pkgrel=1
+pkgrel=2
pkgdesc="TeX Live - Fonts and support for typesetting Greek"
license=('GPL')
arch=(any)
depends=('texlive-core')
groups=('texlive-lang')
url='http://tug.org/texlive/'
-source=("ftp://ftp.archlinux.org/other/texlive/$pkgname-$pkgver-src.zip")
+source=("ftp://ftp.archlinux.org/other/texlive/$pkgname-$pkgver-src.zip" "$pkgname.maps")
options=('!emptydirs')
install=texlive.install
-md5sums=('ad1e0556e77d75c56b2137fff8506059')
+md5sums=('2f205e554254446fc7c403fba07a5214'
+ 'a1c515e7bbe93c905e20db580aa5a234')
build() {
cd $srcdir
@@ -20,6 +21,7 @@
sed -i '/^#/d' CONTENTS || return 1
_revnr=`echo $pkgver | sed 's/2009\.//'`
install -m644 CONTENTS $pkgdir/usr/share/texmf-var/arch/installedpkgs/${pkgname}_${_revnr}.pkgs || return 1
+ install -m644 $pkgname.maps $pkgdir/usr/share/texmf-var/arch/installedpkgs/ || return 1
for p in *.tar.xz; do
bsdtar -xf $p || return 1
done
Modified: texlive.install
===================================================================
--- texlive.install 2009-08-18 08:56:31 UTC (rev 49978)
+++ texlive.install 2009-08-18 08:56:42 UTC (rev 49979)
@@ -1,12 +1,18 @@
-pre_install() {
- cat >> /usr/share/texmf-config/web2c/updmap.cfg <<EOF
-MixedMap cbgreek-full.map
+PKGNAME="texlive-langgreek"
+UPDMAP="/usr/share/texmf-config/web2c/updmap.cfg"
+SYNCWITHTREES=''
+NEWMAPS=`mktemp`
+cat <<EOF > $NEWMAPS
+Map gfsbaskerville.map
Map gfsporson.map
-Map gfsbaskerville.map
Map grverb.map
+Map kerkis.map
+MixedMap cbgreek-full.map
MixedMap iby.map
-Map kerkis.map
EOF
+
+pre_install() {
+ cat $NEWMAPS >> $UPDMAP
}
post_install() {
@@ -17,28 +23,45 @@
echo " done."
}
+
+pre_upgrade() {
+ OLDMAPS="/usr/share/texmf-var/arch/installedpkgs/$PKGNAME.maps"
+ if [ -f $OLDMAPS ] ; then
+ MAPSDIFF=`mktemp`
+ TOADD=`mktemp`
+ diff -B $OLDMAPS $NEWMAPS | sed 's/\s\+/ /g' > $MAPSDIFF
+ TOREMOVE=`cat $MAPSDIFF | egrep '^<' | cut -d' ' -f3`
+ cat $MAPSDIFF | egrep '^>' | sed 's/^> //' > $TOADD
+ if [ "x$TOREMOVE" != "x" ]; then
+ for map in $TOREMOVE; do
+ sed -i "/\s$map/d" $UPDMAP
+ done
+ fi
+ if [ -s $TOADD ]; then
+ cat $TOADD >> $UPDMAP
+ fi
+ else
+ echo "Warning: file $PKGNAME.maps not found"
+ echo "(ignore the above if updating from TL2008 or from TL2009 in testing)"
+ SYNCWITHTREES="--syncwithtrees"
+ fi
+}
+
+
post_upgrade() {
echo ">>> texlive: updating the filename database..."
texconfig-sys rehash
echo ">>> texlive: updating the fontmap files with updmap..."
- updmap-sys --quiet --nohash
+ updmap-sys --quiet --nohash $SYNCWITHTREES
echo " done."
}
pre_remove() {
- MAPS="cbgreek-full.map
-gfsporson.map
-gfsbaskerville.map
-grverb.map
-iby.map
-kerkis.map"
- for m in $MAPS; do sed -i "/^M.\+$m/d" /usr/share/texmf-config/web2c/updmap.cfg ; done
+for m in `cut -d' ' -f2 $NEWMAPS`; do
+ sed -i "/\s$m/d" $UPDMAP ;
+done
}
post_remove() {
- echo ">>> texlive: updating the filename database..."
- texconfig-sys rehash
- echo ">>> texlive: updating the fontmap files with updmap..."
- updmap-sys --quiet --nohash
- echo " done."
+ post_install
}
More information about the arch-commits
mailing list