-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-entrypoint.sh
executable file
·52 lines (47 loc) · 1.33 KB
/
docker-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
#!/usr/bin/env bash
# AUR Builder script
# Maintainer: Toni Tauro <[email protected]>
AUR_PACKAGES=$*
AUR_BASE=${AUR_BASE:-https://aur.archlinux.org/cgit/aur.git/snapshot}
EXPORT=${EXPORT:-/export}
function log {
echo "$(date "+%FT%H:%M:%S") | $1 | $2"
}
function main {
# first sync pacman
log "INFO" "Populating pacman-keys"
sudo pacman-key --populate
log "INFO" "Syncing repositories"
sudo pacman -Syy &>/dev/null
# if GPG-KEYS needed, import them
if [[ -n $ADD_GPG_KEYS ]]
then
gpg --recv-keys $ADD_GPG_KEYS
fi
# first check if all given packages exist in AUR
for PKG in ${AUR_PACKAGES}
do
if auracle info ${PKG} >/dev/null
then log "INFO" "${PKG} exists"
else
log "ERROR" "${PKG} does not exists in AUR"
exit 1
fi
# clone all packages and deps
auracle clone -r $PKG
auracle buildorder $PKG | grep "^AUR " | awk '{print $2}' | while read line
do cd $line && makepkg -si --noconfirm -c && cd ..
done
cd $PKG && makepkg -s --noconfirm -c && rm -rf $PKG*_orig_*tar*
done
find /home/aur -iname "*.pkg.tar.*" | while read BUILTPKG
do
log "INFO" "Copying $BUILTPKG into $EXPORT"
sudo cp -rf $BUILTPKG $EXPORT
done
if [[ -n $REPONAME ]]
then
sudo repo-add /export/$REPONAME.db.tar.gz /export/*.pkg.tar.xz
fi
}
main