[arch-commits] Commit in texlive-latexextra/trunk (PKGBUILD texlive.install)

François Charette francois at archlinux.org
Tue Aug 18 09:40:28 UTC 2009


    Date: Tuesday, August 18, 2009 @ 05:40:28
  Author: francois
Revision: 49994

upgpkg: texlive-latexextra 2009.14694-1
    update + better handling of mapfiles during install

Modified:
  texlive-latexextra/trunk/PKGBUILD
  texlive-latexextra/trunk/texlive.install

-----------------+
 PKGBUILD        |    8 +++++---
 texlive.install |   50 ++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 43 insertions(+), 15 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-08-18 09:22:32 UTC (rev 49993)
+++ PKGBUILD	2009-08-18 09:40:28 UTC (rev 49994)
@@ -1,7 +1,7 @@
 # Maintainer: Firmicus <firmicus āt gmx dōt net>
 
 pkgname=texlive-latexextra
-pkgver=2009.14459
+pkgver=2009.14694
 pkgrel=1
 pkgdesc="TeX Live - Large collection of add-on packages for LaTeX"
 license=('GPL')
@@ -10,10 +10,11 @@
 optdepends=('texlive-pictures')
 groups=('texlive-most')
 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=('2ad5d4fe66c29fdec60f1586821ec864')
+md5sums=('99ee8c24baac2d7c78598700f8293dab'
+         '9e4825f47dac663dd62c4bfa67899e84')
 
 build() {
    cd $srcdir
@@ -21,6 +22,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 09:22:32 UTC (rev 49993)
+++ texlive.install	2009-08-18 09:40:28 UTC (rev 49994)
@@ -1,9 +1,15 @@
-pre_install() {
-        cat >> /usr/share/texmf-config/web2c/updmap.cfg <<EOF
+PKGNAME="texlive-latexextra"
+UPDMAP="/usr/share/texmf-config/web2c/updmap.cfg"
+SYNCWITHTREES=''
+NEWMAPS=`mktemp`
+cat <<EOF > $NEWMAPS
 Map epiolmec.map
 MixedMap esint.map
 MixedMap manfnt.map
 EOF
+
+pre_install() {
+	cat $NEWMAPS >> $UPDMAP
 }
 
 post_install() {
@@ -14,25 +20,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="epiolmec.map
-esint.map
-manfnt.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