Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Restore previous behaviour for REPOS_DIR and -r flag
Baptiste Daroussin committed 10 years ago
commit 3a5f72ace5058c8e4f6eda09552a0ae72af7e8da
parent a90f210
3 files changed +24 -14
modified libpkg/pkg_config.c
@@ -929,9 +929,9 @@ pkg_ini(const char *path, const char *reposdir, pkg_init_flags flags)
	}

	if (path == NULL)
-
		path = PREFIX"/etc/pkg.conf" + 1;
-

-
	conffd = openat(rootfd, path, O_RDONLY);
+
		conffd = openat(rootfd, PREFIX"/etc/pkg.conf" + 1, 0);
+
	else
+
		conffd = open(path, O_RDONLY);
	if (conffd == -1 && errno != ENOENT) {
		pkg_emit_error("Cannot open %s/%s: %s",
		    pkg_rootdir != NULL ? pkg_rootdir : "",
modified tests/frontend/extract.sh
@@ -32,7 +32,8 @@ EOF
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qy \
+
			${TMPDIR}/test-1.txz

OUTPUT="${TMPDIR}/target/local.sqlite
${TMPDIR}/target${TMPDIR}/a
@@ -55,7 +56,8 @@ ${TMPDIR}/target${TMPDIR}/a
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy \
+
			${TMPDIR}/test-1.txz

	atf_check \
		-o inline:"${OUTPUT}" \
@@ -86,7 +88,8 @@ EOF
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy \
+
			${TMPDIR}/test-1.txz

	test -d ${TMPDIR}/target${TMPDIR}/plop || atf_fail "directory not extracted"
}
@@ -117,7 +120,8 @@ EOF
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy \
+
			${TMPDIR}/test-1.txz

	atf_check \
		-o match:"^-r-sr-xr-- " \
@@ -156,7 +160,8 @@ EOF
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null  -r ${TMPDIR}/target install -qfy \
+
			${TMPDIR}/test-1.txz

	atf_check \
		-o match:"^-r-sr-xr-- " \
@@ -190,7 +195,8 @@ chflags_body()
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy \
+
		    ${TMPDIR}/test-1.txz

	atf_check \
		-o match:"nodump" \
@@ -219,7 +225,8 @@ chflags_schg_body()
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy \
+
			${TMPDIR}/test-1.txz

	atf_check \
		-o match:"schg" \
@@ -232,7 +239,8 @@ chflags_schg_body()
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy \
+
			${TMPDIR}/test-1.txz
}

chflags_schg_cleanup()
@@ -262,5 +270,6 @@ EOF
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy \
+
			${TMPDIR}/test-1.txz
}
modified tests/frontend/vital.sh
@@ -29,13 +29,14 @@ EOF
		-o empty \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.txz
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy \
+
			${TMPDIR}/test-1.txz

	atf_check \
		-o inline:"1\n" \
		-e empty \
		-s exit:0 \
-
		pkg -r ${TMPDIR}/target query "%V" test
+
		pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target query "%V" test

	atf_check \
		-o empty \