Web lists-archives.com

Re: [Mingw-msys] Reconstruction of MSYS-1.0.11 test results.




Hello all,

I would like to use Mr.Kleber's script that "hold an existing MiKTeX installation up-to-date."

Unfortunately I got in msys the following error after the command sh miktex_update:

/d/Ardi_downloads
$ sh miktex_update
miktex_update: Could not find command line arguments.
Use the '--help' option for explanation.

#> /d/Ardi_downloads
$ sh miktex_update --help
miktex_update: Could not process command line arguments.
Use the '--help' option for explanation.
ERROR:
miktex_update: getopt: command not found

#> /d/Ardi_downloads
$ sh miktex_update -h   
miktex_update: Could not process command line arguments.
Use the '--help' option for explanation.
ERROR:
miktex_update: getopt: command not found

Is it possible to update msys with extra packages?
Thanks and regards.

Ardi

PS: I have installed only the msys 1.0.10.exe to d:\msys dir.


======================================

http://latex.josef-kleber.de/download/miktex_update

 MiKTeX update shellscript (bash/Cygwin) With this script you can hold an existing MiKTeX installation up-to-date.
 Therefore the script syncronizes a local repository with CTAN or connect  to a MiKTeX online repository and updates the installed packages afterwards.
 After that new packages are installed. In the end you have a complete up-to-date MiKTeX installation.


latex@xxxxxxxxxxxxxxxxxxxxx

The script offers the following options:
-h     --help     will print a help statement
    --version     will print the version number of miktex_update
-b     --broadband     will optimize the text output in LOCAL mode for broadband download. Support for partial package download will be switched off!
-v     --verbose     will lead to a more verbose text output in the process of updating and installing new packages
-l     --local     will set the update mode to LOCAL and syncronize the local repository (default or specified with option -r) with CTAN
-o     --online     will set the update mode to ONLINE. You have to specify an online repository with option -r. Without doing so a repository URL from the MiKTeX server network will be echoed
-r     --repository     specifies the local or online repository for updating and installing new packages
Correct calls would be:
miktex_update -lvb
miktex_update -l -r c:/test
miktex_update -o --verbose
miktex_update -o -r http://ftp.nara.wide.ad.jp/pub/TeX/CTAN/systems/win32/miktex/tm/packages/




#!/bin/bash
#
# miktex_update
#
# synchronize the local MiKTeX repository (optional), # update installed packages and install new packages # (tested with MiKTeX 2.7) v0.8 (09.04.2008) # (C) Josef Kleber 2008  License: LPPL # See http://latex.josef-kleber.de/miktex_update.htm or
#     http://latex.josef-kleber.de/en_miktex_update.htm
# for more information
#
VERSION="v0.8 (09.04.2008)"
REPO=E:/MiKTeXRepRsync
REPOSUBDIR=/packages
#don't change REPOSUBDIR!!
RSYNCURL=rsync://www.ctan.org/SYSTEMS/win32/miktex/tm/packages
RSYNCOPT1='-av'
RSYNCOPT2='--progress --partial'
ODIR=`pwd`
UPDATEMODE="default"
ARGREPO="default"
VERBOSE=""
UPDLIST=update.txt
INSTLIST=install.txt
ERROR=error.txt
#
function printHelp()
{
  echo -e \
          "`basename $0` [options] [--local | --online [--repository <URL/DIR Repository>]]\n"\
          " updates your MiKTeX installation and installs new packages\n\n"\
          " Options:\n\n"\
          " -h, --help  will print this help statement\n\n"\
          " --version  will print the version number of `basename $0`\n\n"\
          " -b, --broadband  will optimize the text output in LOCAL mode for broadband\n"\
          "                  download. Support for partial package download will be\n"\
          "                  switched off!\n\n"\
          " -v, --verbose  will lead to a more verbose text output in the process of\n"\
          "                updating and installing new packages\n\n"\
          " -l, --local  will set the update mode to LOCAL and syncronize the local\n"\
          "              repository (default or specified with option -r) with CTAN\n\n"\
          " -o, --online  will set the update mode to ONLINE. You have to specify an\n"\
          "               online repository with option -r. Without doing so a\n"\
          "               repository URL from the MiKTeX server network will be echoed\n\n"\
          " -r, --repository  specifies the local or online repository for updating\n"\
          "                   and installing new packages\n\n"\
          " See http://latex.josef-kleber.de/miktex_update.htm or\n"\
          "     http://latex.josef-kleber.de/en_miktex_update.htm\n"\
          " for more information"
  exit 0;
}
function printVersion()
{
  echo "This is version $VERSION of `basename $0`"
  exit 0;
}
#
if [ $# -eq 0 ]
then
  echo -e "`basename $0`: Could not find command line arguments.\nUse the '--help' option for explanation."
  exit 1
fi
#
LONGOPTS="help,broadband,verbose,version,local,online,repository:"
SHORTOPTS="hbvlor:"
ARGS=`getopt -l "$LONGOPTS" "$SHORTOPTS" "$@" 2>$ERROR` if [ $? -ne 0 ] then
  echo -e "`basename $0`: Could not process command line arguments.\nUse the '--help' option for explanation."
  echo -e "ERROR:\n`cat $ERROR`"
  exit 1
fi
#
eval set -- "$ARGS"
#
while [ $# -gt 0 ]; do
  ARG=$1
  case "$ARG" in
    --help|-h)       shift; printHelp;;
    --broadband|-b)  shift; RSYNCOPT2="";;
    --verbose|-v)    shift; VERBOSE="--verbose";;
    --version)       shift; printVersion;;
    --local|-l)      shift; UPDATEMODE="LOCAL";;
    --online|-o)     shift; UPDATEMODE="ONLINE";;
    --repository|-r) shift; ARGREPO="$1"; shift;;
    --)              shift; break;;
    *)               break;;
  esac
done
#
echo
echo " MiKTeX Update"
echo "---------------"
echo
if [ $UPDATEMODE = "LOCAL" ]
then
  if [ $ARGREPO != "default" ]
  then
    REPO=${ARGREPO}${REPOSUBDIR}
  else
    REPO=${REPO}${REPOSUBDIR}
  fi
  echo "(1/5) Synchronize local repository with CTAN"
  echo
  if [ ! -d $REPO ]
  then
    mkdir -p $REPO 2>>$ERROR
  fi
  cd $REPO
  cd ..
  if [ -a $ERROR ]
  then
    rm $ERROR
  fi
  RSYNCOPT="$RSYNCOPT1 $RSYNCOPT2"
  rsync $RSYNCOPT $RSYNCURL . 2>>$ERROR
  if [ $? -eq 0 ]
  then
    echo
  fi
elif [ $UPDATEMODE = "ONLINE" ]
then
  if [ $ARGREPO = "default" ]
  then
    echo -e "You did not specify a repository.\nPlease add e.g.(random pick): --repository `mpm --pick-repository-url`"
    exit 1
  else
    REPO=$ARGREPO
    echo "(1/5) Set online repository: $REPO"
    echo
  fi
else
  echo -e "`basename $0`: You did not specify an UPDATE MODE.\nUse the '--help' option for explanation."
  exit 1
fi
mpm --set-repository=$REPO 2>>$ERROR
echo "(2/5) Update DB"
echo
mpm --update-db 2>>$ERROR;
mpm --find-updates >$UPDLIST 2>>$ERROR
echo "(3/5) List of update packages:"
echo
if [ "`cat $UPDLIST | head -1 | cut -c1-5`" = "There" ] then
  echo "      There are currently no updates available."
  echo
  echo "(4/5) Update installed packages"
  echo
  echo "      There are currently no updates available."
else
  cat $UPDLIST
  echo
  echo "(4/5) Update installed packages"
  echo
  mpm --update $VERBOSE 2>>$ERROR
fi
mpm --list | grep -e '- ' | cut -c22- >$INSTLIST 2>>$ERROR echo echo "(5/5) Install new packages"
echo
if [ -s $INSTLIST ]
then
  mpm --install-some=$INSTLIST $VERBOSE 2>>$ERROR else
  echo "      There are currently no new packages available."
fi
rm $UPDLIST
rm $INSTLIST
echo
echo
if [ `ls -al | grep $ERROR | tr -s ' ' | cut -f5 -d ' '` = "0" ] then
  rm $ERROR
  echo "Done!"
else
  echo "ERROR list:"
  echo
  cat $ERROR
fi
echo
cd $ODIR
exit 0


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mingw-msys mailing list
Mingw-msys@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mingw-msys