Brad Barber | 5 Jun 2008 04:30
Picon
Favicon

Something is wrong with date and timezones

Hi,

There's something wrong with the date function.  It looks like the timezone codes are defined incorrectly.

The following command should be the identity function.  This is the result on an XP SP 2

date -d "1970-01-01 1212522780 sec UTC" +"%s"
1212526380

It is the identity function if the timezone is EST.   The actual timezone is EDT.  

date -d "1970-01-01 1212631585 sec EST" +"%s"
1212653185

Even if --utc is specified, the value is not preserved

date --utc -d "1970-01-01 1212631585 sec UTC" +"%s"
1212635185

Date works OK on a linux system running GNU.

				--Brad

-------------------------------------------------------------------------
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
Ardi | 11 Jun 2008 10:33
Picon
Favicon

getopt error in msys Version 1.0.10

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-ehPQIvEpSJRzNCJf10r6+t10k2aWwXN4@public.gmane.org

The script o ffers 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     --re pository     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"\
        &n bsp; " -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"\
   &n bsp;      "              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" "$ <at> " 2>$ERROR` if [ $? -ne 0 ] then
  echo -e "`basename $0`: Could not process command line arguments.\nUse th e '--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
  &nb sp; 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 curr ently 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@...
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Michael DOUBEZ | 11 Jun 2008 13:39
Picon
Favicon
Gravatar

Re: getopt error in msys Version 1.0.10

Ardi a écrit :
> 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:
> 

> miktex_update: getopt: command not found

Hello,

Unless someone does it for you, you have two solution:
   - compile getopt: grab the linux-util sources from 
ftp://ftp.kernel.org/pub/linux/utils/util-linux/ and try to compile the 
getopt program. I did give it a quick try and got an error at link:
getopt.o:getopt.c:(.text+0x25e): undefined reference to `getopt_long_only'
You can just comment out the "_only" at the offending line. You won't be 
able to have long option only but it should be fine for your need.
If you want the binary I have made, email me. I give no guarantee about 
it working on your computer :).

   - Change the script in order to use getopts instead of getopt but 
then you won't be able to use the long options.

--

-- 
Michael

-------------------------------------------------------------------------
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
Ardi | 11 Jun 2008 13:48
Picon
Favicon

Re: getopt error in msys Version 1.0.10

Hello Michael,

binary would be more than enough for me.
It will only be used for the MikTeX local update purpose.
I would highly appreciate if you could let me have this binary.
I will try it at home and let you know whether it works.
Kind regards,

Ardi

--- On Wed, 6/11/08, Michael DOUBEZ <michael.doubez-GANU6spQydw@public.gmane.org> wrote:
From: Michael DOUBEZ <michael.doubez-GANU6spQydw@public.gmane.org>
Subject: Re: [Mingw-msys] getopt error in msys Version 1.0.10
To: mingw-msys-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Date: Wednesday, June 11, 2008, 4:39 AM

Ardi a écrit :
> 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:
>

> miktex_update: getopt: command not found


Hello,

Unless someone does it for you, you have two solution:
- compile getopt: grab the linux-util sources from
ftp://ftp.kernel.org/pub/linux/utils/util-linux/ and try to compile the
getopt program. I did give it a quick try and got an error at link:
getopt.o:getopt.c:(.text+0x25e): undefined reference to `getopt_long_only'
You can just comment out the "_only" at the offending line. You
won't be
able to have long option only but it should be fine for your need.
If you want the binary I have made, email me. I give no guarantee about
it working on your computer :).

- Change the script in order to use getopts instead of getopt but
then you won't be able to use the long options.


--
Michael


-------------------------------------------------------------------------
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-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/mingw-msys

-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Michael DOUBEZ | 11 Jun 2008 14:54
Picon
Favicon
Gravatar

Re: getopt error in msys Version 1.0.10

Ardi a écrit :
> Hello Michael,
> 
> binary would be more than enough for me.
> It will only be used for the MikTeX local update purpose.
> I would highly appreciate if you could let me have this binary.
> I will try it at home and let you know whether it works.
> Kind regards,

I put it at the following address:
http://www.seitai-equilibre.net/pub/getopt.exe

Cheers,

--

-- 
Michael

-------------------------------------------------------------------------
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
Ardi | 11 Jun 2008 15:00
Picon
Favicon

Re: getopt error in msys Version 1.0.10

Thanks Michael for the script.
I will test it.
Regards,

Ardi

--- On Wed, 6/11/08, Michael DOUBEZ <michael.doubez-GANU6spQydw@public.gmane.org> wrote:
From: Michael DOUBEZ <michael.doubez-GANU6spQydw@public.gmane.org>
Subject: Re: [Mingw-msys] getopt error in msys Version 1.0.10
To: mingw-msys-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Date: Wednesday, June 11, 2008, 5:54 AM

Ardi a écrit :
> Hello Michael,
>
> binary would be more than enough for me.
> It will only be used for the MikTeX local update purpose.
> I would highly appreciate if you could let me have this binary.
> I will try it at home and let you know whether it works.
> Kind regards,

I put it at the following address:
http://www.seitai-equilibre.net/pub/getopt.exe

Cheers,

--
Michael


-------------------------------------------------------------------------
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-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/mingw-msys

-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Ardi | 11 Jun 2008 15:51
Picon
Favicon

Re: getopt error in msys Version 1.0.10

Hello Michael,

I have copied getopt.exe to msys/1.0/bin directory
but using sh miktex_update -h it gives error:

Note:i renamed miktex_update script to mik!!

$ sh mik -h
mik: if: command not found
mik: Could not process command line arguments.
Use the '--help' option for explanation.
ERROR:
getopt: missing optstring argument
Try `getopt --help' for more information.

$ sh mik -help
mik: if: command not found
mik: Could not process command line arguments.
Use the '--help' option for explanation.
ERROR:
getopt: missing optstring argument
Try `getopt --help' for more information.

Do I have to change sg inside the script?
It seems that it cannot take neither the long nor the short arguments properly.
Or is there some problem with the if command??
Correct me if I am wrong.

Regards,
Ardi


--- On Wed, 6/11/08, Michael DOUBEZ <michael.doubez-GANU6spQydw@public.gmane.org> wrote:
From: Michael DOUBEZ <michael.doubez-GANU6spQydw@public.gmane.org>
Subject: Re: [Mingw-msys] getopt error in msys Version 1.0.10
To: mingw-msys <at> lists.sourceforge.net
Date: Wednesday, June 11, 2008, 5:54 AM

Ardi a écrit :
> Hello Michael,
>
> binary would be more than enough for me.
> It will only be used for the MikTeX local update purpose.
> I would highly appreciate if you could let me have this binary.
> I will try it at home and let you know whether it works.
> Kind regards,

I put it at the following address:
http://www.seitai-equilibre.net/pub/getopt.exe

Cheers,

--
Michael


-------------------------------------------------------------------------
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-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/mingw-msys

-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Cesar Strauss | 12 Jun 2008 01:22
Picon

Re: getopt error in msys Version 1.0.10

Ardi wrote:
> I have copied getopt.exe to msys/1.0/bin directory

In MSYS 1.0.10, the msys/1.0/bin directory is reserved for MSYS
programs. Please move getopt.exe to another location in your PATH and
try again.

Regards,
Cesar

-------------------------------------------------------------------------
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
Ardi | 12 Jun 2008 09:01
Picon
Favicon

Re: getopt error in msys Version 1.0.10

Hello,

I have moved getopt.exe to d:\x_getopt dir, updated path but it did not help.
I have played with getopt and it gives strange -- sign if I use f.e:

The miktex_update script  seems to me not able to read correctly the following:

LONGOPTS="help,broadband,verbose,version,local,online,repository:"
SHORTOPTS="hbvlor:"
ARGS=`getopt -l "$LONGOPTS" "$SHORTOPTS" "$ <at> " 2>$ERROR` if [ $? -ne 0 ] then
  echo -e "`basename $0`: Could not process command line arguments.\nUse the '--help' option for explanation."
  echo -e "ERR OR:\n`cat $ERROR`"
  exit 1
fi

For example:
$ getopt.exe -l "ee" "rr" "yy" "ii" gives:

 -- 'yy' 'ii'

It seems it cannot read $LONGOPTS" "$SHORTOPTS" "$ <at> " properly.

When I define:

#>SHORTOPTS="hbvlor:"

#>LONGOPTS="help,broadband,verbose,version,local,online,repository:"

#>getopt -ou "$LONGOPTS" "$SHORTOPTS" "$ <at> "
 -- 'help,broadband,verbose,version,local,online,repository:' 'hbvlor:'

the "--" sign remains there. Is it correct?


Regards,

Ardi

--- On Wed, 6/11/08, Cesar Strauss <cestrauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
From: Cesar Strauss <cestrauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [Mingw-msys] getopt error in msys Version 1.0.10
To: mingw-msys-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Date: Wednesday, June 11, 2008, 4:22 PM

Ardi wrote:
> I have copied getopt.exe to msys/1.0/bin directory

In MSYS 1.0.10, the msys/1.0/bin directory is reserved for MSYS
programs. Please move getopt.exe to another location in your PATH and
try again.

Regards,
Cesar


-------------------------------------------------------------------------
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-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/mingw-msys

-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/mingw-msys
Michael DOUBEZ | 12 Jun 2008 15:37
Picon
Favicon
Gravatar

Re: getopt error in msys Version 1.0.10

Ardi a écrit :

> It seems it cannot read $LONGOPTS" "$SHORTOPTS" "$ <at> " properly.
> 
> When I define:
> 
> #>SHORTOPTS="hbvlor:"
> 
> #>LONGOPTS="help,broadband,verbose,version,local,online,repository:"
> 
> #>getopt -ou "$LONGOPTS" "$SHORTOPTS" "$ <at> "
>  -- 'help,broadband,verbose,version,local,online,repository:' 'hbvlor:'
> 
> the "--" sign remains there. Is it correct?

If it is in a shell, it is normal. You have to export the variables or 
use them in the same line:
export SHORTOPTS="hbvlor:"
export ONGOPTS="help,broadband,verbose,version,local,online,repository:"

And short options should follow the -o parameter:
getopt -ou "$SHORTOPTS"  "$LONGOPTS" "$ <at> "

--

-- 
Michael

-------------------------------------------------------------------------
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

Gmane