patch problem with new port
Scot Hetzel
swhetzel at gmail.com
Tue Jul 19 18:35:56 GMT 2005
On 7/19/05, Paul Schmehl <pauls at utdallas.edu> wrote:
> I need to create some patches for some ports I'm working on, but there's a
> problem.
>
> Here's an example. I need to change "wish" to "wish8.3":
>
> This is an excerpt from the original file:
> #!/bin/sh
> # Run wish from users PATH \
> exec wish "$0" "$@"
>
> # $Id: sguil.tk,v 1.157 2004/12/06 21:18:21 bamm Exp $ #
>
> ####################################################################
> # Sguil - A tcl/tk interface for network security monitoring #
> ####################################################################
>
> This is what I need:
> #!/bin/sh
> # Run wish from users PATH \
> exec wish8.3 "$0" "$@"
>
> # $Id: sguil.tk,v 1.157 2004/12/06 21:18:21 bamm Exp $ #
>
> ####################################################################
> # Sguil - A tcl/tk interface for network security monitoring #
> ####################################################################
>
> The problem is, even if I use -C1 with diff, I *still* end up with the $Id
> line included in the patchfile, and that's illegal. It will break the
> patch when the port is committed.
>
The $Id shouldn't break the port, as the FreeBSD ports collection uses
$FreeBSD: to indicate the revision of a file.
> Is there a way around this problem? I have several files that all need to
> be patched this way - both wish and tclsh are used in them.
>
If you are repeatedly changing only one line in several files, you
could use the ${REPLACE_CMD} variable to replace the line.
USE_REINPLACE= yes
WISH_CMD?= wish8.3
post-patch:
.for file in file1 file2
@${REINPLACE_CMD} -e 's:exec wish:exec ${WISH_CMD}:g' ${WRKDIR}/$file
.endfor
You can use this trick even if you are patching one of the files, as
the post-patch occurs after your patch is applied.
Scot
--
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.
More information about the freebsd-ports
mailing list