[dbscripts,1/4] tests: make dummy copies of all pkgpool packages in the test environment

Message ID 20181204180944.9648-1-eschwartz@archlinux.org
State New
Headers show
Series
  • [dbscripts,1/4] tests: make dummy copies of all pkgpool packages in the test environment
Related show

Commit Message

Eli Schwartz via arch-projects Dec. 4, 2018, 6:09 p.m. UTC
Prerequisite for reproducible archives of packages.

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

Patch

diff --git a/test/lib/common.bash b/test/lib/common.bash
index bc2b4e6d..3dda5f62 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -102,6 +102,7 @@  setup() {
 	SVNREPO="file://${TMP}/svn-packages-repo"
 	PKGREPOS=('core' 'extra' 'testing')
 	PKGPOOL='pool/packages'
+	EXTRA_PKGPOOLS=('pool/community')
 	SRCPOOL='sources/packages'
 	TESTING_REPO='testing'
 	STABLE_REPOS=('core' 'extra')
@@ -123,9 +124,18 @@  eot
 			mkdir -p "${TMP}/ftp/${r}/os/${a}"
 		done
 	done
-	mkdir -p "${TMP}/ftp/${PKGPOOL}"
+	mkdir -p "${TMP}/ftp/${PKGPOOL}"{,-reproducible}
+	mkdir -p "${TMP}/ftp/${EXTRA_PKGPOOLS[0]}"
 	mkdir -p "${TMP}/ftp/${SRCPOOL}"
 
+	# make dummy packages for "reproducibility"
+	comm -12 <(pacman -Sql core extra | sort -u) <(pacman -Qq | sort -u) | pacman -Sddp - | while read -r line; do
+		touch "${FTP_BASE}/${PKGPOOL}/${line##*/}"{,.sig}
+	done
+	comm -12 <(pacman -Sql community | sort -u) <(pacman -Qq | sort -u) | pacman -Sddp - | while read -r line; do
+		touch "${FTP_BASE}/${EXTRA_PKGPOOLS[0]}/${line##*/}"{,.sig}
+	done
+
 	svnadmin create "${TMP}/svn-packages-repo"
 	svn checkout -q "file://${TMP}/svn-packages-repo" "${TMP}/svn-packages-copy"
 }