home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / Fresco / build / Unix / config / util / aminstall.sh next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-07-12  |  1.2 KB  |  75 lines

  1. #!/bin/sh
  2. # $XConsortium: aminstall.sh,v 1.1 94/03/29 15:54:08 gildea Exp $
  3. # aminstall - transfer cross-compiled files to system running Amoeba.
  4. # Usage: aminstall binary-directory [-s stksz] unix-source amoeba-dest
  5.  
  6. #
  7. # Default soap mask for files
  8. #
  9. SPMASK=0xFF:2:2
  10. export SPMASK
  11. PROG=$0
  12. USAGE="Usage: $PROG binary-directory unix-source amoeba-dest"
  13.  
  14. #
  15. # Argument check
  16. #
  17. case $# in
  18. 3|5)    ;;
  19. *)    echo $USAGE >&2
  20.     exit 1
  21.     ;;
  22. esac
  23.  
  24. bindir=$1
  25. stksz=
  26. case $2 in
  27. -s)    if [ $# -ne 5 ]
  28.     then
  29.         echo $USAGE >&2
  30.         exit 1
  31.     fi
  32.     stksz="-s $3"
  33.     shift
  34.     shift
  35.     ;;
  36. esac
  37.  
  38. unxfile=$2
  39. dest=$3
  40.  
  41. #
  42. # Change /public .... into /super (just for installation)
  43. #
  44. stripped=`echo $dest | sed 's:^/public::'`
  45. if [ X$dest != X$stripped ]; then
  46.     dest=/super$stripped
  47. fi
  48.  
  49. #
  50. # If the file already exists, then delete it
  51. #
  52. INFO=`$bindir/std_info $dest 2>&1`
  53. case $INFO in
  54. *"not found"*)    ;;
  55. *failed*)    ;;
  56. *bytes*)    $bindir/del -f $dest
  57.         ;;
  58. /??????)    echo $PROG: cannot install over directory 1>&2
  59.         exit
  60.         ;;
  61. *)        $bindir/del -d $dest
  62.         ;;
  63. esac
  64.  
  65. #
  66. # Transfer the file to Amoeba
  67. #
  68. $bindir/../bin.scripts/ainstall $stksz $unxfile $dest > /dev/null 2>&1
  69. if [ $? -ne 0 ]
  70. then
  71.     echo "This is not binary - using tob"
  72.     $bindir/tob $unxfile $dest
  73. fi
  74.  
  75.