]>
git.rmz.io Git - dotfiles.git/blob - bin/chakra/check-texlive
   3 remote_directory
="ftp://ftp.archlinux.org/other/texlive/" 
   5 page
="/tmp/texlive-update" 
   6 pkgs
="bibtexextra bin core fontsextra htmlxml latexextra" 
   8 wget 
-O ${page} ${remote_directory} &>/dev
/null
 
  10 page_data
=$
(cat ${page}) 
  13 for pkg 
in ${pkgs} ; do 
  14   echo " :: scanning ${pkg}.." 
  18   for x 
in {1.
.250} ; do 
  19     if [ "${found_pkg}" == "true" ] ; then 
  23     pkg_match_line
=$
(echo ${page_data} | cut 
-d\" -f${x}) 
  24     pkg_match_file
=$
(echo ${pkg_match_line} | grep texlive
-${pkg}) 
  25     if [ -n "${pkg_match_file}" ] ; then 
  26       if [ "${pkg}" == "bin" ] ; then 
  28           local_revision
=$
(cat ${local_directory}/texlive
-${pkg}/PKGBUILD 
| grep texlive
-${pkg}-source | cut 
-d- -f4 | cut 
-d. 
-f1) 
  29           if [ -n "$(echo ${pkg_match_file} | grep href | grep source)" ] ; then 
  30             remote_revision
=$
(echo ${pkg_match_file} | cut 
-d- -f4 | cut 
-d. 
-f1) 
  31             ver
=$
(vercmp 
${local_revision} ${remote_revision}) 
  32             if [ "${ver}" == "-1" ] ; then 
  33               echo " :: !! new texlive-bin-source tarball found" 
  34               echo "   -- local: ${local_revision}" 
  35               echo "   -- remote: ${remote_revision}" 
  36               sed -i -e "s/${local_revision}/${remote_revision}/g" ${local_directory}/texlive
-${pkg}/PKGBUILD
 
  40           local_revision
=$
(cat ${local_directory}/texlive
-${pkg}/PKGBUILD 
| grep texlive
-${pkg}-texmf | cut 
-d- -f4 | cut 
-d. 
-f1) 
  41           if [ -n "$(echo ${pkg_match_file} | grep href | grep texmf)" ] ; then    
  42             remote_revision
=$
(echo ${pkg_match_file} | cut 
-d- -f4 | cut 
-d. 
-f1) 
  43             ver
=$
(vercmp 
${local_revision} ${remote_revision}) 
  44             if [ "${ver}" == "-1" ] ; then 
  45               echo " :: !! new texlive-bin-texmf tarball found" 
  46               echo "   -- local: ${local_revision}" 
  47               echo "   -- remote: ${remote_revision}" 
  48               sed -i -e "s/${local_revision}/${remote_revision}/g" ${local_directory}/texlive
-${pkg}/PKGBUILD
 
  52           if [ "${found_luatext}" == "true" ] ; then 
  56           local_revision
=$
(cat ${local_directory}/texlive
-${pkg}/PKGBUILD 
| grep "luatex-svn" | cut 
-d- -f2 | cut 
-d. 
-f1 | cut 
-dn -f2) 
  57           remote_revision
=$
(echo ${page_data} | sed -e 's/\n//g' -e 's/xz/xz\n/g' -e 's/zip/zip\n/g' -e 's/a>/a>\n/g' -e 's/ref=/ref=\n/g' | grep luatex 
| cut 
-d. 
-f1 | cut 
-dn -f2 | sed -e 's/ /\n/g' | uniq | grep -v ftp) 
  58           for match 
in ${remote_revision} ; do 
  59             ver
=$
(vercmp 
${local_revision} ${match}) 
  60             if [ "${ver}" == "-1" ] ; then 
  61               echo " :: !! new luatext tarball found" 
  62               echo "   -- local: ${local_revision}" 
  63               echo "   -- remote: ${match}" 
  64               sed -i -e "s/${local_revision}/${match}/g" ${local_directory}/texlive
-${pkg}/PKGBUILD
 
  69     elif [ "${pkg}" == "bibtexextra" ] ; then 
  70       if [ "${found_match}" == "true" ] ; then 
  74       local_revision
=$
(cat ${local_directory}/texlive
-${pkg}/PKGBUILD 
| grep pkgver
= | cut 
-d= -f2 | cut 
-d. 
-f2) 
  75       remote_revision
=$
(echo ${page_data} | sed -e 's/\n//g' -e 's/xz/xz\n/g' -e 's/zip/zip\n/g' -e 's/a>/a>\n/g' -e 's/ref=/ref=\n/g' | grep ${pkg} | cut 
-d. 
-f2 | cut 
-d- -f1 | uniq | grep -v ftp) 
  76       for match 
in ${remote_revision} ; do 
  77         ver
=$
(vercmp 
${local_revision} ${match}) 
  78         if [ "${ver}" == "-1" ] ; then 
  79           echo " :: !! new tarball found" 
  80           echo "   -- local: ${local_revision}" 
  81           echo "   -- remote: ${match}" 
  82           sed -i -e "s/${local_revision}/${match}/g" ${local_directory}/texlive
-${pkg}/PKGBUILD
 
  87       if [ "${found_pkg}" == "true" ] ; then 
  91       local_revision
=$
(cat ${local_directory}/texlive
-${pkg}/PKGBUILD 
| grep pkgver
= | cut 
-d= -f2 | cut 
-d. 
-f2) 
  92       remote_revision
=$
(echo ${page_data} | sed -e 's/\n//g' -e 's/xz/xz\n/g' -e 's/zip/zip\n/g' -e 's/a>/a>\n/g' -e 's/ref=/ref=\n/g' | grep ${pkg} | cut 
-d. 
-f2 | cut 
-d- -f1 | uniq | grep -v ftp) 
  93       for match 
in ${remote_revision} ; do 
  94         ver
=$
(vercmp 
${local_revision} ${match}) 
  95         if [ "${ver}" == "-1" ] ; then 
  96           echo " :: !! new tarball found" 
  97           echo "   -- local: ${local_revision}" 
  98           echo "   -- remote: ${match}" 
  99           sed -i -e "s/${local_revision}/${match}/g" ${local_directory}/texlive
-${pkg}/PKGBUILD