You can probably use a portage hook to do it. I haven't tested it, but
something along the lines of creating a file at
"/etc/portage/env/sys-boot/grub" which contains an implementation of the
"post_pkg_postinst()" function. Then, you can copy the logic from the
ebuild to determine whether the version number has changed. Realistically
though, I'd probably skip the conditional logic and let the hook run
grub-install every time.

Some ebuilds print rather important messages, and if you're updating
software regularly, there shouldn't be tons of messages in
/var/log/portage/elog/summary.log. At the very least, I would configure it
to email me a copy of the messages so that I can review them as soon as I
can.

On Mon, Apr 17, 2023 at 4:26 PM Dr Rainer Woitok <rainer.woi...@gmail.com>
wrote:

> Mitch,
>
> On Monday, 2023-04-17 08:15:51 -0400, you wrote:
>
> > I just took a quick glance at the ebuild, and it looks like it should
> print
> > a reminder ("Re-run grub-install to update installed boot code!") every
> > time you upgrade from an older version to a newer one, but it also looks
> > like the reminder gets skipped if you're re-emerging the same version.
> >
> >
> https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-boot/grub/grub-2.06-r4.ebuild#n314
>
> Thankyou very much for this information.   But is there anyone out there
> who skims through  tons of SUCCESSFUL emerge log files  after every rou-
> tine upgrade?   Personally,  I only check the logs in case of build fai-
> lures or conflicts.
>
> By the way, I only see this message in the build logs for versions 2.06-
> r4 and 2.06-r6, but not in older logs.  So maybe that's a rather new ad-
> dition to the ebuild file?
>
> Since I do my routine upgrades  via a script anyway,  I now retrieve the
> name of the most recent  Grub build log  before I really  start "emerge"
> and after "emerge" finished,  and if the two names differ  and the newer
> file contains this "Re-run ..." message,  I now run  "grub-install" from
> within this script.  Problem solved.
>
> But I have the vague feeling there should be a more foolproof solution.
>
> Sincerely,
>   Rainer
>

Reply via email to