aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/config/util/aminstall.sh
blob: 19a8a4d5a88e43109bfec90a184ea14cdfd61006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
# $Xorg: aminstall.sh,v 1.3 2000/08/17 19:41:52 cpqbld Exp $
# aminstall - transfer cross-compiled files to system running Amoeba.
# Usage: aminstall binary-directory [-s stksz] unix-source amoeba-dest

#
# Default soap mask for files
#
SPMASK=0xFF:2:2
export SPMASK
PROG=$0
USAGE="Usage: $PROG binary-directory unix-source amoeba-dest"

#
# Argument check
#
case $# in
3|5)	;;
*)	echo $USAGE >&2
	exit 1
	;;
esac

bindir=$1
stksz=
case $2 in
-s)	if [ $# -ne 5 ]
	then
	    echo $USAGE >&2
	    exit 1
	fi
	stksz="-s $3"
	shift
	shift
	;;
esac

unxfile=$2
dest=$3

#
# Change /public .... into /super (just for installation)
#
stripped=`echo $dest | sed 's:^/public::'`
if [ X$dest != X$stripped ]; then
    dest=/super$stripped
fi

#
# If the file already exists, then delete it
#
INFO=`$bindir/std_info $dest 2>&1`
case $INFO in
*"not found"*)	;;
*failed*)	;;
*bytes*)	$bindir/del -f $dest
		;;
/??????)	echo $PROG: cannot install over directory 1>&2
		exit
		;;
*)		$bindir/del -d $dest
		;;
esac

#
# Transfer the file to Amoeba
#
$bindir/../bin.scripts/ainstall $stksz $unxfile $dest > /dev/null 2>&1
if [ $? -ne 0 ]
then
	echo "This is not binary - using tob"
	$bindir/tob $unxfile $dest
fi