-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpkgbuild-prepare.sh
38 lines (29 loc) · 949 Bytes
/
pkgbuild-prepare.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
#!/bin/bash
set -ex
# Environment variables.
export PACKAGER="https://travis-ci.org/${1}/builds/${2}"
export AURDEST="$(pwd)/src"
export VSCODE_NONFREE=1
# Variables declaration.
declare -a pkglist=()
declare -a pkgkey=()
# Remove comments or blank lines.
for file in "pkgkeys"; do
sed -i -e "/\s*#.*/s/\s*#.*//" -e "/^\s*$/d" ${file}
done
# Create pkglist based on .gitmodules
cat .gitmodules | grep aur.archlinux.org | grep -v '^#' | grep -v '^qtcreator-opt-git$' | sed 's|^.*/\(.*\)\.git$|\1|' > pkglist
# Load files.
mapfile pkglist < "pkglist"
mapfile pkgkeys < "pkgkeys"
# Remove packages from repository.
cd "bin"
while read pkg; do
repo-remove "qtcreator-opt.db.tar.gz" ${pkg}
done < <(comm -23 <(pacman -Sl "qtcreator-opt" | cut -d" " -f2 | sort) <(aurchain ${pkglist[@]} | sort))
cd ".."
# Get package gpg keys.
for key in ${pkgkeys[@]}; do
gpg --recv-keys --keyserver hkp://pgp.mit.edu ${key}
done
{ set +ex; } 2>/dev/null