[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: reproducible Arch Linux: fix bug resulting in removed packages not to be removed from the DB

Holger Levsen gitlab at salsa.debian.org
Fri Jan 25 22:40:52 GMT 2019


Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
26e9cf88 by Holger Levsen at 2019-01-25T22:32:13Z
reproducible Arch Linux: fix bug resulting in removed packages not to be removed from the DB

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -
fa434bad by Holger Levsen at 2019-01-25T22:38:59Z
reproducible Arch Linux: refactoring against insanity.

hopefully this improves the situation somewhat.

two variables, $repo and $REPO, with different contexts, made to have
the same scope and content... hopefully with this renaming and less
usage of one, it has become a bit better.

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/reproducible_archlinux_scheduler.sh


Changes:

=====================================
bin/reproducible_archlinux_scheduler.sh
=====================================
@@ -38,11 +38,11 @@ update_archlinux_repositories() {
 	#
 	echo "$(date -u ) - exporting pacman's knowledge of Arch Linux repositories to the filesystem (by running 'expac -S...')."
 	schroot --run-session -c $SESSION --directory /var/tmp -- expac -S '%r %e %n %v' | \
-		while read repo pkgbase pkgname version; do
+		while read repository pkgbase pkgname version; do
 			if [[ "$pkgbase" = "(null)" ]]; then
-				printf '%s %s %s\n' "$repo" "$pkgname" "$version"
+				printf '%s %s %s\n' "$repository" "$pkgname" "$version"
 			else
-				printf '%s %s %s\n' "$repo" "$pkgbase" "$version"
+				printf '%s %s %s\n' "$repository" "$pkgbase" "$version"
 			fi
 		done | sort -u -R > "$ARCHLINUX_PKGS"_full_pkgbase_list
 	TOTAL=$(cat ${ARCHLINUX_PKGS}_full_pkgbase_list | wc -l)
@@ -69,7 +69,7 @@ update_archlinux_repositories() {
 					REMOVE_LIST="$REMOVE_LIST $REPO/$PKG"
 					rm -r --one-file-system $BASE/archlinux/$REPO/$PKG
 					echo "$(date -u) - $REPO/$PKG removed as it's gone from the Archlinux repositories."
-					SUITE="archlinux_$repo"
+					SUITE="archlinux_$REPO"
 					PKG_ID=$(query_db "SELECT id FROM sources WHERE distribution=$DISTROID AND name='$PKG' AND suite='$SUITE' AND architecture='$ARCH';")
 					if [ -n "${PKG_ID}" ] ; then
 						query_db "DELETE FROM results WHERE package_id='${PKG_ID}';"
@@ -98,15 +98,15 @@ update_archlinux_repositories() {
 		echo "$(date -u ) - updating database with available packages in repository '$REPO'."
 		DATE="$(date -u +'%Y-%m-%d %H:%M')"
 		grep "^$REPO" "$ARCHLINUX_PKGS"_full_pkgbase_list | \
-			while read repo pkgbase version; do
+			while read repository pkgbase version; do
 				PKG=$pkgbase
-				SUITE="archlinux_$repo"
-				PKG_IN_DB=$(grep "^archlinux_$repo|$pkgbase|" $KNOWN | head -1) # FIXME: why oh why is head -1 needed here?
+				SUITE="archlinux_$REPO"
+				PKG_IN_DB=$(grep "^archlinux_$REPO|$pkgbase|" $KNOWN | head -1) # FIXME: why oh why is head -1 needed here?
 				VERSION=$(echo ${PKG_IN_DB} | cut -d "|" -f3)
 			        if [ -z "${PKG_IN_DB}" ] ; then
 					# new package, add to db and schedule
 					echo $REPO/$pkgbase >> $NEW
-					echo "new package found: $repo/$pkgbase $version "
+					echo "new package found: $REPO/$pkgbase $version "
 					query_db "INSERT into sources (name, version, suite, architecture, distribution) VALUES ('$PKG', '$version', '$SUITE', '$ARCH', $DISTROID);"
 					PKG_ID=$(query_db "SELECT id FROM sources WHERE distribution=$DISTROID AND name='$PKG' AND suite='$SUITE' AND architecture='$ARCH';")
 					query_db "INSERT INTO schedule (package_id, date_scheduled) VALUES ('${PKG_ID}', '$DATE');"



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/ee369979d9390bb182d4d220a0c944b7ced373e8...fa434bad45253311a3b6807ec9da181333fb5d73

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/compare/ee369979d9390bb182d4d220a0c944b7ced373e8...fa434bad45253311a3b6807ec9da181333fb5d73
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20190125/e8d62372/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list