Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Revert "pkg-add: provide fallback for version mismatch"
Baptiste Daroussin committed 4 years ago
commit 615419585cfba630f08539abad6d73d347250b57
parent dca434b
2 files changed +3 -27
modified libpkg/pkg_add.c
@@ -871,7 +871,7 @@ pkg_add_check_pkg_archive(struct pkgdb *db, struct pkg *pkg,
	int	ret, retcode;
	struct pkg_dep	*dep = NULL;
	char	bd[MAXPATHLEN], *basedir = NULL;
-
	char	dpath[MAXPATHLEN] = "", *ppath;
+
	char	dpath[MAXPATHLEN], *ppath;
	const char	*ext = NULL;
	struct pkg	*pkg_inst = NULL;
	bool	fromstdin;
@@ -943,9 +943,7 @@ pkg_add_check_pkg_archive(struct pkgdb *db, struct pkg *pkg,
		if (dep->version != NULL && dep->version[0] != '\0') {
			snprintf(dpath, sizeof(dpath), "%s/%s-%s%s", bd,
				dep->name, dep->version, ext);
-
		}
-

-
		if (strlen(dpath) == 0 || access(dpath, F_OK) != 0) {
+
		} else {
			snprintf(dpath, sizeof(dpath), "%s/%s-*%s", bd,
			    dep->name, ext);
			ppath = pkg_globmatch(dpath, dep->name);
modified tests/frontend/add.sh
@@ -11,8 +11,7 @@ tests_init \
		add_quiet \
		add_stdin \
		add_stdin_missing \
-
		add_no_version \
-
		add_wrong_version
+
		add_no_version

initialize_pkg() {
	touch a
@@ -231,24 +230,3 @@ EOF
	atf_check -o ignore -s exit:0 \
		pkg add final-1.pkg
}
-

-
add_wrong_version_body() {
-

-
	for p in test test-lib final ; do
-
		atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg ${p} ${p} 1
-
		if [ ${p} = "final" ]; then
-
			cat << EOF >> final.ucl
-
deps {
-
	test {
-
		origin = "test";
-
		version = "2";
-
	}
-
}
-
EOF
-
		fi
-
		atf_check -o ignore -s exit:0 \
-
			pkg create -M ${p}.ucl
-
	done
-
	atf_check -o ignore -s exit:0 \
-
		pkg add final-1.pkg
-
}