nanoBSD: cust_pkgng() bootstraps pkg(8) regardless of required pkg-X.Y.Z
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Jan 2023 19:08:49 UTC
Hello,
I noticed that in cust_pkng(), pkg(7) bootstraps to pkg(8) even though
the function itself requires a pkg-* for bootstrapping. This also seems
to be the reason why _.cust.cust_pkng notes that "the most recent
version of pkg-X.Y.Z is already installed" if the function has been run
with an active internet connection - first, pkg(7) bootstraps to pkg(8),
which then tries to install pkg(8) once more.
At the same time, I would think that if the nanoBSD-image is for an
entirely different plattform/architecture, the just bootstrapped pkg(8)
would not be able to run during operation, since it has been compiled
for the "host" system.
My current solution is to change the command set in ${PKGCMD} to use the
host's pkg(8), which chroots itself to ${NANO_WORLDDIR}. This also makes
the separate calls to chroot(8) by means of CR() and CR0() unnecessary.
Since the latter does not seem to be used anywhere else and the former
only once in clean_build(), they can be removed altogether if CR() is
replaced with a direct call to chroot(8) in clean_build().
Am I missing anything? Otherwise I would go ahead and open a PR.
Regards,
Michael