On 4/20/23 12:57, Alistair Crooks wrote:
On Wed, 19 Apr 2023 at 21:58, Jason Bacon <jtocino%gmx.com@localhost <mailto:jtocino%gmx.com@localhost>> wrote:
I don't know if there's a foolproof way to determine the location of
the
pkgsrc tree, but I will look into this when I get a chance. pkg_chk
relies on $PKGSRCDIR for example, but I don't know if anything like
that
is guaranteed to be defined for every installation.
[I took the OP off the Cc list, as this is mainly about general pkgsrc
updating issues. Sorry if I was overzealous, nothing meant or implied --
agc]
I think you're looking at this the wrong way - since there is no single
canonical place to put a pkgsrc tree, (indeed, I know of a number of
people who have current and latest branch trees), you need to pass the
pkgsrc directory to the script which updates it. The scm tools and other
locations should flow from that (if building packages from source, or
building binary packages to later distribute with pkgin).
Disclaimer - I took a look at auto-admin, and there are some things that I really like, and some effects that I'm less keen on (it updated the whole tree to the latest branch, for example, which, while being cool, was not what I wanted).
However, we're all different, and have different needs and ways of working (different scm, different users, different trees, binary/source packages, different prefix/localbases, pkg_chk/pkg_comp/pkg_rolling-replace etc)
And in case anyone's wondering what I use, I derive most info from the specific pkgsrc tree, and then tag on the back of pkg_rolling-replace. I usually build everything from source:
[2023/04/19 Wed 22:32:44] agc@netbsd-012 ~ [582] > sudo freshen /usr/pkgsrc Password: Using cvs to update /usr/pkgsrc Updating pkgsrc sources in /usr/pkgsrc using cvs as agc ? editors/vile/patches M editors/vile/distinfo U lang/qore/patches/patch-include_qore_macros.h U math/nickle/patches/patch-configure U math/nickle/patches/patch-main.c U textproc/icu/patches/patch-common_unicode_ures.hUsing pkg_rolling-replace to freshen packages in /usr/pkg from /usr/pkgsrc as root
RR> Checking for mismatched installed packages using pkg_chk RR> Excluding the following mismatched packages: rr> EXCLUDE=[] RR> Checking for rebuild-requested installed packages (rebuild=YES) RR> Checking for unsafe installed packages (unsafe_depends_strict=YES) RR> Packages to rebuild: rr> MISMATCH_TODO=[] rr> REBUILD_TODO=[] rr> UNSAFE_TODO=[] RR> No more packages to replace; done. [2023/04/20 Thu 10:30:04] agc@netbsd-012 ~ [583] >I've slapped a copyright notice on it, and whipped up a man page, and will add them to this mail, if anyone's interested. Probably still a WIP
(Not trying to rain on anyone's parade - the auto-admin script base is huge, well done, and very detailed. And nicely all in POSIX sh. Just not for me, sorry)
Best, Alistair
I tend toward keeping things simple, and demanding the minimum from the user, so requiring the user to provide the location of the pkgsrc tree every time is something I would avoid unless it's really necessary. Though, I have thought about making it an option for more advanced users if that would be helpful to anyone. I suspect, though, that such users don't need a tool like auto-update-pkgsrc. It's aimed more at helping the typical user expedite the process and avoid human error.
The current implementation in wip makes no assumptions about the location of the tree relative to PREFIX. It's taken from PKGSRCDIR, which appears to be recorded during bootstrap. Assuming that moving a pkgsrc tree after bootstrapping is considered a bad idea for other reasons, this should not be a limiting factor.
I'm not sure what you meant by "updated the whole tree to the latest branch". Can you elaborate?
Thanks, J