[tex-live] Re: TeX Live UNIX shell scripts

Vladimir Volovich vvv@vsu.ru
Fri, 19 Apr 2002 17:43:09 +0400


"SR" == Sebastian Rahtz writes:

 >> how strange then -- i sync'ed just now, and still see the
 >> differences in texshow and texutil for these two directories
 >> (alpha-linux and alphaev5-osf4.0d) - and a missing mktexfmt in
 >> alphaev5-osf4.0d.
 >> 
 >> does p4 work unreliably?
 SR> not in my experience

then something is severely broken!

here is a text of alpha-linux/texshow as fetched directly from perforce
repository by p4web:
===========================================
#!/bin/sh

test -f /bin/sh5 && test -z "$RUNNING_SH5" \
  && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
  && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; }
unset RUNNING_SH5

test -f /bin/bsh && test -z "$RUNNING_BSH" \
  && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \
  && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
unset RUNNING_BSH

# hack around a bug in zsh:
test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'

what=`echo $0 | sed 's@.*/@@'`

p=`kpsewhich -progname=context -format='other text files' $what.pl`
{ test -n "$p" && test -f "$p"; } \
  || { echo "\`$what.pl' not found."; exit 1; }

perl "$p" ${1+"$@"}
===========================================

and here is a text of alphaev5-osf4.0d/texshow:
===========================================
#!/usr/bin/env perl
#D \module
#D   [       file=texshow.pl,
#D        version=1999.03.30,
#D          title=\TEXSHOW, 
#D       subtitle=showing \CONTEXT\ commands,
#D         author=Hans Hagen,
#D           date=\currentdate,
#D      copyright={PRAGMA / Hans Hagen \& Ton Otten},
#D    suggestions={Tobias Burnus \& Taco Hoekwater}]
#C
#C This module is part of the \CONTEXT\ macro||package and is
#C therefore copyrighted by \PRAGMA. See licen-en.pdf for 
#C details. 

#D We need to find the module path. We could have used: 
#D
#D \starttypen 
#D use FindBin ; 
#D use lib $FindBin::Bin ;  
#D \stoptypen
#D
#D But because we're sort of depending on \WEBC\ anyway, the
#D next few lines are more appropriate: 

BEGIN 
 { $cont_pm_path = `kpsewhich --format='other text files' --progname=context cont_mis.pm` ; 
   $cont_pm_path =~ s/cont_mis\.pm.*// ; 
   chop $cont_pm_path } 
   
use lib $cont_pm_path ; 

#D Now we can load some modules: 

use Getopt::Long ;

$Getopt::Long::passthrough = 1 ; # no error message
$Getopt::Long::autoabbrev  = 1 ; # partial switch accepted

&GetOptions
  (      "help" => \$ShowHelp , 
    "interface" => \$Interface ) ;

cont_mis::banner ('TeXShow 0.1 - ConTeXt', 'PRAGMA ADE 1999') ;

if ($ShowHelp) 
  { cont_mis::help ('--help', "print this help") ; 
    cont_mis::help ('--interface', "primary interface") ; 
    cont_mis::help ('string', "show info about command 'string'") ; 
    cont_mis::help ('string lg', "show info about 'string' in language 'lg'") ; 
    cont_mis::crlf () ;
    exit 0 } 

use cont_mis ; 
use cont_set ; 

use Tk ; 

#D This scripts is rather simple, because most of the action
#D takes place in the module \type {cont_set.pm}.  

cont_mis::status ('searching for setup files') ; 

if (cont_set::setups_found) 
  { cont_mis::status ('loading setups') ; 
    cont_set::load_setups ;
    cont_mis::status ('preparing display') ; 
    cont_set::show_setups ; 
    $command = $ARGV[0] ; 
    $interface = $ARGV[1] ; 
    if ($interface) 
      { $Interface = $interface } 
    if ($Interface) 
      { cont_set::set_setup_interface($Interface) ; 
        cont_mis::message ('primary interface', $Interface) } 
    if ($command) 
      { cont_mis::message ('searching command', $command) ; 
        cont_set::show_setup ($command) } 
    else 
      { cont_mis::warning ('no command specified') ;
        cont_set::set_setup_title('TeXShow : ConTeXt commands') }
    cont_mis::status ('entering main loop') ; 
    MainLoop () }
else 
  { cont_mis::error ('no setup files found') } 

END { cont_mis::crlf ;    
      cont_mis::status ('closing down') }
===========================================

Also, texutil is different for these two directories.

WHAT'S GOING ON?

 >> i run P4PORT=sun2.dante.de:1666 p4 sync
 >> 
 >> how can i force p4 really verify all files?

 SR> do p4 sync ...#none which will remove your local copy, then p4
 SR> sync again.

i.e. it is the same as rm -rf all the repository and then sync? :)

no - i don't want this :) i want to verify the files without
re-downloading them in full (like CVS does).

 >> Perl, sh, and scripts in other scripting languages should not be
 >> different across unix platforms in TeX Live, and should not
 >> require any rebuilding for different platforms.

 SR> undoubtedly true. but when do I find the time to check all the
 SR> documentation and scripts? if someone else does it, I'd be more
 SR> than happy.

checking scripts will become a non-issue when you will not duplicate
them in several locations.

you'll just build texlive for any platform, and move the scripts to a
generic scripts dir, and all binaries submitted to you will not
include any platform-independent scripts.

otherwise, there will always be a mess in different script files.

Best,
v.