Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
repo: accept packages in all supported formats
Baptiste Daroussin committed 5 years ago
commit 45722914d032d545a5bab9333d2e2e72226215bf
parent 6967ed9
2 files changed +32 -2
modified libpkg/pkg_repo_create.c
@@ -269,7 +269,7 @@ pkg_create_repo_read_fts(struct pkg_fts_item **items, FTS *fts,
		if (ext == NULL)
			continue;

-
		if (strcmp(ext + 1, packing_format_to_string(meta->packing_format)) != 0)
+
		if (!packing_is_valid_format(ext + 1))
			continue;

		*ext = '\0';
modified tests/frontend/repo.sh
@@ -5,7 +5,8 @@
tests_init \
	repo_v1 \
	repo_v2 \
-
	repo_multiversion
+
	repo_multiversion \
+
	repo_multiformat

repo_v1_body() {
	touch plop
@@ -151,3 +152,32 @@ EOF
	atf_check -o match:"Installing test-1.1" \
		pkg -C ./pkg.conf install -y test
}
+

+
repo_multiformat_body() {
+
	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg test test 1.0 "${TMPDIR}"
+
	atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg plop plop 1.1 "${TMPDIR}"
+
	atf_check pkg create -M test.ucl
+
	atf_check pkg create --format tar -M plop.ucl
+

+
	atf_check \
+
		-o inline:"Creating repository in .:  done\nPacking files for repository:  done\n" \
+
		pkg repo .
+

+
	cat > pkg.conf << EOF
+
PKG_DBDIR=${TMPDIR}
+
REPOS_DIR=[]
+
repositories: {
+
	local: { url : file://${TMPDIR} }
+
}
+
EOF
+

+
	atf_check -o ignore \
+
		pkg -C ./pkg.conf update
+

+
	# Ensure we can pickup the old version
+
	atf_check -o match:"Installing test-1\.0" \
+
		pkg -C ./pkg.conf install -y test
+

+
	atf_check -o match:"Installing plop-1\.1" \
+
		pkg -C ./pkg.conf install -y plop
+
}