-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·55 lines (52 loc) · 1.17 KB
/
entrypoint.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
#!/bin/bash
SRCINFO="${SRCINFO:-0}"
CLEANUP="${CLEANUP:-1}"
function build {
# update pacman cache
sudo pacman -Syq
# update pacman keyring
sudo pacman -Sq --noconfirm --needed archlinux-keyring
# install missing PGP keys
for key in $(\
makepkg --printsrcinfo | \
grep validpgpkeys | \
awk '{print $3}' \
); do
sudo pacman-key --recv-keys "${key}"
done
# install dependencies
yay -Sq --noconfirm --needed $(\
makepkg --printsrcinfo | \
grep -E '\b(make)?depends' | \
awk '{print $3}'\
)
# generate SRCINFO
if [ "${SRCINFO}" = "1" ]; then
makepkg --printsrcinfo > .SRCINFO
fi
# build package
makepkg_args=(--cleanbuild --force --noconfirm)
if [ "${CLEANUP}" = "1" ]; then
makepkg_args+=(--clean)
fi
makepkg ${makepkg_args[@]} $@
# check package
namcap ./*.pkg.tar.zst
}
cmd="${1}"
case "${cmd}" in
makepkg)
# run makepkg directly
shift
makepkg $@
;;
build)
# install deps and build
shift
build $@
;;
*)
# install deps and build
build $@
;;
esac