Don Lewis <truck...@freebsd.org> wrote:

> I use poudriere to pre-build my desired package set on a headless box
> running -CURRENT before starting the upgrade.  It's now close to 24
> hours for a full build of my package set.  That way, I don't bog down my
> desktop while the build is in progress, and I can defer the upgrade if
> anything vital fails to build.  I don't have to worry about getting
> stuck in a half-upgraded state.  My only downtime is during pkg upgrade.

That sounds like a good way of doing it. I've been doing it my old way since
way before poudriere was a thing. I should maybe look to change.

> If you use "pkg prime-origins" to get the list of ports, that is lot
> smaller set to sort through.

Thanks! I didn't know about that. I use pkg query in my script, but had
missed the "%a == 0" thing to not show installed dependencies.

Admittedly I have to fiddle with the script before running it (in case it
tries to install old versions of perl/python etc.) so that should help alot.

I'd still need to check the full list, because some of my own software may
be using a dependent-port, but now it will be alot easier, thanks.

Incidently, my script runs in 3 phases, the first goes through make config,
the second pkg-deletes everything, and the third doing the install in BATCH
mode at idle20 or idprio, finally listing failures at the end. It's not ideal,
but it's not too bad. I find that pkg deleting whilst everything is up means
most of the things continue to work even though they've been deleted from the
filesystem.

I update 8 servers this way, covering various different architecture, but I
probably don't update them as often as I would if it was easier!
>
> > I like to use pkg delete -af because I want to catch orphaned files, but 
> > bluntly,
> > I could just save /usr/local/etc and nuke the rest of /usr/local and 
> > /var/db/pkg
>
> Any thoughts on how to do the same housecleaning on the base system?

I install base from src too, again at idle priority whilst the machine
is live. For housecleaning,  I do run make delete-old and make
delete-old-libs.

I also patched the installer so that it updates the timestamp on any
'installed' file even if the file hasn't changed.

% cat /usr/common/patches/src/share/mk/patch:share_mk_bsd.confs.mk 
# When installing world, ensure files have their timestamp updated:
--- share/mk/bsd.confs.mk.orig  2019-09-05 15:15:47.000000000 +0100
+++ share/mk/bsd.confs.mk       2023-03-12 03:28:26.195219000 +0000
@@ -113,7 +113,7 @@
 .        if ${cnf} == "/dev/null"
 INSTALL_COPY=
 .        else
-INSTALL_COPY=  -C
+INSTALL_COPY=  -c
 .        endif

This way I can then just use a find ... -mtime -2 ... to catch stale files,
which I then investigate further.

As for /etc I still use mergemaster, but that requires a lot more manual
effort these days. I intend to get my head around etcupdate in time for
my next base upgrade!

Thanks again for the feedback, it's been useful.

Cheers, Jamie

Reply via email to