blob: 52bb09ed7f049bc09c6dacfdcda39d171343ca94 (
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
50
51
52
53
54
55
56
57
58
59
60
|
#!/usr/bin/env bash
UPLOADDIR="./uploads"
RESULTSDIR="./results"
didsomething=
for d in ${UPLOADDIR}/* ; do
if [[ ! -d "${d}" ]] ; then
rm -f "${d}"
continue
fi
# structure: randomid/chost/date
# chost/date should be the only thing in randomid/ check this
set -- "${d}"/*/*
if [[ $# -ne 1 ]] || [[ ! -d "$1" ]] ; then
rm -Rf "${d}"
continue
fi
dir=${1#${d}/}
# skip this thing from auto-processing if it is new platform
[[ -d ${RESULTSDIR}/${dir%/*} ]] || continue
# skip this thing if it already exists
[[ -d ${RESULTSDIR}/${dir} ]] && continue
# skip this thing if it isn't complete yet
[[ -d ${d}/${dir}/push-complete ]] || continue
# only copy over what we expect, so we leave any uploaded cruft
# behind
mkdir "${RESULTSDIR}/${dir}"
for f in \
stage{1,2,3}.log \
.stage{1,2,3}-finished \
bootstrap-prefix.sh \
emerge.log \
startprefix \
distfiles ;
do
[[ -e "${d}/${dir}/${f}" ]] && \
mv "${d}/${dir}/${f}" "${RESULTSDIR}/${dir}"/
done
if [[ -e "${d}/${dir}/portage" ]] ; then
for pkg in "${d}/${dir}/portage"/*/* ; do
w=${pkg#${d}/}
mkdir -p "${RESULTSDIR}/${w}"
[[ -e "${pkg}"/build-info ]] && \
mv "${pkg}"/build-info "${RESULTSDIR}/${w}"/
[[ -e "${pkg}"/temp ]] && \
mv "${pkg}"/temp "${RESULTSDIR}/${w}"/
done
fi
chmod -R o+rX,go-w "${RESULTSDIR}/${dir}"
rm -Rf "${d}"
[[ -e "${RESULTSDIR}/${dir}"/distfiles ]] && \
./update_distfiles.py "${RESULTSDIR}/${dir}"/distfiles > /dev/null
didsomething=1
done
[[ -n ${didsomething} ]] && ./analyse_result.py > /dev/null
|