Date: Tue, 19 Jul 2005 13:35:07 -0500 From: Scot Hetzel <swhetzel@gmail.com> To: Paul Schmehl <pauls@utdallas.edu> Cc: ports@freebsd.org Subject: Re: patch problem with new port Message-ID: <790a9fff05071911356839b928@mail.gmail.com> In-Reply-To: <7EA964ADB15B6C3F4E521554@utd59514.utdallas.edu> References: <7EA964ADB15B6C3F4E521554@utd59514.utdallas.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On 7/19/05, Paul Schmehl <pauls@utdallas.edu> wrote: > I need to create some patches for some ports I'm working on, but there's = a > problem. >=20 > Here's an example. I need to change "wish" to "wish8.3": >=20 > This is an excerpt from the original file: > #!/bin/sh > # Run wish from users PATH \ > exec wish "$0" "$@" >=20 > # $Id: sguil.tk,v 1.157 2004/12/06 21:18:21 bamm Exp $ # >=20 > #################################################################### > # Sguil - A tcl/tk interface for network security monitoring # > #################################################################### >=20 > This is what I need: > #!/bin/sh > # Run wish from users PATH \ > exec wish8.3 "$0" "$@" >=20 > # $Id: sguil.tk,v 1.157 2004/12/06 21:18:21 bamm Exp $ # >=20 > #################################################################### > # Sguil - A tcl/tk interface for network security monitoring # > #################################################################### >=20 > The problem is, even if I use -C1 with diff, I *still* end up with the $I= d > line included in the patchfile, and that's illegal. It will break the > patch when the port is committed. >=20 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 t= o > be patched this way - both wish and tclsh are used in them. >=20 If you are repeatedly changing only one line in several files, you could use the ${REPLACE_CMD} variable to replace the line. USE_REINPLACE=3D=09yes WISH_CMD?=3D 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 --=20 DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff05071911356839b928>