-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunner.sh
52 lines (46 loc) · 1.65 KB
/
runner.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
gpg --import $BITALSARK
gpg --fingerprint B85CCC7E84084D98FDCA5CB9619D32E653C5E767
if [[ -n "$PGPFINGER" ]]; then
gpg --recv-keys $PGPFINGER
fi
if [[ -n "$PGPLINK" ]]; then
IFS=' '
l=1
for i in $PGPLINK; do
curl "$i" > "$AURPACKAGE"-"$l"".key"
gpg --import "$AURPACKAGE"-"$l"".key"
((l++))
done
fi
echo Updating pacman databases...
sudo pacman -Syy
#TODO: replace $AURPACKAGE and $OWNPACKAGE with $PACKAGE
#Check if we are dealing with an array
#Current Jenkins jobs are incapable of defining arrays, so I just convert strings to them if needed
packarray=""
if [[ "$AURPACKAGE" =~ \ |\' ]]
then
packarray=true
declare -a packages
IFS=' ' read -r -a packages <<< "$AURPACKAGE"
else
packarray=false
packages=$AURPACKAGE
fi
# BASH is incapable of passing down arrays, so they have to be expanded here and re-arrayed again inside
# This is ugly, but I don't know of another in-memory solution, except for
# a `for` loop here instead of inside, but this is useless for some and harmful (less context) for other scenarios
if [[ -z $Action ]] || [[ $Action == "default" ]]; then
/opt/packagebuilder.sh "${packages[*]}" || exit 1
elif [[ $Action == "custom" ]]; then
/opt/custombuilder.sh "${packages[*]}" || exit 1
elif [[ $Action == "force-rebuild" ]]; then
/opt/rebuilder.sh "${packages[*]}" || exit 1
elif [[ $Action == "update-devel" ]]; then
/opt/update-devel.sh "${packages[*]}" || exit 1
fi
#sudo pacman -Sc --noconfirm
#When aurutils will get a sane version number again
#sudo pacleaner -n 2 -m --delete --no-confirm
#TODO: write a custom sane cleaner affecting only the job package