-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·114 lines (63 loc) · 1.33 KB
/
deploy.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/sh
# This is a small helper script to 'deploy' my files into your
# void-packages clone
deploy=
show_help() {
cat << _EOF
[VOID_DIR] ./deploy.sh
Environment:
VOID_DIR=<your void-packages>
Pass this variable to tell the script where exactly your
void-packages clone/fork resides.
Will default to "$HOME/stuff/gitstuff/void-packages".
Options:
-h
Print this message.
_EOF
}
while getopts ":h" opt; do
case $opt in
h)
show_help
exit 0
;;
\?)
show_help
exit 1
;;
esac
done
if [ ! -e "$(pwd)/deploy.sh" ]; then
echo "Please execute the script from its original directory"
exit 2
fi
if [ -z "$VOID_DIR" ]; then
VOID_DIR="$HOME/stuff/gitstuff/void-packages"
fi
if [ ! -d "$VOID_DIR" ]; then
echo "non-existent directory"
exit 3
else
if [ ! -e "$VOID_DIR/xbps-src" ]; then
echo "xbps-src does not exist in given directory"
exit 3
fi
fi
if [ -n "$1" ]; then
if [ -e etc/deploylists/"$1".sh ]; then
. ./etc/deploylists/"$1".sh
elif [ -e srcpkgs/"$1" ]; then
deploy="$1"
else
echo "Unknown pkg or list"
exit 4
fi
cd srcpkgs
cp -r -t "$VOID_DIR/srcpkgs" ${deploy}
cd ..
else
cp -r srcpkgs/* "$VOID_DIR/srcpkgs"
fi
cat common/shlibs.123 >> "$VOID_DIR/common/shlibs"
echo "Don't forget to git-clean and git-reset your directory when you're done!"
exit 0