Control: tags -1 - moreinfo

On Mon, 2023-01-02 at 22:51 +0100, Axel Beckert wrote:
> Control: tag -1 + moreinfo
>
> Hi John,
> 
> > This package uses Debhelper. What I think causes the false positive is 
> > that, instead of using a pattern rule like
> > %:
> >     dh $@
> > 
> > I use the .DEFAULT special target and also call mkdir prior, like:
> > .DEFAULT:
> >     mkdir -p $(unpacked_dir)
> >     dh $@ -D$(unpacked_dir) -Bbuild
> > 
> > The .DEFAULT special target, unlike pattern rules, is specified by POSIX, 
> > and as Lintian indicates this is an error, I'd very much appreciate if this 
> > could be fixed.
>
> Do I understand it right that ".DEFAULT:" is equivalent to "%:"?              

When it is used in this particular way with the dh sequencer, my understanding 
is "yes." The definition of the .DEFAULT special rule in POSIX at 
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/make.html#tag_20_76_13_04
 is what intuition would suggest: it's a rule that gets run when no other rules 
would apply.

The GNU make syntax using the percent symbol is intended to be a more versatile 
and easy to read replacement for POSIX's suffix rules.

The GNU make documentation at 
/usr/share/doc/make-doc/make.html/Implicit-Rules.html#Last-Resort or 
https://www.gnu.org/software/make/manual/html_node/Last-Resort.html strongly 
suggests that the "%: <nothing>" syntax is equivalent to the ".DEFAULT: 
<nothing>" syntax, and this is my experience. This is a GNU extension though, 
so it's not in any formal specification.
This is why I admire the .DEFAULT syntax: it is both more portable and easier 
to understand. You need not agree with my stylistic opinions, but the case for 
this syntax choice has enough merit at least that Lintian should be able to 
cope.

-- 
🌐 Homepage https://johnscott.me
🪪 Contact info
        • as a vCard: https://johnscott.me/me/me.vcf
        • as an LDAP directory entry: 
ldap://johnscott.me/CN=John%20Scott,DC=johnscott,DC=me

Attachment: signature.asc
Description: This is a digitally signed message part

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to