Bug#983421: init-system-helpers: please respect DPKG_ROOT when checking for /usr/sbin/policy-rc.d

Johannes Schauer Marin Rodrigues josch at debian.org
Mon Nov 15 09:28:49 GMT 2021


Hi,

Quoting Felipe Sateler (2021-11-12 16:37:01)
> On Thu, Nov 11, 2021, 11:45 Johannes Schauer Marin Rodrigues <josch at debian.org> wrote:
> > if desired, I can greatly reduce the size of the patch by removing the
> > assertdpkgroot() and assertnotdpkgroot() functions. I used those to make
> > sure
> > that the paths as they are passed around in deb-systemd-helper are having
> > DPKG_ROOT prepended only if desired and if yes, only once. Since our tests
> > did
> > not trigger any errors and produces bit-by-bit identical results, I assume
> > that
> > it works correctly and theoretically the two assert functions could be
> > removed,
> > thus reducing the size of the patch significantly.
> >
> 
> 
> My concern is more the non-DRYness of it. What if a new path is added? Do I
> need to check dpkgroot or not? I think some abstraction is missing in the
> tools (that is, am I operating on the target or the host?)

do you have some concrete ideas of how you'd like me to rewrite my patch so
that it addresses your concern?

> > For normal installations, the value of $DPKG_ROOT is the empty string. I
> > think it's easy to see that in the normal case, the behaviour of the script
> > would not change.
> >
> 
> This is the test I'd like. More precisely, that the tools are doing what they
> are supposed to do.

I see that the test suite is using an unpackaged Perl module and requires root
to execute. I can rewrite the testsuite to be runnable without root and to not
require that unpackaged Perl module. Would you like me to do that? Then I'd
first file a merge request for the improved test suite and then rebase my
DPKG_ROOT patch on top of that once you are satisfied with the testsuite
improvements.

Thanks!

cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20211115/b04c8c48/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list