OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   12-Feb-2004 17:16:09
  Branch: HEAD                             Handle: 2004021216160800

  Modified files:
    openpkg-src/openpkg     HISTORY openpkg.spec shtool

  Log:
    upgraded to the latest GNU shtool 2.0b0 snapshot version

  Summary:
    Revision    Changes     Path
    1.130       +1  -0      openpkg-src/openpkg/HISTORY
    1.286       +1  -1      openpkg-src/openpkg/openpkg.spec
    1.16        +232 -216   openpkg-src/openpkg/shtool
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/HISTORY
  ============================================================================
  $ cvs diff -u -r1.129 -r1.130 HISTORY
  --- openpkg-src/openpkg/HISTORY       11 Feb 2004 20:51:37 -0000      1.129
  +++ openpkg-src/openpkg/HISTORY       12 Feb 2004 16:16:08 -0000      1.130
  @@ -2,6 +2,7 @@
   2004
   ====
   
  +20040212 upgraded to the latest GNU shtool 2.0b0 snapshot version
   20040211 upgraded to OSSP uuid 0.9.6
   20040210 use "<compat>" for "%l_tag_fmt" on upgrades to be more OpenPKG 1.3 
compatible
   20040210 we more smart and accept not-existing "Class:" headers for compatibility.
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/openpkg.spec
  ============================================================================
  $ cvs diff -u -r1.285 -r1.286 openpkg.spec
  --- openpkg-src/openpkg/openpkg.spec  11 Feb 2004 20:51:37 -0000      1.285
  +++ openpkg-src/openpkg/openpkg.spec  12 Feb 2004 16:16:08 -0000      1.286
  @@ -39,7 +39,7 @@
   #   o any cc(1)
   
   #   the package version/release
  -%define       V_openpkg  20040211
  +%define       V_openpkg  20040212
   
   #   the used software versions
   %define       V_rpm      4.2.1
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/shtool
  ============================================================================
  $ cvs diff -u -r1.15 -r1.16 shtool
  --- openpkg-src/openpkg/shtool        21 Jan 2004 20:44:56 -0000      1.15
  +++ openpkg-src/openpkg/shtool        12 Feb 2004 16:16:08 -0000      1.16
  @@ -6,7 +6,7 @@
   ##  See http://www.gnu.org/software/shtool/ for more information.
   ##  See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
   ##
  -##  Version:  2.0b0 (13-Dec-2003)
  +##  Version:  2.0b0 (12-Feb-2004)
   ##  Contents: all available modules
   ##
   
  @@ -65,7 +65,7 @@
       exit 1
   fi
   if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
  -    echo "This is GNU shtool, version 2.0b0 (13-Dec-2003)"
  +    echo "This is GNU shtool, version 2.0b0 (12-Feb-2004)"
       echo "Copyright (c) 1994-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>"
       echo "Report bugs to <[EMAIL PROTECTED]>"
       echo ''
  @@ -78,7 +78,7 @@
       echo '  -r, --recreate  recreate this shtool script via shtoolize'
       echo ''
       echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
  -    echo '  echo     [-n|--newline] [-e|--expand] [<str> ...]'
  +    echo '  echo     [-n|--newline] [-e|--expand] [<string> ...]'
       echo '  mdate    [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]'
       echo '           [-f|--field-sep <str>] [-o|--order <spec>] <path>'
       echo '  table    [-F|--field-sep <sep>] [-w|--width <width>] [-c|--columns'
  @@ -100,8 +100,8 @@
       echo '  rotate   [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files'
       echo '           <count>] [-s|--size <size>] [-c|--copy] [-r|--remove]'
       echo '           [-a|--archive-dir <dir>] [-z|--compress [<tool>:]<level>]'
  -    echo '           [-b|--background] [-d|--delay] [-p|--pad <len>] [-o|--owner'
  -    echo '           <owner>] [-g|--group <group>] [-m|--mode <mode>] [-M|--migrate'
  +    echo '           [-b|--background] [-d|--delay] [-p|--pad <len>] [-m|--mode'
  +    echo '           <mode>] [-o|--owner <owner>] [-g|--group <group>] 
[-M|--migrate'
       echo '           <cmd>] [-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]'
       echo '  tarball  [-t|--trace] [-v|--verbose] [-o|--output <tarball>]'
       echo '           [-c|--compress <prog>] [-d|--directory <dir>] [-u|--user'
  @@ -110,9 +110,10 @@
       echo '  subst    [-v|--verbose] [-t|--trace] [-n|--nop] [-s|--stealth]'
       echo '           [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>]'
       echo '           [-f|--file <cmd-file>] [<file>] [...]'
  -    echo '  platform [-F|--format FORMAT] [-S|--sep STRING] [-C|--conc STRING]'
  -    echo '           [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise]'
  -    echo '           [-n|--no-newline] [-t|--type TYPE] [-V|--version] [-h|--help]'
  +    echo '  platform [-F|--format <format>] [-S|--sep <string>] [-C|--conc'
  +    echo '           <string>] [-L|--lower] [-U|--upper] [-v|--verbose]'
  +    echo '           [-c|--concise] [-n|--no-newline] [-t|--type <type>]'
  +    echo '           [-V|--version] [-h|--help]'
       echo '  arx      [-t|--trace] [-C|--command <cmd>] <op> <archive> [<file>'
       echo '           ...]'
       echo '  slo      [-p|--prefix <str>] -- -L<dir> -l<lib> [-L<dir> -l<lib>'
  @@ -130,7 +131,7 @@
       exit 0
   fi
   if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then
  -    echo "GNU shtool 2.0b0 (13-Dec-2003)"
  +    echo "GNU shtool 2.0b0 (12-Feb-2004)"
       exit 0
   fi
   if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then
  @@ -164,7 +165,7 @@
   case $tool in
       echo )
           str_tool="echo"
  -        str_usage="[-n|--newline] [-e|--expand] [<str> ...]"
  +        str_usage="[-n|--newline] [-e|--expand] [<string> ...]"
           arg_spec="0+"
           opt_spec="n.e."
           opt_alias="n:newline,e:expand"
  @@ -275,7 +276,7 @@
           ;;
       rotate )
           str_tool="rotate"
  -        str_usage="[-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files 
<count>] [-s|--size <size>] [-c|--copy] [-r|--remove] [-a|--archive-dir <dir>] 
[-z|--compress [<tool>:]<level>] [-b|--background] [-d|--delay] [-p|--pad <len>] 
[-o|--owner <owner>] [-g|--group <group>] [-m|--mode <mode>] [-M|--migrate <cmd>] 
[-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]"
  +        str_usage="[-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files 
<count>] [-s|--size <size>] [-c|--copy] [-r|--remove] [-a|--archive-dir <dir>] 
[-z|--compress [<tool>:]<level>] [-b|--background] [-d|--delay] [-p|--pad <len>] 
[-m|--mode <mode>] [-o|--owner <owner>] [-g|--group <group>] [-M|--migrate <cmd>] 
[-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]"
           arg_spec="1+"
           opt_spec="v.t.f.n:s:c.r.a:z:b.d.p:o:g:m:M:P:E:"
           
opt_alias="v:verbose,t:trace,f:force,n:num-files,s:size,c:copy,r:remove,a:archive-dir,z:compress,b:background,d:delay,p:pad,o:owner,g:group,m:mode,M:migrate,P:prolog,E:epilog"
  @@ -332,7 +333,7 @@
           ;;
       platform )
           str_tool="platform"
  -        str_usage="[-F|--format FORMAT] [-S|--sep STRING] [-C|--conc STRING] 
[-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type 
TYPE] [-V|--version] [-h|--help]"
  +        str_usage="[-F|--format <format>] [-S|--sep <string>] [-C|--conc <string>] 
[-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type 
<type>] [-V|--version] [-h|--help]"
           arg_spec="0="
           opt_spec="F:S:C:L.U.v.c.n.t:d.V.h."
           
opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help"
  @@ -609,11 +610,10 @@
       ##
       ##  echo -- Print string with optional construct expansion
       ##  Copyright (c) 1998-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for WML as buildinfo
       ##
  -    
  +
       text="$*"
  -    
  +
       #   check for broken escape sequence expansion
       seo=''
       bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'`
  @@ -623,14 +623,14 @@
               seo='-E'
           fi
       fi
  -    
  +
       #   check for existing -n option (to suppress newline)
       minusn=''
       bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'`
       if [ ".$bytes" = .3 ]; then
           minusn='-n'
       fi
  -    
  +
       #   determine terminal bold sequence
       term_bold=''
       term_norm=''
  @@ -682,7 +682,7 @@
               term_norm=''
           fi
       fi
  -    
  +
       #   determine user name
       username=''
       if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[uUgG]'`" != . ]; then
  @@ -711,7 +711,7 @@
               fi
           fi
       fi
  -    
  +
       #   determine user id
       userid=''
       if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%U'`" != . ]; then
  @@ -742,7 +742,7 @@
               fi
           fi
       fi
  -    
  +
       #   determine (primary) group id
       groupid=''
       if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[gG]'`" != . ]; then
  @@ -769,7 +769,7 @@
               fi
           fi
       fi
  -    
  +
       #   determine (primary) group name
       groupname=''
       if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%g'`" != . ]; then
  @@ -798,7 +798,7 @@
               fi
           fi
       fi
  -    
  +
       #   determine host and domain name
       hostname=''
       domainname=''
  @@ -838,7 +838,7 @@
               fi
           fi
       fi
  -    
  +
       #   determine current time
       time_day=''
       time_month=''
  @@ -870,7 +870,7 @@
                 12) time_monthname='Dec' ;;
           esac
       fi
  -    
  +
       #   expand special ``%x'' constructs
       if [ ".$opt_e" = .yes ]; then
           text=`echo $seo "$text" |\
  @@ -887,7 +887,7 @@
                     -e "s/%Y/${time_year}/g" \
                     -e "s/%m/${time_monthname}/g" 2>/dev/null`
       fi
  -    
  +
       #   create output
       if [ .$opt_n = .no ]; then
           echo $seo "$text"
  @@ -900,16 +900,17 @@
               echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text"
           fi
       fi
  +
  +    shtool_exit 0
       ;;
   
   mdate )
       ##
       ##  mdate -- Pretty-print modification time of a file or dir
       ##  Copyright (c) 1995-1997 Free Software Foundation, Inc.
  -    ##  Originally idea and basis code by Ulrich Drepper
  -    ##  Enhanced by Ralf S. Engelschall for shtool
  +    ##  Copyright (c) 1998-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
       ##
  -    
  +
       fod="$1"
       case "$opt_o" in
           [dmy][dmy][dmy] )
  @@ -922,23 +923,23 @@
           echo "$msgprefix:Error: file or directory not found: $fod" 1>&2
           shtool_exit 1
       fi
  -    
  +
       #   prevent "date" giving response in another language
       LANG=C;    export LANG
       LC_ALL=C;  export LC_ALL
       LC_TIME=C; export LC_TIME
  -    
  +
       #   get the extended ls output of the file or directory.
       if /bin/ls -L /dev/null >/dev/null 2>&1; then
           set - x`/bin/ls -L -l -d $fod`
       else
           set - x`/bin/ls -l -d $fod`
       fi
  -    
  +
       #   The month is at least the fourth argument
       #   (3 shifts here, the next inside the loop).
       shift; shift; shift
  -    
  +
       #   Find the month. Next argument is day, followed by the year or time.
       month=""
       while [ ".$month" = . ]; do
  @@ -960,7 +961,7 @@
       done
       day="$2"
       year="$3"
  -    
  +
       #   We finally have to deal with the problem that the "ls" output
       #   gives either the time of the day or the year.
       case $year in
  @@ -982,7 +983,7 @@
               year="$this_year"
               ;;
       esac
  -    
  +
       #   Optionally fill day and month with leeding zeros
       if [ ".$opt_z" = .yes ]; then
           case $day in
  @@ -994,17 +995,17 @@
                    [0-9] ) nummonth="0$nummonth" ;;
           esac
       fi
  -    
  +
       #   Optionally use digits for month
       if [ ".$opt_d" = .yes ]; then
           month="$nummonth"
       fi
  -    
  +
       #   Optionally shorten the month name to three characters
       if [ ".$opt_s" = .yes ]; then
           month=`echo $month | cut -c1-3`
       fi
  -    
  +
       #   Output the resulting date string
       echo dummy | awk '{
           for (i = 0; i < 3; i++) {
  @@ -1025,15 +1026,16 @@
               printf("\n");
       }' "day=$day" "month=$month" "year=$year" \
          "field=$opt_f" "order=$opt_o" "newline=$opt_n"
  +
  +    shtool_exit 0
       ;;
   
   table )
       ##
       ##  table -- Pretty-print a field-separated list as a table
       ##  Copyright (c) 1998-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for Apache
       ##
  -    
  +
       if [ $opt_c -gt 4 ]; then
           echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2
           shtool_exit 1
  @@ -1042,7 +1044,7 @@
           x? ) ;;
           *  ) echo "$msgprefix:Error: Invalid separator (one char allowed only)" 
1>&2; shtool_exit 1 ;;
       esac
  -    
  +
       #   split the list into a table
       list=`
           IFS="$opt_F"
  @@ -1067,7 +1069,7 @@
               END { print list; }
            "
       `
  -    
  +
       #   format table cells and make sure table
       #   doesn't exceed maximum width
       OIFS="$IFS"
  @@ -1089,15 +1091,16 @@
           }
       }"
       IFS="$OIFS"
  +
  +    shtool_exit 0
       ;;
   
   prop )
       ##
       ##  prop -- Display progress with a running propeller
       ##  Copyright (c) 1998-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for mod_ssl
       ##
  -    
  +
       perl=''
       for dir in `echo $PATH | sed -e 's/:/ /g'` .; do
           if [ -f "$dir/perl" ]; then
  @@ -1134,18 +1137,19 @@
               }
           ' "prefix=$opt_p"
       fi
  +
  +    shtool_exit 0
       ;;
   
   move )
       ##
       ##  move -- Move files with simultaneous substitution
       ##  Copyright (c) 1999-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for shtool
       ##
  -    
  +
       src="$1"
       dst="$2"
  -    
  +
       #   consistency checks
       if [ ".$src" = . ] || [ ".$dst" = . ]; then
           echo "$msgprefix:Error: Invalid arguments" 1>&2
  @@ -1178,13 +1182,13 @@
               shtool_exit 1
           fi
       fi
  -    
  +
       #   determine substitution patterns
       if [ ".$opt_e" = .yes ]; then
           srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 
's;\\*;\\\\(.*\\\\);g'`
           dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'`
       fi
  -    
  +
       #   iterate over source(s)
       for onesrc in $expsrc; do
           if [ .$opt_e = .yes ]; then
  @@ -1225,6 +1229,7 @@
               break;
           fi
       done
  +
       shtool_exit $errorstatus
       ;;
   
  @@ -1232,9 +1237,8 @@
       ##
       ##  install -- Install a program, script or datafile
       ##  Copyright (c) 1997-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for shtool
       ##
  -    
  +
       #   special case: "shtool install -d <dir> [...]" internally
       #   maps to "shtool mkdir -f -p -m 755 <dir> [...]"
       if [ "$opt_d" = yes ]; then
  @@ -1256,7 +1260,7 @@
           done
           shtool_exit 0
       fi
  -    
  +
       #   determine source(s) and destination
       argc=$#
       srcs=""
  @@ -1265,30 +1269,30 @@
           shift
       done
       dstpath="$1"
  -    
  +
       #   type check for destination
       dstisdir=0
       if [ -d $dstpath ]; then
           dstpath=`echo "$dstpath" | sed -e 's:/$::'`
           dstisdir=1
       fi
  -    
  +
       #   consistency check for destination
       if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then
           echo "$msgprefix:Error: multiple sources require destination to be 
directory" 1>&2
           shtool_exit 1
       fi
  -    
  +
       #   iterate over all source(s)
       for src in $srcs; do
           dst=$dstpath
  -    
  +
           #   if destination is a directory, append the input filename
           if [ $dstisdir = 1 ]; then
               dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
               dst="$dst/$dstfile"
           fi
  -    
  +
           #   check for correct arguments
           if [ ".$src" = ".$dst" ]; then
               echo "$msgprefix:Warning: source and destination are the same - 
skipped" 1>&2
  @@ -1298,17 +1302,17 @@
               echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2
               continue
           fi
  -    
  +
           #   make a temp file name in the destination directory
           dsttmp=`echo $dst |\
                   sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \
                       -e "s;\$;/[EMAIL PROTECTED];"`
  -    
  +
           #   verbosity
           if [ ".$opt_v" = .yes ]; then
               echo "$src -> $dst" 1>&2
           fi
  -    
  +
           #   copy or move the file name to the temp name
           #   (because we might be not allowed to change the source)
           if [ ".$opt_C" = .yes ]; then
  @@ -1325,7 +1329,7 @@
               fi
               mv $src $dsttmp || shtool_exit $?
           fi
  -    
  +
           #   adjust the target file
           if [ ".$opt_e" != . ]; then
               sed='sed'
  @@ -1363,7 +1367,7 @@
               fi
               chmod $opt_m $dsttmp || shtool_exit $?
           fi
  -    
  +
           #   determine whether to do a quick install
           #   (has to be done _after_ the strip was already done)
           quick=no
  @@ -1374,7 +1378,7 @@
                   fi
               fi
           fi
  -    
  +
           #   finally, install the file to the real destination
           if [ $quick = yes ]; then
               if [ ".$opt_t" = .yes ]; then
  @@ -1388,16 +1392,16 @@
               rm -f $dst && mv $dsttmp $dst
           fi
       done
  +
  +    shtool_exit 0
       ;;
   
   mkdir )
       ##
       ##  mkdir -- Make one or more directories
       ##  Copyright (c) 1996-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for public domain by Noah Friedman <[EMAIL PROTECTED]>
  -    ##  Cleaned up and enhanced for shtool
       ##
  -    
  +
       errstatus=0
       for p in ${1+"$@"}; do
           #   if the directory already exists...
  @@ -1476,16 +1480,16 @@
               done
           fi
       done
  +
       shtool_exit $errstatus
       ;;
   
   mkln )
       ##
       ##  mkln -- Make link with calculation of relative paths
  -    ##  Copyright (c) 1999-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for shtool
  +    ##  Copyright (c) 1998-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
       ##
  -    
  +
       #   determine source(s) and destination
       args=$?
       srcs=""
  @@ -1500,7 +1504,7 @@
               shtool_exit 1
           fi
       fi
  -    
  +
       #   determine link options
       lnopt=""
       if [ ".$opt_f" = .yes ]; then
  @@ -1509,7 +1513,7 @@
       if [ ".$opt_s" = .yes ]; then
           lnopt="$lnopt -s"
       fi
  -    
  +
       #   iterate over sources
       for src in $srcs; do
           #   determine if one of the paths is an absolute path,
  @@ -1523,7 +1527,7 @@
           case $dst in
               /* ) oneisabs=1; dstisabs=1 ;;
           esac
  -    
  +
           #   split source and destination into dir and base name
           if [ -d $src ]; then
               srcdir=`echo $src | sed -e 's;/*$;;'`
  @@ -1539,7 +1543,7 @@
               dstdir=`echo  $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 
's;\(.\)/$;\1;'`
               dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'`
           fi
  -    
  +
           #   consistency check
           if [ ".$dstdir" != . ]; then
               if [ ! -d $dstdir ]; then
  @@ -1547,7 +1551,7 @@
                   shtool_exit 1
               fi
           fi
  -    
  +
           #   make sure the source is reachable from the destination
           if [ $dstisabs = 1 ]; then
               if [ $srcisabs = 0 ]; then
  @@ -1562,7 +1566,7 @@
                   fi
               fi
           fi
  -    
  +
           #   split away a common prefix
           prefix=""
           if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then
  @@ -1581,14 +1585,14 @@
                   dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'`
               done
           fi
  -    
  +
           #   destination prefix is just the common prefix
           dstpre="$prefix"
  -    
  +
           #   determine source prefix which is the reverse directory
           #   step-up corresponding to the destination directory
           srcpre=""
  -    
  +
           isroot=0
           if [ ".$prefix" = . ] || [ ".$prefix" = ./ ]; then
               isroot=1
  @@ -1607,7 +1611,7 @@
                   srcpre="$prefix"
               fi
           fi
  -    
  +
           #   determine destination symlink name
           if [ ".$dstbase" = . ]; then
               if [ ".$srcbase" != . ]; then
  @@ -1616,36 +1620,37 @@
                   dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 
's;.*/\([^/]*\)$;\1;'`
               fi
           fi
  -    
  +
           #   now finalize source and destination directory paths
           srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'`
           dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'`
  -    
  +
           #   run the final link command
           if [ ".$opt_t" = .yes ]; then
               echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase"
           fi
           eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase
       done
  +
  +    shtool_exit 0
       ;;
   
   mkshadow )
       ##
       ##  mkshadow -- Make a shadow tree through symbolic links
       ##  Copyright (c) 1998-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for Apache
       ##
  -    
  +
       #   source and destination directory
       src=`echo "$1" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
       dst=`echo "$2" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
  -    
  +
       #   check whether source exists
       if [ ! -d $src ]; then
           echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2
           shtool_exit 1
       fi
  -    
  +
       #   determine if one of the paths is an absolute path,
       #   because then we have to use an absolute symlink
       oneisabs=0
  @@ -1655,7 +1660,7 @@
       case $dst in
           /* ) oneisabs=1 ;;
       esac
  -    
  +
       #   determine reverse directory for destination directory
       dstrevdir=''
       if [ $oneisabs = 0 ]; then
  @@ -1679,7 +1684,7 @@
       else
           src="`cd $src; pwd`";
       fi
  -    
  +
       #   create directory tree at destination
       if [ ! -d $dst ]; then
           if [ ".$opt_t" = .yes ]; then
  @@ -1700,7 +1705,7 @@
           fi
           mkdir $dst/$dir
       done
  -    
  +
       #   fill directory tree with symlinks to files
       if [ ".$opt_a" = .yes ]; then
           FILES="`cd $src; find . -depth -print |\
  @@ -1744,24 +1749,25 @@
            fi
            ln -s $from $to
       done
  +
  +    shtool_exit 0
       ;;
   
   fixperm )
       ##
       ##  fixperm -- Fix file permissions inside a source tree
       ##  Copyright (c) 1996-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for ePerl
       ##
  -    
  +
       paths="$*"
  -    
  +
       #   check whether the test command supports the -x option
       if [ -x /bin/sh ] 2>/dev/null; then
           minusx="-x"
       else
           minusx="-r"
       fi
  -    
  +
       #   iterate over paths
       for p in $paths; do
           for file in `find $p -depth -print`; do
  @@ -1800,21 +1806,22 @@
               fi
           done
       done
  +
  +    shtool_exit 0
       ;;
   
   rotate )
       ##
       ##  rotate -- Logfile rotation
       ##  Copyright (c) 2001-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for use in OpenPKG
       ##
  -    
  +
       #   make sure we have at least one file to rotate
       if [ ".$opt_n" = .0 ]; then
           echo "$msgprefix:Error: invalid argument \`$opt_n' to option -n." 1>&2
           shtool_exit 1
       fi
  -    
  +
       #   canonicalize -s option argument
       if [ ".$opt_s" != . ]; then
           if [ ".`expr $opt_s : '[0-9]*$'`" != .0 ]; then
  @@ -1833,13 +1840,13 @@
               shtool_exit 1
           fi
       fi
  -    
  +
       #   option -d/-z consistency
       if [ ".$opt_d" = .yes ] && [ ".$opt_z" = . ]; then
           echo "$msgprefix:Error: option -d requires option -z." 1>&2
           shtool_exit 1
       fi
  -    
  +
       #   make sure target directory exists
       if [ ".$opt_a" != . ]; then
           if [ ! -d $opt_a ]; then
  @@ -1855,7 +1862,7 @@
               shtool_exit 1
           fi
       fi
  -    
  +
       #   determine compression approach
       if [ ".$opt_z" != . ]; then
           comp_lvl="$opt_z"
  @@ -1864,7 +1871,7 @@
               *:* ) eval `echo $comp_lvl |\
                           sed -e 's%^\(.*\):\(.*\)$%comp_prg="\1"; comp_lvl="\2"%'` ;;
           esac
  -    
  +
           #   compression level consistency
           case $comp_lvl in
               [0-9] )
  @@ -1873,7 +1880,7 @@
                   shtool_exit 1
                   ;;
           esac
  -    
  +
           #   determine a suitable compression tool
           if [ ".$comp_prg" = . ]; then
               #   check whether the test command supports the -x option
  @@ -1903,7 +1910,7 @@
                   shtool_exit 1
               fi
           fi
  -    
  +
           #   determine standard compression extension
           #   and make sure it is a known tool
           case $comp_prg in
  @@ -1916,7 +1923,7 @@
           esac
           comp_suf=".$comp_ext"
       fi
  -    
  +
       #   iterate over all given logfile arguments
       for file in $*; do
           #   make sure the logfile exists
  @@ -1927,13 +1934,13 @@
               echo "$msgprefix:Error: logfile \`$file' not found" 1>&2
               shtool_exit 1
           fi
  -    
  +
           #   determine log directory (where original logfile is placed)
           ldir="."
           case $file in
               */* ) eval `echo $file | sed -e 's%^\(.*\)/\([^/]*\)$%ldir="\1"; 
file="\2";%'` ;;
           esac
  -    
  +
           #   determine archive directory (where rotated logfiles are placed)
           adir="$ldir"
           if [ ".$opt_a" != . ]; then
  @@ -1942,7 +1949,7 @@
                   * ) adir="$ldir/$opt_a"  ;;
               esac
           fi
  -    
  +
           #   optionally take logfile size into account
           if [ ".$opt_s" != . ]; then
               #   determine size of logfile
  @@ -1950,7 +1957,7 @@
                       sed -e 's; -> .*$;;' -e 's;[     ][      ]*; ;g'`
               n=`expr $# - 3`
               eval "size=\`echo \${$n}\`"
  -    
  +
               #   skip logfile if size is still too small
               if [ $size -lt $opt_s ]; then
                   if [ ".$opt_v" = .yes ]; then
  @@ -1959,12 +1966,12 @@
                   continue
               fi
           fi
  -    
  +
           #   verbosity
           if [ ".$opt_v" = .yes ]; then
               echo "rotating $ldir/$file"
           fi
  -    
  +
           #   execute prolog
           if [ ".$opt_P" != . ]; then
               if [ ".$opt_t" = .yes ]; then
  @@ -1973,7 +1980,7 @@
               eval $opt_P
               [ $? -ne 0 ] && shtool_exit $?
           fi
  -    
  +
           #   kick away out-rotated logfile
           n=`expr $opt_n - 1`
           n=`echo dummy | awk "{ printf(\"%0${opt_p}d\", n); }" n=$n`
  @@ -1992,7 +1999,7 @@
               fi
               rm -f ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
           fi
  -    
  +
           #   rotate already archived logfiles
           while [ $n -gt 0 ]; do
               m=$n
  @@ -2003,7 +2010,7 @@
                   if [ ! -f "${adir}/${file}.${n}" ]; then
                       continue
                   fi
  -    
  +
                   #   compress file (delayed)
                   if [ ".$opt_b" = .yes ]; then
                       if [ ".$opt_t" = .yes ]; then
  @@ -2030,7 +2037,7 @@
                       fi
                       rm -f ${adir}/${file}.${n} || shtool_exit $?
                   fi
  -    
  +
                   #   fix file attributes
                   if [ ".$opt_o" != . ]; then
                       if [ ".$opt_t" = .yes ]; then
  @@ -2061,7 +2068,7 @@
                   mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf} 
|| shtool_exit $?
               fi
           done
  -    
  +
           #   move away current logfile
           if [ ".$opt_c" = .yes ]; then
               #   approach: copy[+truncate]
  @@ -2107,7 +2114,7 @@
                   fi
               fi
           fi
  -    
  +
           #   regular compression step
           if [ ".$opt_z" != . ] && [ ".$opt_d" = .no ]; then
               #   compress file
  @@ -2132,7 +2139,7 @@
                   fi
                   rm -f ${adir}/${file}.${n} || shtool_exit $?
               fi
  -    
  +
               #   fix file attributes
               if [ ".$opt_o" != . ]; then
                   if [ ".$opt_t" = .yes ]; then
  @@ -2153,7 +2160,7 @@
                   chmod $opt_m ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
               fi
           fi
  -    
  +
           #   execute epilog
           if [ ".$opt_E" != . ]; then
               if [ ".$opt_t" = .yes ]; then
  @@ -2163,24 +2170,25 @@
               [ $? -ne 0 ] && shtool_exit $?
           fi
       done
  +
  +    shtool_exit 0
       ;;
   
   tarball )
       ##
       ##  tarball -- Roll distribution tarballs
       ##  Copyright (c) 1999-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for shtool
       ##
  -    
  +
       srcs="$*"
  -    
  +
       #   check whether the test command supports the -x option
       if [ -x /bin/sh ] 2>/dev/null; then
           minusx="-x"
       else
           minusx="-r"
       fi
  -    
  +
       #   find the tools
       paths="`echo $PATH |\
               sed -e 's%/*:%:%g' -e 's%/*$%%' \
  @@ -2205,7 +2213,7 @@
               fi
           done
       done
  -    
  +
       #   expand source paths
       exclude=''
       for pat in `echo $opt_e | sed 's/,/ /g'`; do
  @@ -2234,7 +2242,7 @@
       if [ ".$opt_v" = .yes ]; then
           cat $tmpfile.lst | sed -e 's/^/  /' 1>&2
       fi
  -    
  +
       #   determine tarball file and directory name
       if [ ".$opt_o" != . ]; then
           tarfile="$opt_o"
  @@ -2253,7 +2261,7 @@
           fi
           tarfile="$tarname.tar"
       fi
  -    
  +
       #   roll the tarball
       compress=''
       if [ ".$opt_c" != . ]; then
  @@ -2320,24 +2328,25 @@
           fi
           rm -rf $tmpdir/$tarname
       fi
  -    
  +
       #   cleanup
       if [ ".$opt_t" = .yes ]; then
           echo "rm -f $tmpfile.lst $tmpfile.out" 1>&2
       fi
       rm -f $tmpfile.lst $tmpfile.out
  +
  +    shtool_exit 0
       ;;
   
   subst )
       ##
       ##  subst -- Apply sed(1) substitution operations
       ##  Copyright (c) 2001-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for OpenPKG's rpmtool
       ##
  -    
  +
       #   remember optional list of file(s)
       files="$*"
  -    
  +
       #   parameter consistency check
       if [ $# -eq 0 ] && [ ".$opt_b" != . ]; then
           echo "$msgprefix:Error: option -b cannot be applied to stdin" 1>&2
  @@ -2347,14 +2356,14 @@
           echo "$msgprefix:Error: option -s cannot be applied to stdin" 1>&2
           shtool_exit 1
       fi
  -    
  +
       #   build underlying sed(1) command
       sedcmd='sed'
       if [ ".$opt_e" != . ]; then
           OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS"
           for e
           do
  -            sedcmd="$sedcmd -e '$e'" 
  +            sedcmd="$sedcmd -e '$e'"
           done
       elif [ ".$opt_f" != . ]; then
           if [ ! -f $opt_f ]; then
  @@ -2366,13 +2375,13 @@
           echo "$msgprefix:Error: either -e option(s) or -f option required" 1>&2
           shtool_exit 1
       fi
  -    
  +
       #   determine extension for original file
       orig=".orig"
       if [ ".$opt_b" != . ]; then
           orig="$opt_b"
       fi
  -    
  +
       #   apply sed(1) operation(s)
       if [ ".$files" != . ]; then
           #   apply operation(s) to files
  @@ -2382,7 +2391,7 @@
                   echo "$msgprefix:Warning: file \`$file' not found or not a regular 
file" 1>&2
                   continue
               fi
  -    
  +
               #   handle interactive mode
               if [ ".$opt_i" = .yes ]; then
                   eval "$sedcmd <$file >$file.new"
  @@ -2416,7 +2425,7 @@
                       continue
                   fi
               fi
  -    
  +
               #   apply sed(1) operation(s)
               if [ ".$opt_v" = .yes ]; then
                   echo "patching \`$file'" 1>&2
  @@ -2431,7 +2440,7 @@
                   chmod u+w $file >/dev/null 2>&1 || true
                   eval "$sedcmd <$file$orig >$file"
               fi
  -    
  +
               #   optionally fix timestamp
               if [ ".$opt_s" = .yes ]; then
                   if [ ".$opt_t" = .yes ]; then
  @@ -2441,7 +2450,7 @@
                       touch -r $file$orig $file
                   fi
               fi
  -    
  +
               #   optionally remove preserved original file
               if [ ".$opt_b" = . ]; then
                   if [ ".$opt_t" = .yes ]; then
  @@ -2464,15 +2473,16 @@
               eval "$sedcmd"
           fi
       fi
  +
  +    shtool_exit 0
       ;;
   
   platform )
       ##
       ##  platform -- Platform Identification Utility
       ##  Copyright (c) 2003-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for use in OpenPKG
       ##
  -    
  +
       #   option post-processing
       if [ ".$opt_t" != . ]; then
           case "$opt_t" in
  @@ -2537,7 +2547,7 @@
                   ;;
           esac
       fi
  -    
  +
       #   assemble initial platform information
       UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\
       UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\
  @@ -2547,15 +2557,15 @@
       UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\
       UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\
       UNAME_RELEASE='unknown'
  -    
  +
       UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}"
  -    
  +
       AC=""; AP=""; AT=""
       SC=""; SP=""; ST=""
  -    
  +
       #    dispatch into platform specific sections
       case "${UNAME}" in
  -    
  +
           #   FreeBSD
           *:FreeBSD:* )
               #   determine architecture
  @@ -2581,7 +2591,7 @@
                   *   ) SC="4.4BSD" ;;
               esac
               ;;
  -    
  +
           #   NetBSD
           *:NetBSD:* )
               #   determine architecture
  @@ -2600,7 +2610,7 @@
                   *   ) SC="4.4BSD" ;;
               esac
               ;;
  -    
  +
           #   OpenBSD
           *:OpenBSD:* )
               #   determine architecture
  @@ -2616,7 +2626,7 @@
               SP="${ST}"
               SC="4.4BSD"
               ;;
  -    
  +
           #   GNU/Linux
           *:Linux:* )
               #   determine architecture
  @@ -2690,7 +2700,7 @@
               [ ".$SP" = . ] && SP="${ST}"
               [ ".$SC" = . ] && SC="LSB"
               ;;
  -    
  +
           #   Sun Solaris
           *:SunOS:* )
               #   determine architecture
  @@ -2720,7 +2730,7 @@
                   5.* ) SC="SVR4"   ;;
               esac
               ;;
  -    
  +
           #   SCO UnixWare
           *:UnixWare:* )
               #   determine architecture
  @@ -2735,7 +2745,7 @@
               SP="${ST}"
               SC="SVR${UNAME_RELEASE}"
               ;;
  -    
  +
           #   QNX
           *:QNX:* )
               #   determine architecture
  @@ -2751,7 +2761,7 @@
               SP="QNX[ Neutrino RTOS] ${v}"
               SC="QNX"
               ;;
  -    
  +
           #   SGI IRIX
           *:IRIX*:* )
               #   determine architecture
  @@ -2769,7 +2779,7 @@
               SP="[SGI ]IRIX ${v}"
               SC="4.2BSD/SVR3"
               ;;
  -    
  +
           #   HP HP-UX
           *:HP-UX:* )
               #   determine architecture
  @@ -2806,7 +2816,7 @@
                   [7-9]* ) SC="SVR4"   ;;
               esac
               ;;
  -    
  +
           #   HP Tru64 (OSF1)
           *:OSF1:* )
               #   determine architecture
  @@ -2824,7 +2834,7 @@
               SP="${ST}"
               SC="OSF1"
               ;;
  -    
  +
           #   IBM AIX
           *:AIX:* )
               cpu_arch=rs6000
  @@ -2852,7 +2862,7 @@
                   *     ) SC="SVR4" ;;
               esac
               ;;
  -    
  +
           #   Apple MacOS X Darwin
           *:Darwin:* )
               AT=`uname -p`
  @@ -2868,12 +2878,12 @@
               SP="${ST}"
               SC="4.4BSD/Mach3"
               ;;
  -    
  +
           #   TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO
           # *:XXX:* )
           #   ...
           #   ;;
  -    
  +
           #   ...A STILL UNKNOWN PLATFORM...
           * )
               AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"`
  @@ -2889,9 +2899,9 @@
               SP="${ST}"
               SC="${SP}"
               ;;
  -    
  +
       esac
  -    
  +
       #   provide fallback values
       [ ".$AT" = . ] && AT="${AP:-${AC}}"
       [ ".$AP" = . ] && AP="${AT:-${AC}}"
  @@ -2899,14 +2909,14 @@
       [ ".$ST" = . ] && ST="${SP:-${SC}}"
       [ ".$SP" = . ] && SP="${ST:-${SC}}"
       [ ".$SC" = . ] && SC="${SP:-${ST}}"
  -    
  +
       #   support explicit enforced verbose/concise output
       if [ ".$opt_v" = .yes ]; then
           opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'`
       elif [ ".$opt_c" = .yes ]; then
           opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'`
       fi
  -    
  +
       #   provide verbose and concise variants
       AC_V=""; AC_N=""; AC_C=""
       AP_V=""; AP_N=""; AP_C=""
  @@ -2962,7 +2972,7 @@
               ;;
           esac
       done
  -    
  +
       #   create output string
       output=`echo ":$opt_F" |\
               sed -e "s/^://" \
  @@ -2992,34 +3002,35 @@
                   -e "s;%<st>;${ST_C};g" \
                   -e 's/\\\\n/^/g' |\
                tr '^' '\012'`
  -    
  +
       #   support lower/upper-case mapping
       if [ ".$opt_L" = .yes ]; then
           output=`util_lower "$output"`
       elif [ ".$opt_U" = .yes ]; then
           output=`util_upper "$output"`
       fi
  -    
  +
       #   display output string
       if [ ".$opt_n" = .yes ]; then
           echo . | awk '{ printf("%s", output); }' output="$output"
       else
           echo "$output"
       fi
  +
  +    shtool_exit 0
       ;;
   
   arx )
       ##
       ##  arx -- Extended archive command
       ##  Copyright (c) 1999-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for shtool
       ##
  -    
  +
       ar_prg="$opt_C"
       ar_cmd="$1"; shift
       archive="$1"; shift
       files="$*"
  -    
  +
       #   walk through the file list and expand archives members
       tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'`
       nfiles=''
  @@ -3066,7 +3077,7 @@
               esac
           done
       fi
  -    
  +
       #   run the final archive command
       if [ ".$opt_t" = .yes ]; then
           echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2
  @@ -3076,7 +3087,7 @@
           echo "$msgprefix:Error: archive command failed" 1>&2
           shtool_exit $?
       fi
  -    
  +
       #   cleanup and die gracefully
       if [ -d $tmpdir ]; then
           if [ ".$opt_t" = .yes ]; then
  @@ -3084,17 +3095,18 @@
           fi
           rm -rf $tmpdir
       fi
  +
  +    shtool_exit 0
       ;;
   
   slo )
       ##
       ##  slo -- Separate linker options by library class
       ##  Copyright (c) 1998-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for Apache
       ##
  -    
  +
       DIFS="$IFS"
  -    
  +
       #   parse out -L and -l options from command line
       DIRS=''
       LIBS=''
  @@ -3122,13 +3134,13 @@
                *) ARGV="$ARGV $opt" ;;
           esac
       done
  -    
  +
       #   set linker default directories
       DIRS_DEFAULT='/lib:/usr/lib'
       if [ ".$LD_LIBRARY_PATH" != . ]; then
           DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH"
       fi
  -    
  +
       #   sort options by class
       DIRS_OBJ=''
       LIBS_OBJ=''
  @@ -3136,24 +3148,24 @@
       LIBS_PIC=''
       DIRS_DSO=''
       LIBS_DSO=''
  -    
  +
       #    for each library...
       OIFS="$IFS"; IFS=':'
       for lib in $LIBS; do
           [ ".$lib" = . ] && continue
  -    
  +
           found='no'
           found_indefdir='no'
           found_type=''
           found_dir=''
  -    
  +
           #    for each directory...
           OIFS2="$IFS"; IFS=":$DIFS"
           for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do
               [ ".$dir" = . ] && continue
               [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes
               [ ! -d $dir ] && continue
  -    
  +
               #    search the file
               OIFS3="$IFS"; IFS="$DIFS"
               for file in '' `cd $dir && env -i /bin/ls lib${lib}.* 2>/dev/null`; do
  @@ -3183,7 +3195,7 @@
               fi
           done
           IFS="$OIFS2"
  -    
  +
           if [ ".$found" = .yes ]; then
               if [ ".$found_indefdir" != .yes ]; then
                   eval "dirlist=\"\${DIRS_${found_type}}:\""
  @@ -3203,7 +3215,7 @@
           fi
       done
       IFS="$OIFS"
  -    
  +
       #   also pass-through unused dirs even if it's useless
       OIFS="$IFS"; IFS=':'
       for dir in $DIRS; do
  @@ -3214,7 +3226,7 @@
           esac
       done
       IFS="$OIFS"
  -    
  +
       #   reassemble the options but separated by type
       for type in OBJ PIC DSO; do
           OIFS="$IFS"; IFS=':'
  @@ -3225,7 +3237,7 @@
               opts="$opts -l$lib"
           done
           eval "LIBS_${type}=\"$opts\""
  -    
  +
           eval "dirs=\"\$DIRS_${type}\""
           opts=''
           for dir in $dirs; do
  @@ -3235,25 +3247,26 @@
           eval "DIRS_${type}=\"$opts\""
           IFS="$OIFS"
       done
  -    
  +
       #   give back results
       for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do
           eval "val=\"\$${var}\""
           val="`echo $val | sed -e 's/^ *//'`"
           echo "${opt_p}${var}=\"${val}\""
       done
  +
  +    shtool_exit 0
       ;;
   
   scpp )
       ##
       ##  scpp -- Sharing C Pre-Processor
       ##  Copyright (c) 1999-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for GNU Pth
       ##
  -    
  +
       srcs="$*"
       output="${opt_o}.n"
  -    
  +
       #   find a reasonable Awk
       awk=''
       paths=`echo $PATH |\
  @@ -3275,7 +3288,7 @@
           echo "$msgprefix:Error: cannot find a reasonable Awk" 1>&2
           shtool_exit 1
       fi
  -    
  +
       #   parse source file(s)
       if [ ".$opt_v" = .yes ]; then
           echo "Parsing:" | $awk '{ printf("%s", $0); }' 1>&2
  @@ -3369,23 +3382,23 @@
       if [ ".$opt_v" = .yes ]; then
           echo "" 1>&2
       fi
  -    
  +
       #   start generating output header
       echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output
       echo "#line 1 \"$opt_t\"" >>$output
       sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\
       sed -e "/^${opt_M} *\$/d" >>$output
  -    
  +
       #   merge in the define blocks
       grep '^D:' $tmpfile | sed -e 's/^D://' >>$output
  -    
  +
       #   generate standard prolog
       echo "#line 1 \"_ON_THE_FLY_\"" >>$output
       echo "" >>$output
       echo "/* make sure the scpp source extensions are skipped */" >>$output
       echo "#define $opt_D 0" >>$output
       echo "#define $opt_C /**/" >>$output
  -    
  +
       #   generate namespace hiding for variables
       echo "" >>$output
       echo "/* move intern variables to hidden namespace */" >>$output
  @@ -3396,7 +3409,7 @@
           -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \
           -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \
           -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/'
  -    
  +
       #   generate namespace hiding for functions
       echo "" >>$output
       echo "/* move intern functions to hidden namespace */" >>$output
  @@ -3405,7 +3418,7 @@
           -e 's/\([ (]\) */\1/g' \
           -e 's/ *\([),]\)/\1/g' \
           -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/'
  -    
  +
       #   generate prototypes for variables
       echo "" >>$output
       echo "/* prototypes for intern variables */" >>$output
  @@ -3418,7 +3431,7 @@
           -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \
           -e 's/ ;/;/g' \
           -e "s/^$opt_C /extern /"
  -    
  +
       #   generate prototypes for functions
       echo "" >>$output
       echo "/* prototypes for intern functions */" >>$output
  @@ -3432,14 +3445,14 @@
           -e 's/\([ (]\) */\1/g' \
           -e 's/ *\([),]\)/\1/g' \
           -e "s/^$opt_C /extern /"
  -    
  +
       #   finish generating output header
       n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\
          wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'`
       echo "#line $n \"$opt_t\"" >>$output
       sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\
       sed -e "/^${opt_M} *\$/d" >>$output
  -    
  +
       #   create final output file
       if [ -f $opt_o ]; then
           if [ ".$opt_p" = .yes ]; then
  @@ -3461,21 +3474,22 @@
       fi
       rm -f $output
       rm -f $tmpfile $tmpfile.* >/dev/null 2>&1
  +
  +    shtool_exit 0
       ;;
   
   version )
       ##
       ##  version -- Maintain a version information file
       ##  Copyright (c) 1994-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for ePerl, rewritten from scratch for shtool
       ##
  -    
  +
       file="$1"
  -    
  +
       #   determine prefix and name
       name="$opt_n"
       prefix="$opt_p"
  -    
  +
       #   determine current version
       triple="$opt_s"
       if [ ".$triple" != . ]; then
  @@ -3501,7 +3515,7 @@
           lev=0
           tim=calc
       fi
  -    
  +
       #   determine new version in batch
       if [ ".$opt_i" != . ]; then
           case $opt_i in
  @@ -3520,7 +3534,7 @@
           esac
           tim=calc
       fi
  -    
  +
       #   determine new version interactively
       if [ ".$opt_e" = .yes ]; then
           echo "old version: ${ver}.${rev}${typ}${lev}"
  @@ -3541,7 +3555,7 @@
                 ver="\1";rev="\2";typ="\3";lev="\4"%'`
           tim=calc
       fi
  -    
  +
       #   determine hexadecimal and libtool value of version
       case $typ in
           a     ) typnum=0;  levnum=$lev ;;
  @@ -3554,7 +3568,7 @@
            tr 'abcdef' 'ABCDEF'`
       ltv=`echo "$ver:$rev:$typnum:$levnum" |\
            awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'`
  -    
  +
       #   determine date
       if [ ".$tim" = .calc ]; then
           day=`date '+%d'`
  @@ -3583,7 +3597,7 @@
           esac
           tim="${day}-${month}-${year}"
       fi
  -    
  +
       #   perform result actions
       mode=show
       if [ ".$opt_i" != . ]; then
  @@ -3614,7 +3628,7 @@
           esac
       else
           #   update the version file
  -    
  +
           #   pre-generate various strings
           triple="${ver}.${rev}${typ}${lev}"
           vHex="$hex"
  @@ -3625,20 +3639,20 @@
           vWeb="${name}/${triple}"
           vSCCS="@(#)${name} ${triple} (${tim})"
           vRCS="\$Id: ${name} ${triple} (${tim}) \$"
  -    
  +
           #   determine string out of filename
           #   (do NOT try to optimize this in any way because of portability)
           filestr=`echo $file |\
                    tr 'abcdefghijklmnopqrstuvwxyz./%+' \
                       'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'`
  -    
  +
           #   generate uppercase prefix
           prefixupper=`echo $prefix |\
                        tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  -    
  +
           #   create the version file according the the selected language
           echo "new version: ${vLong}"
  -    
  +
           cp /dev/null $file
           case $opt_l in
               txt )
  @@ -3739,31 +3753,32 @@
                   ;;
           esac
       fi
  +
  +    shtool_exit 0
       ;;
   
   path )
       ##
       ##  path -- Deal with program paths
       ##  Copyright (c) 1998-2004 Ralf S. Engelschall <[EMAIL PROTECTED]>
  -    ##  Originally written for Apache
       ##
  -    
  +
       namelist="$*"
  -    
  +
       #   check whether the test command supports the -x option
       if [ -x /bin/sh ] 2>/dev/null; then
           minusx="-x"
       else
           minusx="-r"
       fi
  -    
  +
       #   split path string
       paths="`echo $opt_p |\
               sed -e 's/^:/.:/' \
                   -e 's/::/:.:/g' \
                   -e 's/:$/:./' \
                   -e 's/:/ /g'`"
  -    
  +
       #   SPECIAL REQUEST
       #   translate forward to reverse path
       if [ ".$opt_r" = .yes ]; then
  @@ -3778,7 +3793,7 @@
           echo $rp | sed -e 's:/$::'
           shtool_exit 0
       fi
  -    
  +
       #   SPECIAL REQUEST
       #   strip out directory or base name
       if [ ".$opt_d" = .yes ]; then
  @@ -3791,7 +3806,7 @@
           sed -e 's;.*/\([^/]*\)$;\1;'
           shtool_exit 0
       fi
  -    
  +
       #   MAGIC SITUATION
       #   Perl Interpreter (perl)
       if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then
  @@ -3822,7 +3837,7 @@
           rm -f $tmpfile >/dev/null 2>&1
           shtool_exit 1
       fi
  -    
  +
       #   MAGIC SITUATION
       #   C pre-processor (cpp)
       if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then
  @@ -3864,7 +3879,7 @@
           fi
           shtool_exit 1
       fi
  -    
  +
       #   STANDARD SITUATION
       #   iterate over names
       for name in $namelist; do
  @@ -3879,6 +3894,7 @@
               fi
           done
       done
  +
       shtool_exit 1
       ;;
   
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to