Changeset 11739 for trunk/psconfig/psconfig.sh
- Timestamp:
- Feb 9, 2007, 3:36:38 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psconfig/psconfig.sh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psconfig/psconfig.sh
r11738 r11739 2 2 # this file is sourced using the command 'psconfig' 3 3 4 # list the current settings5 if ($#argv == 0) then6 if (! $?PSCONFDIR) echo "PSCONFDIR is not set : run psconfig with an argument to setup"7 if (! $?PSVERSION) echo "PSVERSION is not set : run psconfig with an argument to setup"8 if (! $?ARCH) echo "ARCH is not set : run psconfig with an argument to setup"9 echo $PSCONFDIR : $PSVERSION : $ARCH10 echo "psconfig --help for additional info"11 exit 212 endif13 14 # show usage information15 if ("$argv[1]" == "--help") then16 echo "psconfig: set or show the current pslib configuration information"17 echo "USAGE: psconfig (version) : set configuration to specified version"18 echo " psconfig --bin : return the current path"19 echo " psconfig --libs : return the current library path"20 echo " psconfig --list : list currently availabe configuration versions"21 echo " psconfig --help : this listing"22 echo " use ~/.psconfigrc to set PSCONFDIR as desired"23 exit 024 endif25 26 # list the defined psconfig versions27 if ("$argv[1]" == "--list") then28 /bin/ls $PSCONFDIR | grep -v "\<man\>" | grep -v "\<share\>" | awk -v dir=$PSCONFDIR -F. '{printf "%s : %-10s : %s\n", dir, $1, $2}'29 exit 030 endif31 32 # list the defined psconfig versions33 if ("$argv[1]" == "--prefix") then34 echo $PSCONFDIR/$PSVERSION.$ARCH35 exit 036 endif37 38 # list the defined psconfig versions39 if ("$argv[1]" == "--libs") then40 echo $PSCONFDIR/$PSVERSION.$ARCH/lib41 exit 042 endif43 44 # list the defined psconfig versions45 if ("$argv[1]" == "--bin") then46 echo $PSCONFDIR/$PSVERSION.$ARCH/bin47 exit 048 endif49 50 4 # list the defined psconfig versions 51 5 set show_configure = 0 52 if ("$argv[1]" == "--psconfigure") then53 set show_configure = 154 shift55 endif56 57 # list the defined psconfig versions58 6 set show_autogen = 0 59 if ("$argv[1]" == "--psautogen") then 60 set show_autogen = 1 61 shift 62 endif 63 64 # list the defined psconfig versions 65 set show_psperlbuild = 0 66 if ("$argv[1]" == "--psperlbuild") then 67 set show_psperlbuild = 1 68 shift 69 endif 7 set show_perlbuild = 0 8 set args = "" 9 while ($#argv) 10 switch ($argv[1]) 11 case --help: 12 goto help; 13 14 case --list: 15 /bin/ls $PSCONFDIR | grep -v "\<man\>" | grep -v "\<share\>" | awk -v dir=$PSCONFDIR -F. '{printf "%s : %-10s : %s\n", dir, $1, $2}' 16 exit 0 17 breaksw 18 19 case --prefix: 20 echo $PSCONFDIR/$PSVERSION.$ARCH 21 exit 0 22 breaksw 23 24 case --libs: 25 echo $PSCONFDIR/$PSVERSION.$ARCH/lib 26 exit 0 27 breaksw 28 29 case --bin 30 echo $PSCONFDIR/$PSVERSION.$ARCH/bin 31 exit 0 32 breaksw 33 34 case --psconfigure: 35 set show_configure = 1 36 shift 37 breaksw; 38 case --psautogen: 39 set show_autogen = 1 40 shift 41 breaksw; 42 case --psperlbuild: 43 set show_perlbuild = 1 44 shift 45 breaksw; 46 case -*: 47 echo "unknown option $1" 48 goto help; 49 default: 50 set args=($args $1); 51 shift 52 breaksw; 53 endsw 54 end 55 if ($#args != 1) goto usage 56 if ("$args" == "") goto usage 70 57 71 58 # make this configurable by the user … … 77 64 endif 78 65 79 setenv PSVERSION $arg v[1]66 setenv PSVERSION $args[1] 80 67 81 68 if ($?LD_LIBRARY_PATH == 0) setenv LD_LIBRARY_PATH … … 290 277 exit 0 291 278 endif 279 280 exit 0 281 282 usage: 283 if (! $?PSCONFDIR) echo "PSCONFDIR is not set : run psconfig with an argument to setup" 284 if (! $?PSVERSION) echo "PSVERSION is not set : run psconfig with an argument to setup" 285 if (! $?ARCH) echo "ARCH is not set : run psconfig with an argument to setup" 286 echo $PSCONFDIR : $PSVERSION : $ARCH 287 echo "psconfig --help for additional info" 288 exit 2 289 290 help: 291 echo "psconfig: set or show the current pslib configuration information" 292 echo "USAGE: psconfig (version) : set configuration to specified version" 293 echo " psconfig --bin : return the current path" 294 echo " psconfig --libs : return the current library path" 295 echo " psconfig --list : list currently availabe configuration versions" 296 echo " psconfig --help : this listing" 297 echo " use ~/.psconfigrc to set PSCONFDIR as desired" 298 exit 1
Note:
See TracChangeset
for help on using the changeset viewer.
