Skip to content

Commit e8e0292

Browse files
committed
download_from_repo: Only query and fetch from FreeBSD repo
e37cf98 changed `pkg update` to only update FreeBSD repo. 14.3 now ships with two repos configured - FreeBSD and FreeBSD-kmods. Later calls to `pkg rquery` and `pkg fetch` failed with this multi-repo configuration. Change-Id: Ic9870a0efc9ab9545eecd2e10281ea746a6a6964
1 parent 282bb72 commit e8e0292

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/share/poudriere/common.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4528,13 +4528,13 @@ download_from_repo() {
45284528
return 0
45294529
fi
45304530
# Don't trust pkg-update to return its error
4531-
if ! injail ${pkg_bin} rquery -U %n pkg >/dev/null; then
4531+
if ! injail ${pkg_bin} rquery -U -r FreeBSD %n pkg >/dev/null; then
45324532
msg "Package fetch: Failed to fetch package repository."
45334533
rm -f "${missing_pkgs}"
45344534
return 0
45354535
fi
45364536

4537-
remote_pkg_ver="$(injail ${pkg_bin} rquery -U %v "${P_PKG_PKGBASE:?}")"
4537+
remote_pkg_ver="$(injail ${pkg_bin} rquery -U -r FreeBSD %v "${P_PKG_PKGBASE:?}")"
45384538
local_pkg_name="${P_PKG_PKGNAME:?}"
45394539
local_pkg_ver="${local_pkg_name##*-}"
45404540
case "$(pkg_version -t "${remote_pkg_ver}" "${local_pkg_ver}")" in
@@ -4549,25 +4549,25 @@ download_from_repo() {
45494549
# (like pkg rquery -U), and it uses various locking that isn't needed
45504550
# here. Grab all the options for comparison.
45514551
remote_all_options=$(mktemp -t remote_all_options)
4552-
injail ${pkg_bin} rquery -U '%n %Ok %Ov' > "${remote_all_options}"
4552+
injail ${pkg_bin} rquery -U -r FreeBSD '%n %Ok %Ov' > "${remote_all_options}"
45534553
remote_all_pkgs=$(mktemp -t remote_all_pkgs)
4554-
injail ${pkg_bin} rquery -U '%n %n-%v %?O' > "${remote_all_pkgs}"
4554+
injail ${pkg_bin} rquery -U -r FreeBSD '%n %n-%v %?O' > "${remote_all_pkgs}"
45554555
remote_all_deps=$(mktemp -t remote_all_deps)
4556-
injail ${pkg_bin} rquery -U '%n %dn-%dv' > "${remote_all_deps}"
4556+
injail ${pkg_bin} rquery -U -r FreeBSD '%n %dn-%dv' > "${remote_all_deps}"
45574557
remote_all_annotations=$(mktemp -t remote_all_annotations)
45584558
remote_all_cats=$(mktemp -t remote_all_cats)
45594559
case "${IGNORE_OSVERSION-}" in
45604560
"yes") ;;
45614561
*)
4562-
injail ${pkg_bin} rquery -U '%n %At %Av' > "${remote_all_annotations}"
4563-
injail ${pkg_bin} rquery -U '%n %C' > "${remote_all_cats}"
4562+
injail ${pkg_bin} rquery -U -r FreeBSD '%n %At %Av' > "${remote_all_annotations}"
4563+
injail ${pkg_bin} rquery -U -r FreeBSD '%n %C' > "${remote_all_cats}"
45644564
;;
45654565
esac
45664566
abi="$(injail "${pkg_bin}" config ABI)"
45674567
remote_all_abi=$(mktemp -t remote_all_abi)
4568-
injail ${pkg_bin} rquery -U '%n %q' > "${remote_all_abi}"
4568+
injail ${pkg_bin} rquery -U -r FreeBSD '%n %q' > "${remote_all_abi}"
45694569
remote_all_prefix=$(mktemp -t remote_all_prefix)
4570-
injail ${pkg_bin} rquery -U '%n %p' > "${remote_all_prefix}"
4570+
injail ${pkg_bin} rquery -U -r FreeBSD '%n %p' > "${remote_all_prefix}"
45714571

45724572
parallel_start
45734573
wantedpkgs=$(mktemp -t wantedpkgs)
@@ -4611,7 +4611,7 @@ download_from_repo() {
46114611
err 1 "null mount failed for pkg cache"
46124612
if ! JNETNAME="n" injail xargs \
46134613
env ASSUME_ALWAYS_YES=yes \
4614-
${pkg_bin} fetch -U < "${wantedpkgs}"; then
4614+
${pkg_bin} fetch -U -r FreeBSD < "${wantedpkgs}"; then
46154615
msg "Package fetch: Error fetching packages"
46164616
umountfs "${MASTERMNT:?}/var/cache/pkg"
46174617
rm -f "${wantedpkgs}"

0 commit comments

Comments
 (0)