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

François Charette francois at archlinux.org
Tue Aug 18 08:57:43 UTC 2009


    Date: Tuesday, August 18, 2009 @ 04:57:43
  Author: francois
Revision: 49980

better handling of mapfiles during install

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

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

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-08-18 08:56:42 UTC (rev 49979)
+++ PKGBUILD	2009-08-18 08:57:43 UTC (rev 49980)
@@ -2,7 +2,7 @@
 
 pkgname=texlive-langextra
 pkgver=2009.14322
-pkgrel=1
+pkgrel=2
 pkgdesc="TeX Live - Bundle of all extra language support"
 license=('GPL')
 arch=(any)
@@ -11,10 +11,11 @@
 depends=('texlive-latexextra')
 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=('27ec2da579944512073dbdeae2ac7c2c')
+md5sums=('f5033bf615cf1d8155cec928845aea38'
+         '19385050c1b5d3af3643cd765f32d32f')
 
 build() {
    cd $srcdir
@@ -22,6 +23,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:42 UTC (rev 49979)
+++ texlive.install	2009-08-18 08:57:43 UTC (rev 49980)
@@ -1,5 +1,8 @@
-pre_install() {
-        cat >> /usr/share/texmf-config/web2c/updmap.cfg <<EOF
+PKGNAME="texlive-langextra"
+UPDMAP="/usr/share/texmf-config/web2c/updmap.cfg"
+SYNCWITHTREES=''
+NEWMAPS=`mktemp`
+cat <<EOF > $NEWMAPS
 Map arabi.map
 Map arevvn.map
 Map burmese.map
@@ -21,6 +24,9 @@
 MixedMap vnrother.map
 MixedMap vnrtext.map
 EOF
+
+pre_install() {
+	cat $NEWMAPS >> $UPDMAP
 }
 
 post_install() {
@@ -31,43 +37,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="arabi.map
-arevvn.map
-burmese.map
-chartervn.map
-cjhebrew.map
-cmbrightvn.map
-comicvn.map
-concretevn.map
-grotesqvn.map
-mscorevn.map
-skt.map
-txttvn.map
-urwvn.map
-vntopia.map
-arabtex.map
-dvng.map
-ethiop.map
-mongolian.map
-vnrother.map
-vnrtext.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