Re: sysutils/logwatch: Need to patch very first line of a script fails, dunno why

Miroslav Lachman <[email protected]>
Newsgroups gmane.os.freebsd.devel.ports
Message-ID <[email protected]>
On 18/07/2025 20:48, Michael Grimm wrote:
> Hi,
> 
> I am preparing for the upcoming logwatch-7.13 release, and ran into an issue I can't understand.
> 
> I do want to patch the logwatch.pl script by providing a 'files/patch-scripts_logwatch.pl' which starts as follows:
> 
> 	--- scripts/logwatch.pl.orig    2025-07-18 18:21:47 UTC
> 	+++ scripts/logwatch.pl
> 	@@ -1,4 +1,4 @@
> 	-#!/usr/bin/perl -w
> 	+#!/usr/local/bin/perl -w
> 	 use strict;
> 	 ##########################################################################
> 	 ##########################################################################
> 
> 	[followed by 17 other hunks]
> 
> 
> Using "poudriere testport … sysutils/logwatch" I get:
> 
> 	=======================<phase: patch          >============================
> 	===== env: DEVELOPER_MODE=yes DEVELOPER=1 STRICT_DEPENDS=yes USER=root UID=0 GID=0
> 	===>  Patching for logwatch-7.13
> 	===>  Applying FreeBSD patches for logwatch-7.13 from /usr/ports/sysutils/logwatch/files
> 	Ignoring previously applied (or reversed) patch.
> 	18 out of 18 hunks ignored--saving rejects to scripts/logwatch.pl.rej
> 	===>  FAILED Applying FreeBSD patch-scripts_logwatch.pl
> 	===> FAILED to apply cleanly FreeBSD patch(es)  patch-scripts_logwatch.pl
> 	*** Error code 1
> 
> 	Stop.
> 
> 
> But: If I do apply that very same patch by 'patch < files/patch-scripts_logwatch.pl' at the appropriate location, all 18 hunks are applied successfully.
> 
> 
> Can you help me to understand how to fix this?
> 
> 
> Thanks in advance and regards,
> Michael

Can it be that the file is already modified by shebangfix? it is in the 
Makefile:

USES=		perl5 shebangfix

SHEBANG_FILES=	scripts/logwatch.pl

If there is a shebangfix there is no need to patch it.

Kind regards
Miroslav Lachman
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.