[arch-projects] [dbscripts] [PATCH v2 1/2] tests: make dummy archive copies of all packages in the test environment

Eli Schwartz eschwartz at archlinux.org
Tue Jan 8 23:40:36 UTC 2019


Prerequisite for reproducible archives of packages.

Signed-off-by: Eli Schwartz <eschwartz at archlinux.org>
---
 test/lib/common.bash | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/lib/common.bash b/test/lib/common.bash
index bc2b4e6d..ab7d5963 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -99,6 +99,8 @@ setup() {
 	export DBSCRIPTS_CONFIG=${TMP}/config.local
 	cat <<eot > "${DBSCRIPTS_CONFIG}"
 	FTP_BASE="${TMP}/ftp"
+	ARCHIVE_BASE="${TMP}/archive"
+	ARCHIVEUSER=""
 	SVNREPO="file://${TMP}/svn-packages-repo"
 	PKGREPOS=('core' 'extra' 'testing')
 	PKGPOOL='pool/packages'
@@ -126,6 +128,14 @@ eot
 	mkdir -p "${TMP}/ftp/${PKGPOOL}"
 	mkdir -p "${TMP}/ftp/${SRCPOOL}"
 
+	# make dummy packages for "reproducibility"
+	pacman -Qq | pacman -Sddp - | while read -r line; do
+		line=${line##*/}
+		pkgname=${line%-*-*-*}
+		mkdir -p "${ARCHIVE_BASE}/packages/${pkgname:0:1}/${pkgname}"
+		touch "${ARCHIVE_BASE}/packages/${pkgname:0:1}/${pkgname}/${line}"{,.sig}
+	done
+
 	svnadmin create "${TMP}/svn-packages-repo"
 	svn checkout -q "file://${TMP}/svn-packages-repo" "${TMP}/svn-packages-copy"
 }
-- 
2.20.1


More information about the arch-projects mailing list