From owner-freebsd-ports@FreeBSD.ORG Tue Jul 19 18:35:56 2005 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0CCEB16A41F for ; Tue, 19 Jul 2005 18:35:56 +0000 (GMT) (envelope-from swhetzel@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44C0143D45 for ; Tue, 19 Jul 2005 18:35:55 +0000 (GMT) (envelope-from swhetzel@gmail.com) Received: by wproxy.gmail.com with SMTP id 67so1281218wri for ; Tue, 19 Jul 2005 11:35:54 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bJyoBacYTBRMmzkDBNTYBiLcXkMyk8gzBxmd1einhSnF7BFncbewmaULwrmxsoxWMowWmV8SnK5q5yi4FIO0M+pBkGlKYjjYR53FdnMc9qaYdwt+GnCGWgGmqvnWzQnz0MnNq4Fnvv1lSIE2J4JkQYd+zpCYqlh+cEWYoix98qQ= Received: by 10.54.61.14 with SMTP id j14mr841745wra; Tue, 19 Jul 2005 11:35:07 -0700 (PDT) Received: by 10.54.29.26 with HTTP; Tue, 19 Jul 2005 11:35:07 -0700 (PDT) Message-ID: <790a9fff05071911356839b928@mail.gmail.com> Date: Tue, 19 Jul 2005 13:35:07 -0500 From: Scot Hetzel To: Paul Schmehl In-Reply-To: <7EA964ADB15B6C3F4E521554@utd59514.utdallas.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <7EA964ADB15B6C3F4E521554@utd59514.utdallas.edu> Cc: ports@freebsd.org Subject: Re: patch problem with new port X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Scot Hetzel List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2005 18:35:56 -0000 On 7/19/05, Paul Schmehl 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.