forked from WhyNotHugo/docker-makepkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
35 lines (26 loc) · 701 Bytes
/
run.sh
File metadata and controls
35 lines (26 loc) · 701 Bytes
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
#!/bin/bash
set -e
SRC_DIR=$PWD
if [ -n "$1" ]
then
SRC_DIR=$1
fi
if ! [ -e "$SRC_DIR/PKGBUILD" ]
then
echo "source location $SRC_DIR not accessible."
exit 1
fi
# Make a copy so we never alter the original
cp -rT "$SRC_DIR" /work
cd /work
# update mirrors
sudo reflector --verbose --protocol http,https --age 6 --latest 10 --fastest 4 --save /etc/pacman.d/mirrorlist
# update packages
sudo pacman -Syu --noconfirm
# Do the actual building
makepkg --noconfirm --syncdeps --force
# Store the built package(s). Ensure permissions match the original PKGBUILD.
if [ -n "$EXPORT_PKG" ]; then
sudo chown "$(stat -c '%u:%g' /pkg/PKGBUILD)" ./*pkg.tar*
sudo mv ./*pkg.tar* "$SRC_DIR"
fi