Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Aug 2025 07:58:01 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Mark Johnston <markj@FreeBSD.org>, dev-commits-src-main@freebsd.org
Cc:        FreeBSD-pkgbase@freebsd.org, FreeBSD-pkg@freebsd.org
Subject:   RE: git: 66c75fa63aff - main - freebsd-update: Fix the pkgbase check [-r basedir vs. -c basedir use --and the documentation?]
Message-ID:  <B58BF15E-53E7-4511-9684-0EA4BB225633@yahoo.com>
References:  <B58BF15E-53E7-4511-9684-0EA4BB225633.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Mark Johnston <markj_at_FreeBSD.org> wrote on
Date: Fri, 08 Aug 2025 13:00:45 UTC :

> The branch main has been updated by markj:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3D66c75fa63aff40e9c587345b2cc6b814=
8e396de8
>=20
> commit 66c75fa63aff40e9c587345b2cc6b8148e396de8
> Author: Mark Johnston <markj@FreeBSD.org>
> AuthorDate: 2025-08-06 20:36:05 +0000
> Commit: Mark Johnston <markj@FreeBSD.org>
> CommitDate: 2025-08-08 12:51:54 +0000
>=20
> freebsd-update: Fix the pkgbase check
>=20
> Even on a pkgbase system, it should be possible to use freebsd-update =
-j
> to upgrade a non-pkgbase jail, at least for the time being. However,
> the check_pkgbase() call came before get_params, so BASEDIR was always
> set to /.
>=20
> Make check_pkgbase() a pure function and call it after get_params().
> While here, use pkg -r ${BASEDIR} instead of pkg -c ${BASEDIR} since =
the
> latter requires root privileges.

Does this -r vs -c change have consequences such
as which /var/cache/pkg/ or whatever is updated
(or if such is updated)?

In other words, can -r fully substitute for -c?

(If it could, I'd wonder why -c even exists.)

Might there be uninstended conseqeucnes to the
change?

May be the pkg man page should be more explicit
about when to use -r vs. -c for the base dir?

> freebsd-update is supposed to be run
> as root, but it doesn't actually check this that I can see, so let's =
not
> make that assumption here since it affects the result of the function
> (i.e., pkg -c ${BASEDIR} always fails as a non-root user).
>=20
> Reviewed by: des
> Fixes: 856e158dc4aa ("freebsd-update: improve pkgbase check")
> MFC after: 2 weeks
> Differential Revision: https://reviews.freebsd.org/D51770


=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B58BF15E-53E7-4511-9684-0EA4BB225633>