This repository has been archived by the owner on Feb 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
build-and-install.sh
executable file
·86 lines (79 loc) · 1.67 KB
/
build-and-install.sh
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
#!/bin/bash
#Todo
# * add error detection
# * check for root if installing
while getopts ednhbp:is: opt; do
case $opt in
n)
NOCONFIRM=true
;;
h)
echo "arguments:"
echo "-h Shows this help file"
echo "-n installs package without user confirmation"
echo "-b just builds without installing"
echo "-p [package-name] only build specific package"
echo "-i [package-name] ignore certain package"
echo "-s [package-name] start at package"
echo "-d only download required sources (do not build or install)"
echo "-e stop on error "
exit
;;
e)
set -e
echo "WARNING: Stopping on errors"
;;
b)
NOINSTALL=true
;;
p)
INSTALLPACKAGE=$OPTARG
;;
i)
IGNOREPACKAGE=$OPTARG
;;
s)
NOSTART=true
STARTPKG=$OPTARG
;;
d) DOWNLOAD=true
esac
done
#check for conflicting arguments
if [ "$NOINSTALL" == true ]; then
if [ "$NOCONFIRM" == true ]; then
echo "Conflicting arguments...exiting"
exit
fi
fi
packages=($(./What_can_I_update\?.py -l))
if ! [[ "${?}" -eq 0 ]]; then
exit 1
fi
for package in "${packages[@]}"; do
if [ "$NOSTART" == "true" ]; then
if [ "${package}" != "$STARTPKG" ]; then
continue
else
NOSTART=false
fi
fi
if [[ "$IGNOREPACKAGE" != "" && "$IGNOREPACKAGE" == "${package}" ]]; then
continue
fi
if [[ "$INSTALLPACKAGE" != "" && "$INSTALLPACKAGE" != "${package}" ]]; then
continue
fi
cd "${package}"
if [ "$NOCONFIRM" == "true" ];then
makepkg --nocheck -fsicC --noconfirm
elif [ "$NOINSTALL" == "true" ]; then
makepkg --nocheck -fcC
elif [ "$DOWNLOAD" == "true" ]; then
echo "Downloading ${package}..."
makepkg -gC &> /dev/null
else
makepkg --nocheck -fsicC
fi
cd ..
done