openpkg/shtool

changeset 743
51daf2b49ad7
parent 13
cb59d6afeb61
equal deleted inserted replaced
0:08f81b4ba326 1:23b3b68f1d24
1 #!/bin/sh 1 #!/bin/sh
2 ## 2 ##
3 ## GNU shtool -- The GNU Portable Shell Tool 3 ## GNU shtool -- The GNU Portable Shell Tool
4 ## Copyright (c) 1994-2007 Ralf S. Engelschall <rse@engelschall.com> 4 ## Copyright (c) 1994-2008 Ralf S. Engelschall <rse@engelschall.com>
5 ## 5 ##
6 ## See http://www.gnu.org/software/shtool/ for more information. 6 ## See http://www.gnu.org/software/shtool/ for more information.
7 ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. 7 ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
8 ## 8 ##
9 ## Version: 2.0.7 (19-May-2007) 9 ## Version: 2.0.8 (18-Jul-2008)
10 ## Contents: all available modules 10 ## Contents: all available modules
11 ## 11 ##
12 12
13 ## 13 ##
14 ## This program is free software; you can redistribute it and/or modify 14 ## This program is free software; you can redistribute it and/or modify
88 echo "$0:Error: invalid command line" 1>&2 88 echo "$0:Error: invalid command line" 1>&2
89 echo "$0:Hint: run \`$0 -h' for usage" 1>&2 89 echo "$0:Hint: run \`$0 -h' for usage" 1>&2
90 exit 1 90 exit 1
91 fi 91 fi
92 if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then 92 if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
93 echo "This is GNU shtool, version 2.0.7 (19-May-2007)" 93 echo "This is GNU shtool, version 2.0.8 (18-Jul-2008)"
94 echo 'Copyright (c) 1994-2007 Ralf S. Engelschall <rse@engelschall.com>' 94 echo 'Copyright (c) 1994-2008 Ralf S. Engelschall <rse@engelschall.com>'
95 echo 'Report bugs to <bug-shtool@gnu.org>' 95 echo 'Report bugs to <bug-shtool@gnu.org>'
96 echo '' 96 echo ''
97 echo 'Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]' 97 echo 'Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]'
98 echo '' 98 echo ''
99 echo 'Available global <options>:' 99 echo 'Available global <options>:'
155 echo ' [-m|--magic] [-p|--path <path>] <str> [<str> ...]' 155 echo ' [-m|--magic] [-p|--path <path>] <str> [<str> ...]'
156 echo '' 156 echo ''
157 exit 0 157 exit 0
158 fi 158 fi
159 if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then 159 if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then
160 echo "GNU shtool 2.0.7 (19-May-2007)" 160 echo "GNU shtool 2.0.8 (18-Jul-2008)"
161 exit 0 161 exit 0
162 fi 162 fi
163 if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then 163 if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then
164 shtoolize -oshtool all 164 shtoolize -oshtool all
165 exit 0 165 exit 0
645 case $tool in 645 case $tool in
646 646
647 echo ) 647 echo )
648 ## 648 ##
649 ## echo -- Print string with optional construct expansion 649 ## echo -- Print string with optional construct expansion
650 ## Copyright (c) 1998-2007 Ralf S. Engelschall <rse@engelschall.com> 650 ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
651 ## 651 ##
652 652
653 text="$*" 653 text="$*"
654 654
655 # check for broken escape sequence expansion 655 # check for broken escape sequence expansion
956 956
957 mdate ) 957 mdate )
958 ## 958 ##
959 ## mdate -- Pretty-print modification time of a file or dir 959 ## mdate -- Pretty-print modification time of a file or dir
960 ## Copyright (c) 1995-1997 Free Software Foundation, Inc. 960 ## Copyright (c) 1995-1997 Free Software Foundation, Inc.
961 ## Copyright (c) 1998-2007 Ralf S. Engelschall <rse@engelschall.com> 961 ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
962 ## 962 ##
963 963
964 fod="$1" 964 fod="$1"
965 case "$opt_o" in 965 case "$opt_o" in
966 [dmy][dmy][dmy] ) 966 [dmy][dmy][dmy] )
1084 ;; 1084 ;;
1085 1085
1086 table ) 1086 table )
1087 ## 1087 ##
1088 ## table -- Pretty-print a field-separated list as a table 1088 ## table -- Pretty-print a field-separated list as a table
1089 ## Copyright (c) 1998-2007 Ralf S. Engelschall <rse@engelschall.com> 1089 ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
1090 ## 1090 ##
1091 1091
1092 if [ $opt_c -gt 4 ]; then 1092 if [ $opt_c -gt 4 ]; then
1093 echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2 1093 echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2
1094 shtool_exit 1 1094 shtool_exit 1
1149 ;; 1149 ;;
1150 1150
1151 prop ) 1151 prop )
1152 ## 1152 ##
1153 ## prop -- Display progress with a running propeller 1153 ## prop -- Display progress with a running propeller
1154 ## Copyright (c) 1998-2007 Ralf S. Engelschall <rse@engelschall.com> 1154 ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
1155 ## 1155 ##
1156 1156
1157 perl='' 1157 perl=''
1158 for dir in `echo $PATH | sed -e 's/:/ /g'` .; do 1158 for dir in `echo $PATH | sed -e 's/:/ /g'` .; do
1159 if [ -f "$dir/perl" ]; then 1159 if [ -f "$dir/perl" ]; then
1195 ;; 1195 ;;
1196 1196
1197 move ) 1197 move )
1198 ## 1198 ##
1199 ## move -- Move files with simultaneous substitution 1199 ## move -- Move files with simultaneous substitution
1200 ## Copyright (c) 1999-2007 Ralf S. Engelschall <rse@engelschall.com> 1200 ## Copyright (c) 1999-2008 Ralf S. Engelschall <rse@engelschall.com>
1201 ## 1201 ##
1202 1202
1203 src="$1" 1203 src="$1"
1204 dst="$2" 1204 dst="$2"
1205 1205
1287 ;; 1287 ;;
1288 1288
1289 install ) 1289 install )
1290 ## 1290 ##
1291 ## install -- Install a program, script or datafile 1291 ## install -- Install a program, script or datafile
1292 ## Copyright (c) 1997-2007 Ralf S. Engelschall <rse@engelschall.com> 1292 ## Copyright (c) 1997-2008 Ralf S. Engelschall <rse@engelschall.com>
1293 ## 1293 ##
1294 1294
1295 # special case: "shtool install -d <dir> [...]" internally 1295 # special case: "shtool install -d <dir> [...]" internally
1296 # maps to "shtool mkdir -f -p -m 755 <dir> [...]" 1296 # maps to "shtool mkdir -f -p -m 755 <dir> [...]"
1297 if [ "$opt_d" = yes ]; then 1297 if [ "$opt_d" = yes ]; then
1450 ;; 1450 ;;
1451 1451
1452 mkdir ) 1452 mkdir )
1453 ## 1453 ##
1454 ## mkdir -- Make one or more directories 1454 ## mkdir -- Make one or more directories
1455 ## Copyright (c) 1996-2007 Ralf S. Engelschall <rse@engelschall.com> 1455 ## Copyright (c) 1996-2008 Ralf S. Engelschall <rse@engelschall.com>
1456 ## 1456 ##
1457 1457
1458 errstatus=0 1458 errstatus=0
1459 for p in ${1+"$@"}; do 1459 for p in ${1+"$@"}; do
1460 # if the directory already exists... 1460 # if the directory already exists...
1538 ;; 1538 ;;
1539 1539
1540 mkln ) 1540 mkln )
1541 ## 1541 ##
1542 ## mkln -- Make link with calculation of relative paths 1542 ## mkln -- Make link with calculation of relative paths
1543 ## Copyright (c) 1998-2007 Ralf S. Engelschall <rse@engelschall.com> 1543 ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
1544 ## 1544 ##
1545 1545
1546 # determine source(s) and destination 1546 # determine source(s) and destination
1547 args=$? 1547 args=$#
1548 srcs="" 1548 srcs=""
1549 while [ $# -gt 1 ]; do 1549 while [ $# -gt 1 ]; do
1550 srcs="$srcs $1" 1550 srcs="$srcs $1"
1551 shift 1551 shift
1552 done 1552 done
1626 prefix="$srcdir/" 1626 prefix="$srcdir/"
1627 srcdir="" 1627 srcdir=""
1628 dstdir="" 1628 dstdir=""
1629 else 1629 else
1630 while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do 1630 while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do
1631 presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` 1631 presrc=`echo $srcdir | sed -e 's;^\([^/][^/]*\)/.*;\1;'`
1632 predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` 1632 predst=`echo $dstdir | sed -e 's;^\([^/][^/]*\)/.*;\1;'`
1633 if [ ".$presrc" != ".$predst" ]; then 1633 if [ ".$presrc" != ".$predst" ]; then
1634 break 1634 break
1635 fi 1635 fi
1636 prefix="$prefix$presrc/" 1636 prefix="$prefix$presrc/"
1637 srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'` 1637 srcdir=`echo $srcdir | sed -e 's;^[^/][^/]*/*;;'`
1638 dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'` 1638 dstdir=`echo $dstdir | sed -e 's;^[^/][^/]*/*;;'`
1639 done 1639 done
1640 fi 1640 fi
1641 1641
1642 # destination prefix is just the common prefix 1642 # destination prefix is just the common prefix
1643 dstpre="$prefix" 1643 dstpre="$prefix"
1646 # step-up corresponding to the destination directory 1646 # step-up corresponding to the destination directory
1647 srcpre="" 1647 srcpre=""
1648 allow_relative_srcpre=no 1648 allow_relative_srcpre=no
1649 if [ ".$prefix" != . ] && [ ".$prefix" != ./ ]; then 1649 if [ ".$prefix" != . ] && [ ".$prefix" != ./ ]; then
1650 allow_relative_srcpre=yes 1650 allow_relative_srcpre=yes
1651 fi 1651 fi
1652 if [ $oneisabs = 0 ]; then 1652 if [ $oneisabs = 0 ]; then
1653 allow_relative_srcpre=yes 1653 allow_relative_srcpre=yes
1654 fi 1654 fi
1655 if [ ".$opt_s" != .yes ]; then 1655 if [ ".$opt_s" != .yes ]; then
1656 allow_relative_srcpre=no 1656 allow_relative_srcpre=no
1657 fi 1657 fi
1658 if [ ".$allow_relative_srcpre" = .yes ]; then 1658 if [ ".$allow_relative_srcpre" = .yes ]; then
1659 pl="$dstdir/" 1659 pl="$dstdir/"
1660 OIFS="$IFS"; IFS='/' 1660 OIFS="$IFS"; IFS='/'
1661 for pe in $pl; do 1661 for pe in $pl; do
1662 [ ".$pe" = . ] && continue 1662 [ ".$pe" = . ] && continue
1677 else 1677 else
1678 dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'` 1678 dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'`
1679 fi 1679 fi
1680 fi 1680 fi
1681 1681
1682 # special case (usually on "mkln -s /foo /foo/bar", etc)
1683 if [ ".$srcpre$srcdir$srcbase" = . ]; then
1684 srcdir="."
1685 fi
1686
1682 # now finalize source and destination directory paths 1687 # now finalize source and destination directory paths
1683 srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'` 1688 srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'`
1684 dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'` 1689 dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'`
1685 1690
1686 # run the final link command 1691 # run the final link command
1694 ;; 1699 ;;
1695 1700
1696 mkshadow ) 1701 mkshadow )
1697 ## 1702 ##
1698 ## mkshadow -- Make a shadow tree through symbolic links 1703 ## mkshadow -- Make a shadow tree through symbolic links
1699 ## Copyright (c) 1998-2007 Ralf S. Engelschall <rse@engelschall.com> 1704 ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
1700 ## 1705 ##
1701 1706
1702 # source and destination directory 1707 # source and destination directory
1703 src=`echo "$1" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'` 1708 src=`echo "$1" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
1704 dst=`echo "$2" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'` 1709 dst=`echo "$2" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
1812 ;; 1817 ;;
1813 1818
1814 fixperm ) 1819 fixperm )
1815 ## 1820 ##
1816 ## fixperm -- Fix file permissions inside a source tree 1821 ## fixperm -- Fix file permissions inside a source tree
1817 ## Copyright (c) 1996-2007 Ralf S. Engelschall <rse@engelschall.com> 1822 ## Copyright (c) 1996-2008 Ralf S. Engelschall <rse@engelschall.com>
1818 ## 1823 ##
1819 1824
1820 paths="$*" 1825 paths="$*"
1821 1826
1822 # check whether the test command supports the -x option 1827 # check whether the test command supports the -x option
1869 ;; 1874 ;;
1870 1875
1871 rotate ) 1876 rotate )
1872 ## 1877 ##
1873 ## rotate -- Logfile rotation 1878 ## rotate -- Logfile rotation
1874 ## Copyright (c) 2001-2007 Ralf S. Engelschall <rse@engelschall.com> 1879 ## Copyright (c) 2001-2008 Ralf S. Engelschall <rse@engelschall.com>
1875 ## 1880 ##
1876 1881
1877 # make sure we have at least one file to rotate 1882 # make sure we have at least one file to rotate
1878 if [ ".$opt_n" = .0 ]; then 1883 if [ ".$opt_n" = .0 ]; then
1879 echo "$msgprefix:Error: invalid argument \`$opt_n' to option -n." 1>&2 1884 echo "$msgprefix:Error: invalid argument \`$opt_n' to option -n." 1>&2
2030 echo "rotating $ldir/$file" 2035 echo "rotating $ldir/$file"
2031 fi 2036 fi
2032 2037
2033 # execute prolog 2038 # execute prolog
2034 if [ ".$opt_P" != . ]; then 2039 if [ ".$opt_P" != . ]; then
2040 # pass current log file name to prolog
2041 # prolog cannot be handed an argument as it may be
2042 # called as "prolog && something"
2043 SHTOOL_ROTATE_LOGFILE="$ldir/$file"
2044 export SHTOOL_ROTATE_LOGFILE
2035 if [ ".$opt_t" = .yes ]; then 2045 if [ ".$opt_t" = .yes ]; then
2036 echo "$opt_P" 2046 echo "$opt_P"
2037 fi 2047 fi
2038 eval $opt_P 2048 eval $opt_P
2039 [ $? -ne 0 ] && shtool_exit $? 2049 [ $? -ne 0 ] && shtool_exit $?
2219 fi 2229 fi
2220 fi 2230 fi
2221 2231
2222 # execute epilog 2232 # execute epilog
2223 if [ ".$opt_E" != . ]; then 2233 if [ ".$opt_E" != . ]; then
2234 # pass archive file name to epilog command
2235 # epilog cannot be handed an argument as it is often
2236 # called as "epilog && something"
2237 SHTOOL_ROTATE_LOGFILE="${adir}/${file}"
2238 export SHTOOL_ROTATE_LOGFILE
2224 if [ ".$opt_t" = .yes ]; then 2239 if [ ".$opt_t" = .yes ]; then
2225 echo "$opt_E" 2240 echo "$opt_E"
2226 fi 2241 fi
2227 eval $opt_E 2242 eval $opt_E
2228 [ $? -ne 0 ] && shtool_exit $? 2243 [ $? -ne 0 ] && shtool_exit $?
2233 ;; 2248 ;;
2234 2249
2235 tarball ) 2250 tarball )
2236 ## 2251 ##
2237 ## tarball -- Roll distribution tarballs 2252 ## tarball -- Roll distribution tarballs
2238 ## Copyright (c) 1999-2007 Ralf S. Engelschall <rse@engelschall.com> 2253 ## Copyright (c) 1999-2008 Ralf S. Engelschall <rse@engelschall.com>
2239 ## 2254 ##
2240 2255
2241 srcs="$*" 2256 srcs="$*"
2242 2257
2243 # check whether the test command supports the -x option 2258 # check whether the test command supports the -x option
2397 ;; 2412 ;;
2398 2413
2399 subst ) 2414 subst )
2400 ## 2415 ##
2401 ## subst -- Apply sed(1) substitution operations 2416 ## subst -- Apply sed(1) substitution operations
2402 ## Copyright (c) 2001-2007 Ralf S. Engelschall <rse@engelschall.com> 2417 ## Copyright (c) 2001-2008 Ralf S. Engelschall <rse@engelschall.com>
2403 ## 2418 ##
2404 2419
2405 # remember optional list of file(s) 2420 # remember optional list of file(s)
2406 files="$*" 2421 files="$*"
2407 files_num="$#" 2422 files_num="$#"
2509 if [ ".$opt_n" = .no ]; then 2524 if [ ".$opt_n" = .no ]; then
2510 touch -r $file$orig $file 2525 touch -r $file$orig $file
2511 fi 2526 fi
2512 fi 2527 fi
2513 2528
2514 # optionally check whether any content change actually occurred 2529 # optionally check whether any content change actually occurred
2515 if [ ".$opt_q" = .no ]; then 2530 if [ ".$opt_q" = .no ]; then
2516 if cmp $file$orig $file >/dev/null 2>&1; then 2531 if cmp $file$orig $file >/dev/null 2>&1; then
2517 if [ ".$opt_w" = .yes ]; then 2532 if [ ".$opt_w" = .yes ]; then
2518 echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2 2533 echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2
2519 fi 2534 fi
2558 ;; 2573 ;;
2559 2574
2560 platform ) 2575 platform )
2561 ## 2576 ##
2562 ## platform -- Platform Identification Utility 2577 ## platform -- Platform Identification Utility
2563 ## Copyright (c) 2003-2007 Ralf S. Engelschall <rse@engelschall.com> 2578 ## Copyright (c) 2003-2008 Ralf S. Engelschall <rse@engelschall.com>
2564 ## 2579 ##
2565 2580
2566 # option post-processing 2581 # option post-processing
2567 if [ ".$opt_t" != . ]; then 2582 if [ ".$opt_t" != . ]; then
2568 case "$opt_t" in 2583 case "$opt_t" in
2706 ST="OpenBSD ${r}" 2721 ST="OpenBSD ${r}"
2707 SP="${ST}" 2722 SP="${ST}"
2708 SC="4.4BSD" 2723 SC="4.4BSD"
2709 ;; 2724 ;;
2710 2725
2726 # DragonFly BSD
2727 *:DragonFly:* )
2728 # determine architecture
2729 AT="${UNAME_MACHINE}"
2730 AP="${AT}"
2731 case "${AP}" in
2732 i[3-6]86 ) AP="iX86" ;;
2733 esac
2734 AC="${AP}"
2735 # determine system
2736 r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'`
2737 ST="DragonFly ${r}"
2738 SP="${ST}"
2739 SC="4.4BSD"
2740 ;;
2741
2711 # GNU/Linux 2742 # GNU/Linux
2712 *:Linux:* ) 2743 *:Linux:* )
2713 # determine architecture 2744 # determine architecture
2714 AT="${UNAME_MACHINE}" 2745 AT="${UNAME_MACHINE}"
2715 case "${AT}" in 2746 case "${AT}" in
2747 [ ".${tagfile}" = .x ] && continue 2778 [ ".${tagfile}" = .x ] && continue
2748 [ ! -f "/etc/${tagfile}" ] && continue 2779 [ ! -f "/etc/${tagfile}" ] && continue
2749 n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'` 2780 n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'`
2750 v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\ 2781 v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\
2751 sed -e 's/^/#/' \ 2782 sed -e 's/^/#/' \
2752 -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ 2783 -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\).*$/\1[\2]/' \
2753 -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ 2784 -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
2754 -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ 2785 -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
2755 -e 's/^#.*$//'` 2786 -e 's/^#.*$//'`
2756 case "`util_lower ${n}`" in 2787 case "`util_lower ${n}`" in
2757 redhat ) 2788 redhat )
2923 ;; 2954 ;;
2924 2955
2925 # IBM AIX 2956 # IBM AIX
2926 *:AIX:* ) 2957 *:AIX:* )
2927 # determine architecture 2958 # determine architecture
2928 cpu_arch=rs6000 2959 cpu_arch=RS6000
2929 if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then 2960 if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
2930 cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 2961 cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
2931 if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then 2962 if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then
2932 cpu_arch=powerpc 2963 cpu_arch=PPC
2933 fi 2964 fi
2934 elif [ -d /QOpenSys ]; then 2965 elif [ -d /QOpenSys ]; then
2935 # IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment) 2966 # IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment)
2936 cpu_arch=powerpc 2967 cpu_arch=PPC
2937 fi 2968 fi
2938 if [ -x /usr/bin/oslevel ]; then 2969 if [ -x /usr/bin/oslevel ]; then
2939 os_level=`/usr/bin/oslevel` 2970 os_level=`/usr/bin/oslevel`
2940 else 2971 else
2941 os_level="`uname -v`.`uname -r`" 2972 os_level="`uname -v`.`uname -r`"
2995 -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \ 3026 -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \
2996 -e 's/^#.*$/v1="0"/'` 3027 -e 's/^#.*$/v1="0"/'`
2997 SP="[Apple ]Mac OS X ${v1}${v2+.$v2}${v3+[.$v3]}" 3028 SP="[Apple ]Mac OS X ${v1}${v2+.$v2}${v3+[.$v3]}"
2998 fi 3029 fi
2999 SC="4.4BSD/Mach3.0" 3030 SC="4.4BSD/Mach3.0"
3031 ;;
3032
3033 # Windows/Cygwin
3034 *:CYGWIN*:* )
3035 # determine architecture
3036 AT="`uname -m`"
3037 AP="${AT}"
3038 case "${AP}" in
3039 i?86 ) AP="iX86" ;;
3040 esac
3041 AC="${AP}"
3042 # determine system
3043 unset v1; unset v2; unset v3
3044 eval `echo "${UNAME_RELEASE}" |\
3045 sed -e 's/^/#/' \
3046 -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"; v3="\3"/' \
3047 -e 's/^#\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/v1="\1"; v2="\2"/' \
3048 -e 's/^#\([0-9][0-9]*\).*$/v1="\1"/' \
3049 -e 's/^#.*$/v1="0"/'`
3050 ST="Cygwin ${v1}${v2+.$v2}${v3+[.$v3]}"
3051 SP="$ST"
3052 SC="Windows"
3053 v=`echo "${UNAME_SYSTEM}" | sed -e 's/^CYGWIN_NT-//' |\
3054 sed -e 's/^/#/' -e 's/^#\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' -e 's/^#.*$//'`
3055 case "$v" in
3056 4.0 ) SC="$SC[ NT]" ;;
3057 5.0 ) SC="$SC[ 2000]" ;;
3058 5.1 ) SC="$SC[ XP]" ;;
3059 6.0 ) SC="$SC[ Vista]" ;;
3060 esac
3000 ;; 3061 ;;
3001 3062
3002 # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO 3063 # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO
3003 # *:XXX:* ) 3064 # *:XXX:* )
3004 # ... 3065 # ...
3141 ;; 3202 ;;
3142 3203
3143 arx ) 3204 arx )
3144 ## 3205 ##
3145 ## arx -- Extended archive command 3206 ## arx -- Extended archive command
3146 ## Copyright (c) 1999-2007 Ralf S. Engelschall <rse@engelschall.com> 3207 ## Copyright (c) 1999-2008 Ralf S. Engelschall <rse@engelschall.com>
3147 ## 3208 ##
3148 3209
3149 ar_prg="$opt_C" 3210 ar_prg="$opt_C"
3150 ar_cmd="$1"; shift 3211 ar_cmd="$1"; shift
3151 archive="$1"; shift 3212 archive="$1"; shift
3220 ;; 3281 ;;
3221 3282
3222 slo ) 3283 slo )
3223 ## 3284 ##
3224 ## slo -- Separate linker options by library class 3285 ## slo -- Separate linker options by library class
3225 ## Copyright (c) 1998-2007 Ralf S. Engelschall <rse@engelschall.com> 3286 ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
3226 ## 3287 ##
3227 3288
3228 DIFS="$IFS" 3289 DIFS="$IFS"
3229 3290
3230 # parse out -L and -l options from command line 3291 # parse out -L and -l options from command line
3379 ;; 3440 ;;
3380 3441
3381 scpp ) 3442 scpp )
3382 ## 3443 ##
3383 ## scpp -- Sharing C Pre-Processor 3444 ## scpp -- Sharing C Pre-Processor
3384 ## Copyright (c) 1999-2007 Ralf S. Engelschall <rse@engelschall.com> 3445 ## Copyright (c) 1999-2008 Ralf S. Engelschall <rse@engelschall.com>
3385 ## 3446 ##
3386 3447
3387 srcs="$*" 3448 srcs="$*"
3388 output="${opt_o}.n" 3449 output="${opt_o}.n"
3389 3450
3599 ;; 3660 ;;
3600 3661
3601 version ) 3662 version )
3602 ## 3663 ##
3603 ## version -- Maintain a version information file 3664 ## version -- Maintain a version information file
3604 ## Copyright (c) 1994-2007 Ralf S. Engelschall <rse@engelschall.com> 3665 ## Copyright (c) 1994-2008 Ralf S. Engelschall <rse@engelschall.com>
3605 ## 3666 ##
3606 3667
3607 file="$1" 3668 file="$1"
3608 3669
3609 # determine prefix and name 3670 # determine prefix and name
3891 ;; 3952 ;;
3892 3953
3893 path ) 3954 path )
3894 ## 3955 ##
3895 ## path -- Deal with program paths 3956 ## path -- Deal with program paths
3896 ## Copyright (c) 1998-2007 Ralf S. Engelschall <rse@engelschall.com> 3957 ## Copyright (c) 1998-2008 Ralf S. Engelschall <rse@engelschall.com>
3897 ## 3958 ##
3898 3959
3899 namelist="$*" 3960 namelist="$*"
3900 3961
3901 # check whether the test command supports the -x option 3962 # check whether the test command supports the -x option

mercurial