[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#1117735: Restarting systemd user units on package upgrade



Quoting Sean Whitton (2025-12-04 11:23:17)
> Hello,
> 
> On Wed 03 Dec 2025 at 09:45pm +01, Niels Thykier wrote:
> 
> > Jonas Smedegaard:
> >> Quoting Sean Whitton (2025-12-03 20:10:19)
> >>> On Wed 03 Dec 2025 at 07:12pm +01, Niels Thykier wrote:
> >>>> For the `if $(compat 14 is available); then`, the `dh_assistant` command might
> >>>> be useful (in case you were not aware of its functionality).
> >>>
> >>> Thanks, I wasn't!
> >> ...but beware that according to the changelog, dh_assistant was
> >> introduced in release 13.5 which is not in bullseye.
> >>   - Jonas
> >>
> >
> > True, had not considered that.
> >
> > Though, git history suggests that the absence of `dh_assistant` is sufficient
> > as "no compat 14" for this particular case. The `dh_installsystemduser` change
> > is from 13.5.3, so `dh_assistant` will always be present for this case. :)
> 
> This is what I implemented:
> 
> --8<---------------cut here---------------start------------->8---
> # At debhelper compat level 14, dh_installsystemduser will handle restarting
> # tag2upload-oracled on package upgrade: see #1117735.
> # We want this for the live service, but don't want to upgrade the whole
> # package to compat 14 to preserve buildability on older releases of Debian.
> # Debian::Debhelper::Dh_Lib::MAX_COMPAT_LEVEL has been available for a long
> # time; if it isn't, that won't go by silently because intcmp will exit the
> # build when it gets a non-numeric argument.
> MAX_COMPAT_LEVEL=$(shell perl -MDebian::Debhelper::Dh_Lib \
>                 -we'print Debian::Debhelper::Dh_Lib::MAX_COMPAT_LEVEL')
> override_dh_installsystemduser:
>         $(intcmp $(MAX_COMPAT_LEVEL),14,,DH_COMPAT=14) \
>                 dh_installsystemduser --name=tag2upload-oracled --no-enable
> --8<---------------cut here---------------end--------------->8---

Possibly relevant: the make function intcmp was introduced in make 2022.

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/
 * Sponsorship: https://ko-fi.com/drjones

 [x] quote me freely  [ ] ask before reusing  [ ] keep private


Reply to: