blob: a4627a333e26cecb2343a595915a2b2fcc87f353 (
plain)
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
|
#!/bin/bash
: "${GIT_URI:=https://anongit.gentoo.org/git/repo/gentoo.git}"
: "${GIT_BRANCH:=master}"
: "${GIT_REMOTE:=origin}"
: "${JOBS:=6}"
update_repository(){
# This is the copy of the tree used to run gpackages against.
if [[ ! -d /mnt/packages-tree/gentoo/ ]]; then
cd /mnt/packages-tree || exit 1
git clone \
--quiet \
--single-branch \
--branch "${GIT_BRANCH}" \
--origin "${GIT_REMOTE}" \
"${GIT_URI}"
else
cd /mnt/packages-tree/gentoo/ || exit 1
if [ "$(git remote get-url "${GIT_REMOTE}")" != "${GIT_URI}" ]; then
git remote set-url "${GIT_REMOTE}" "${GIT_URI}"
fi
git fetch --quiet --force "${GIT_REMOTE}" "${GIT_BRANCH}"
git reset --quiet --hard "${GIT_REMOTE}"/"${GIT_BRANCH}"
fi
}
update_md5cache(){
mkdir -p /var/cache/pgo-egencache
cd /mnt/packages-tree/gentoo/ || exit 1
#echo 'FEATURES="-userpriv -usersandbox -sandbox"' >> /etc/portage/make.conf
egencache -j "${JOBS}" --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
location = /mnt/packages-tree/gentoo' --update
egencache -j "${JOBS}" --cache-dir /var/cache/pgo-egencache --repo gentoo --repositories-configuration '[gentoo]
location = /mnt/packages-tree/gentoo' --update-use-local-desc
}
fullupdate_database(){
cd /mnt/packages-tree/gentoo/ || exit 1
/go/src/soko/bin/soko --fullupdate
}
update_repository
update_md5cache
fullupdate_database
|