GNU bug report logs - #79049
ChangeLog is added to distribution even when inside a false conditional

Previous Next

Package: automake;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Sat, 19 Jul 2025 14:00:03 UTC

Severity: normal

Full log


Message #17 received at 79049 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Karl Berry <karl <at> freefriends.org>
Cc: 79049 <at> debbugs.gnu.org
Subject: Re: bug#79049: ChangeLog is added to distribution even when inside
 a false conditional
Date: Sat, 26 Jul 2025 15:45:55 +0200
[Message part 1 (text/plain, inline)]
Karl Berry <karl <at> freefriends.org> writes:

>     if DISTRIBUTE_CHANGELOG
>     ChangeLog:
>             echo nop
>     endif
>
> I haven't had a chance to test this, but how about making the conditional
> merely define a variable, and a fallback ChangeLog rule, as in:
>
> if DISTRIBUTE_CHANGELOG
> ChangeLog_target = ChangeLog
> else
> ChangeLog_target = no_ChangeLog
> ChangeLog:
> endif
> $(ChangeLog_target):
> 	make changelog
>
> I admit I still haven't got my mind wrapped very firmly around this
> scenario :), so I might be way off. Just a thought. --best, karl.

That is brilliant!  I needed to add the ChangeLog into EXTRA_DIST
manually, but on the other hand, there does not seem to be any need for
the targets to differ.  The following seems -- as verified by some
casual testing -- to do what I want:

--8<---------------cut here---------------start------------->8---
if DISTRIBUTE_CHANGELOG
EXTRA_DIST += ChangeLog
endif
ChangeLog = ChangeLog
$(ChangeLog):
	[... bunch of git log mangling ...]
--8<---------------cut here---------------end--------------->8---

Thanks a lot, this is quite clever way to side-step the issue. ^_^

Should I attempt to write a patch documenting this workaround or is this
too niche of a problem?

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.