summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-02-21 12:37:09 +0100
committerFabian Groffen <grobian@gentoo.org>2019-02-21 12:37:09 +0100
commitb7c0b89992e7b3673ad3e3ba667b81ce9868b69c (patch)
tree07c7bd091795cb6471f55c4f4fd314fdc012092f /scripts/auto-bootstraps/process_uploads.sh
parentscripts/bootstrap-prefix: fix bootstrap on Solaris 10 (diff)
downloadprefix-b7c0b89992e7b3673ad3e3ba667b81ce9868b69c.tar.gz
prefix-b7c0b89992e7b3673ad3e3ba667b81ce9868b69c.tar.bz2
prefix-b7c0b89992e7b3673ad3e3ba667b81ce9868b69c.zip
scripts/auto-bootstraps: scripts to perform unattended bootstraps
This includes the scripts that generate the results output of bootstrap.prefix.bitzolder.nl. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'scripts/auto-bootstraps/process_uploads.sh')
-rwxr-xr-xscripts/auto-bootstraps/process_uploads.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/scripts/auto-bootstraps/process_uploads.sh b/scripts/auto-bootstraps/process_uploads.sh
new file mode 100755
index 0000000000..52bb09ed7f
--- /dev/null
+++ b/scripts/auto-bootstraps/process_uploads.sh
@@ -0,0 +1,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