[arch-projects] [dbscripts] [PATCH 1/1] test: db-update: @test "update same any package to same repository fails": change PKGEXT

Luke Shumaker lukeshu at lukeshu.com
Fri Feb 16 04:04:10 UTC 2018

From: Luke Shumaker <lukeshu at parabola.nu>

This has the test change PKGEXT the second time it tries to release the
package.  Currently, this causes the tests to fail.  That's a good thing;
it's checking for the regression where db-functions:check_pkgrepos isn't
treating PKGEXT as a glob.

Without this, that regression didn't cause test failure because the checks
right after it were tripping anyway.

 test/cases/db-update.bats | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/test/cases/db-update.bats b/test/cases/db-update.bats
index 1da7eef..6604841 100644
--- a/test/cases/db-update.bats
+++ b/test/cases/db-update.bats
@@ -92,7 +92,16 @@ load ../lib/common
 	checkPackage extra pkg-any-a
-	releasePackage extra pkg-any-a
+	# don't let __buildPackage use the cached build; we want to
+	# force a new build with a different PKGEXT.
+	if [[ -n ${BUILDDIR} ]]; then
+		mv -T "${BUILDDIR}/$(__getCheckSum "${TMP}/svn-packages-copy/pkg-any-a/trunk/PKGBUILD")"{,.bak}
+	fi
+	PKGEXT=.pkg.tar.gz releasePackage extra pkg-any-a
+	if [[ -n ${BUILDDIR} ]]; then
+		rm -rf "${BUILDDIR}/$(__getCheckSum "${TMP}/svn-packages-copy/pkg-any-a/trunk/PKGBUILD")"
+		mv -T "${BUILDDIR}/$(__getCheckSum "${TMP}/svn-packages-copy/pkg-any-a/trunk/PKGBUILD")"{.bak,}
+	fi
 	run db-update
 	[ "$status" -ne 0 ]

More information about the arch-projects mailing list