Bug#880095: /usr/bin/dh_girepository: please support Rules-Requires-Root: no

Niels Thykier niels at thykier.net
Sun Oct 29 12:39:00 UTC 2017


On Sun, 29 Oct 2017 12:28:48 +0000 Simon McVittie <smcv at debian.org> wrote:
> Package: gobject-introspection
> Version: 1.54.1-1
> Severity: wishlist
> File: /usr/bin/dh_girepository
> 
> I tried converting src:flatpak to Rules-Requires-Root: no, which skips
> use of fakeroot, instead running the entire build as the ordinary user and
> telling dpkg-dev to consider all files in the tarballs inside the .deb to be
> owned by root:root. However, that fails:
> 
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
>    dh_strip
>    dh_makeshlibs
>    dh_shlibdeps
>    dh_girepository
> install: cannot change owner and permissions of 'debian/gir1.2-flatpak-1.0/DEBIAN': Operation not permitted
> dh_girepository: install -o 0 -g 0 -d debian/gir1.2-flatpak-1.0/DEBIAN returned exit code 1
> debian/rules:11: recipe for target 'binary' failed
> 
> If dh_girepository just used "install [-m MODE] -d DEST" and
> "install [-m MODE] SOURCE DEST" instead of adding -o 0 -g 0, this would
> probably work, because the default for install(1) is to install the files
> owned by the current uid and the current primary gid.
> 
> Regards,
>     smcv
> 
> [...]


Given that dh_girepository relies on debhelper's Dh_Lib, I would
recommend that it adopts the "install_dir" function from Dh_Lib.

This would replace:

 	        if (! -d "$tmp/DEBIAN") {
 	            doit("install","-o",0,"-g",0,"-d","$tmp/DEBIAN");
 	        }

With

 	        install_dir("$tmp/DEBIAN");

This is also slightly faster as install_dir is actually emulated instead
of doing a fork+exec.

Thanks,
~Niels



More information about the pkg-gnome-maintainers mailing list