-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathheader.txt
More file actions
102 lines (84 loc) · 2.24 KB
/
Copy pathheader.txt
File metadata and controls
102 lines (84 loc) · 2.24 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/sh
# create a directory to extract to.
export PREFIX="/usr/local/lib/erlang"
if [ $1 = "force" ];then
FORCE="true"
if [ "$2" != "" ]; then
export PREFIX="$2"
fi
elif [ "$2" = "force" ]; then
FORCE="true"
export PREFIX="$1"
elif [ "$1" != "" ]; then
FORCE="false"
export PREFIX="$1"
fi
if [ $FORCE = "true" ];then
echo "forcing install - deleting any existing installs"
rm -rf $PREFIX
elif [ -e $PREFIX ];then
echo "*** $PREFIX already exists ***"
echo "Would you like to:"
echo "1. (k)eep the directory and install along side what exists within it (Recommended)"
echo "2. (d)elete and reinstall $PREFIX"
echo "3. (a)bort the boostrap process"
echo ""
echo "Answer [k|d|a] $> \c"
read RESP
case "$RESP" in
"d")
echo ""
echo " Are you sure? This will delete your entire previous Erlware install."
echo " Please type \"yes\" to continue $> \c"
read SURE_RESP
if [ "$SURE_RESP" != "yes" ];then
echo ""
echo "Keeping previous install, and aborting bootstrap."
exit 0
fi
echo ""
echo "Removing previous install"
rm -rf $PREFIX
;;
"a")
echo "Aborting the Faxien bootstrap process"
exit 1
;;
*)
echo "Keeping old install and installing along side it"
;;
esac
fi
SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0`
echo "Extracting the erlware bootstrap"
echo Creating target directory $PREFIX
mkdir -p $PREFIX
if [ $? != 0 ]; then
echo "Error executing mkdir, do you have permission?"
exit 1
fi
export PREFIX=$(cd $PREFIX; pwd)
echo Untaring into $PREFIX
# Take the TGZ portion of this file and pipe it to tar.
tail -n +$SKIP $0 > $PREFIX/tmp.tar.gz
(cd $PREFIX; tar -zxf tmp.tar.gz)
rm $PREFIX/tmp.tar.gz
if [ $? != 0 ]; then
echo "Unable to untar bootstrap"
exit 1
fi
echo ""
echo "*** Faxien is now installed ***"
echo ""
echo "Checking repos for any upgrades"
# execute the installation script
wait && $PREFIX/bin/faxien upgrade-release faxien
if [ $? -eq 0 ]; then
echo
echo Faxien is now installed. You may wish to add $PREFIX/bin to
echo your PATH so you can just type \'faxien\' at the command line.
echo
echo Run \"$PREFIX/bin/faxien help\" to get started.
fi
exit 0
__ARCHIVE_FOLLOWS__