[debhelper-devel] Bug#871822: Bug#871822: debhelper: Ignore .install files for "Section: doc" packages when the nodoc build option is set

Niels Thykier niels at thykier.net
Sat Aug 12 15:36:00 UTC 2017


Emmanuel Bourg:
> On 08/12/2017 08:46 AM, Niels Thykier wrote:
> 
>> I appreciate the idea, but it is not scalable to implement this kind of
>> filtering in dh_install.
> 
> Do you mean that debian/control would have to be parsed on each
> invocation of dh_install, roughly once per file installed?
> 

No, it is related to dh_install is the wrong place to do this kind of
filtering.  The best I can offer is:

 * dh_install + dh_exec.

 * Tag each relevant line with a nodoc filter and dh_exec will do the
   filtering.

It is not automatic, but it is the sort of filtering that
implementation-wise scales for dh_install (with dh_exec).

The fundamental problem is that I have to assume this will not be the
last filter of this kind.  For dh_installdocs, under nodocs that is
(almost) a no-op - this seems logical and well-defined as a whole
because it installs documentation and only documentation.
  Whereas dh_install installs all sorts of things.  So far, dh_install
has not cared what it installed.  But it would have to in order to
support this filtering.  And as you add new kind of filtering, you will
have to add more and more "content guessing rules".  That is why I
believe dh_install is the wrong place to support this filter - it does
not generalize to more filters.

It would also have to make assumptions about path names to do this
content filtering, which means if I want to support different prefixes
(e.g. /app for flatpak) or even harder, generalized paths outside FHS,
the content guessing rules become a nightmare to maintain.  Ergo, it
would also paint me into a corner, where I risk being unable to support
another feature I am considering to add.

> 
>> Instead, I will recommend that you use
>> dh_installdocs, dh_installman etc. to install such documentation.  They
>> will under the nodoc profile know what to ignore.
> 
> I considered that but it won't work. dh_installdocs installs to
> /usr/share/doc/package and this isn't the directory we want to install
> to (libfoo-java-doc installs the javadoc for libfoo-java in
> /usr/share/doc/libfoo-java, and not /usr/share/doc/libfoo-java-doc).
> 
> Emmanuel Bourg
> 

Right, dh_installdocs with a fix for #824221 (not that I am any wiser on
how to do that sanely).  A case where policy moved faster than the
tooling. :P

I appreciate the frustration; this nodoc thing plus #824221 caught me a
bit by surprise.  At the moment, the best I can offer is dh_install with
dh_exec as mentioned above.  It is not particularly great or automatic,
but it should work.

Thanks,
~Niels




More information about the debhelper-devel mailing list