Run '/usr/sbin/freebsd-update.fixed fetch' first
Poudriere should probably check whether freebsd-update found any updates before telling it to install the (possibly nonexistent) updates, in order to avoid confusing users with the above message.
~/git/poudriere # grep 'Run.*first' `which freebsd-update` echo "Run '$0 install' first." echo "Run '$0 fetch' first."
This is coming from freebsd-update
.
Without more context in the report I'm not sure where this is being shown and under what conditions.
The problem is that jail.sh runs /usr/sbin/freebsd-update.fixed fetch install
. If fetch
finds that there are no updates needed (e.g., it's a new release which hasn't had any security advisories yet) then the install
prints the confusing message.
The solution is to run /usr/sbin/freebsd-update.fixed fetch
, check if any updates were fetched, and then run /usr/sbin/freebsd-update.fixed install
.
How do I determine if any updates were fetched?
Check if /var/db/freebsd-update/f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install
is a symlink.
I'd rather not do such a layer violation and make Poudriere dependent on freebsd-update's internal files like this. I will just sed out the message instead (as done with other code like the tty checks).
If Poudriere can detect if a fetch was just done, then why does freebsd-update print the message?
why does freebsd-update print the message
Because freebsd-update fetch install
is a synonym for freebsd-update fetch; freebsd-update install
.
Right, but you're telling me that poudriere can detect if an updates were just fetched, so freebsd-update install
should be able to as well and not print a pointless message if there was nothing fetched already. A simple mtime comparison would work on this as we do with pkg update
by only showing the message after the last fetch is a certain period of time stale.
Yes, freebsd-update should probably handle that. The reason I didn't do that originally is that I didn't want to encourage people to blindly download and install updates.
But at this point even if I fix freebsd-update, poudriere will invoking the old freebsd-update code for several years so teaching poudriere to remove that would save some confusion.
Most helpful comment
Yes, freebsd-update should probably handle that. The reason I didn't do that originally is that I didn't want to encourage people to blindly download and install updates.
But at this point even if I fix freebsd-update, poudriere will invoking the old freebsd-update code for several years so teaching poudriere to remove that would save some confusion.