-
Notifications
You must be signed in to change notification settings - Fork 8
/
bootstrap
executable file
·54 lines (44 loc) · 1.4 KB
/
bootstrap
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
#!/bin/bash -e
export PATH="$HOME/.local/bin:$PATH"
python3 --version
echo '[-] Installing required dependencies to local user folder...'
rm -f get-pip.py
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py --user
pip3 install --user pyparsing
echo '[-] Installing acbs (stage 0)...'
python3 setup.py install --user
rm -f get-pip.py
echo '[-] Testing acbs...'
"$HOME/.local/bin/acbs-build" --version
if ! command -v autobuild > /dev/null 2>&1; then
echo '[!] Autobuild3 not detected on your system.'
echo '[!] Please manually run the following command:'
echo 'export PATH="$HOME:/.local/bin/":$PATH'
exit 0
fi
if ! command -v git > /dev/null 2>&1; then
echo '[!] GIT not detected on your system.'
exit 1
fi
echo '[-] Installing acbs (stage 1)...'
TMPDIR="$(mktemp -d)"
cd "$TMPDIR"
git clone --filter=blob:none -b stable https://github.com/AOSC-Dev/aosc-os-abbs
ABBSDIR="$(readlink -f aosc-os-abbs)"
mkdir -p '/etc/acbs/'
mkdir -p '/var/cache/acbs/'{build,tarballs}
mkdir -p '/var/log/acbs/'
[ -f /etc/acbs/forest.conf ] && echo '[-] Backing up forest.conf...' && cp -v /etc/acbs/forest.conf /etc/acbs/forest.conf.bak
cat << EOF > /etc/acbs/forest.conf
[default]
location = ${ABBSDIR}
EOF
"$HOME/.local/bin/acbs-build" acbs
cd ..
echo '[-] Installing acbs (final)...'
acbs-build acbs
echo '[-] Cleaning up...'
rm -rf "$TMPDIR"
acbs-build -c
cp -v /etc/acbs/forest.conf.bak /etc/acbs/forest.conf