Control: tags -1 - moreinfo
On Fri, 07 Oct 2022 08:36:36 +0800 Paul Wise wrote: [...] > Refocusing this bug report on the pinning issue. > > On Fri, 2022-10-07 at 00:26 +0200, Francesco Poli wrote: > > > Specifically, when apt-listbugs sees that its stdout is not a terminal, > > it automatically assume the following options: --quiet --force-pin > > --force-no > > This automatic behavior change should ensure that all buggy packages > > (of the upgrade/installation that is about to happen) are pinned, > > without any interactive prompt. > > I tested this again and it definitely is not happening, see below. > > Reading the code, it seems the issue is that the save() function is > only ever called by the view() function when the answer is y/n but > never when the answer is p which is set by --force-pin. Paul, I really have to thank you for reporting this bug and for investigating it (through tests and by reading the code)! It turns out that this regression was introduced (shame on me!) when I decided to defer the update of files to the end of the apt-listbugs session. The deferment was useful to implement the undo ('u') command. But, unfortunately, I didn't realize that save() would not be called at all in the force-pin case... :-( Now everything seems to work as intended: the pinnings are saved, even when apt-listbugs is run with no controlling terminal. [...] > > More investigation is needed in order to figure out why you didn't see > > the pinning added. > > Provided some debugging at the end of this mail. Thanks again, the debugging session you provided was also pretty useful to understand what was going on! [...] > > I admit that I am not familiar with unattended-upgrades, hence I am not > > sure how to configure it for the twice-in-a-row upgrade. > > I hope it's easy enough. > > I can only configure unattended-upgrades to run more often, there is no > option to ignore failure of a particular upgrade and retry it. [...] Support for attempting unattended upgrades twice in a row could perhaps be added to file '/usr/lib/apt/apt.systemd.daily'. Please note that this file is shipped in package 'apt'. One way to implement it is maybe by adding the following code before line 495: if [ "$TwiceInARow" = "true" ]; then unattended-upgrade $XUUPOPT fi The surrounding snippet of code would thus become something like: if command -v unattended-upgrade >/dev/null && check_stamp $UPGRADE_STAMP $UnattendedUpgradeInterval; then if [ "$TwiceInARow" = "true" ]; then unattended-upgrade $XUUPOPT fi if unattended-upgrade $XUUPOPT; then update_stamp $UPGRADE_STAMP debug_echo "unattended-upgrade (success)" else debug_echo "unattended-upgrade (error)" fi else debug_echo "unattended-upgrade (not run)" fi Near line 402 something like the following could be added: TwiceInARow="false" eval $(apt-config shell TwiceInARow APT::Periodic::Twice-in-a-Row) This is totally untested and based on a quick glance at the file. There could be better ways. Please take a look at it and see whether you like it. Maybe you could enhance this rough idea a bit and propose it to APT developers... -- http://www.inventati.org/frx/ There's not a second to spare! To the laboratory! ..................................................... Francesco Poli . GnuPG key fpr == CA01 1147 9CD2 EFDF FB82 3925 3E1C 27E1 1F69 BFFE
pgp0rKf2ZMpaf.pgp
Description: PGP signature