Unverified Commit c0736467 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

reproducible (alpine|archlinux): scheduler: always begin the schroot session,...


reproducible (alpine|archlinux): scheduler: always begin the schroot session, and leave the cleanup to the trap, to avoid some possible cases of schroot sessions leaking

spotted a leak while keeping an eye on the current sessions

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 3a7ab168
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -28,8 +28,6 @@ update_alpine_repositories() {
	echo "$(date -u ) - $TOTAL alpine packages were previously known to alpine."
	query_db "SELECT suite, name, version FROM sources WHERE distribution=$DISTROID AND architecture='$ARCH';" > $KNOWN
	echo "$(date -u ) - $(cat $KNOWN | wc -l) alpine packages are known in our database."
	# init session
	schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-alpine
	echo "$(date -u ) - updating our knowledge of alpine repositories (by running git pull)."
	schroot --run-session -c $SESSION --directory /var/lib/jenkins/aports -- git pull

@@ -152,7 +150,6 @@ update_alpine_repositories() {
		updated=$(grep -c ^$REPO $UPDATED || true)
		echo "$(date -u ) - scheduled $new/$updated packages in repository '$REPO'."
	done
	schroot --end-session -c $SESSION

	#
	# schedule up to $MAX packages in DEPWAIT_ or 404_ states
@@ -286,8 +283,9 @@ update_alpine_repositories() {
trap cleanup_all INT TERM EXIT
ARCH="x86_64"
SESSION="alpine-scheduler-$RANDOM"
# init session
schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-alpine
DISTROID=$(query_db "SELECT id FROM distributions WHERE name = 'alpine'")
update_alpine_repositories
trap - INT TERM EXIT

# vim: set sw=0 noet :
+2 −4
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@ update_archlinux_repositories() {
	echo "$(date -u ) - $TOTAL Arch Linux packages were previously known to Arch Linux."
	query_db "SELECT suite, name, version FROM sources WHERE distribution=$DISTROID AND architecture='$ARCH';" > $KNOWN
	echo "$(date -u ) - $(cat $KNOWN | wc -l) Arch Linux packages are known in our database."
	# init session
	schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-archlinux
	echo "$(date -u ) - updating pacman's knowledge of Arch Linux repositories (by running pacman -Syu --noconform')."
	schroot --run-session -c $SESSION --directory /var/tmp -- sudo pacman -Syu --noconfirm

@@ -154,7 +152,6 @@ update_archlinux_repositories() {
		updated=$(grep -c ^$REPO $UPDATED || true)
		echo "$(date -u ) - scheduled $new/$updated packages in repository '$REPO'."
	done
	schroot --end-session -c $SESSION

	#
	# schedule up to $MAX packages in DEPWAIT_ or 404_ states
@@ -286,8 +283,9 @@ update_archlinux_repositories() {
trap cleanup_all INT TERM EXIT
ARCH="x86_64"
SESSION="archlinux-scheduler-$RANDOM"
# init session
schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-archlinux
DISTROID=$(query_db "SELECT id FROM distributions WHERE name = 'archlinux'")
update_archlinux_repositories
trap - INT TERM EXIT

# vim: set sw=0 noet :