From owner-freebsd-questions@FreeBSD.ORG Fri Mar 19 21:34:25 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF528106564A for ; Fri, 19 Mar 2010 21:34:25 +0000 (UTC) (envelope-from prvs=687c63757=pschmehl_lists@tx.rr.com) Received: from ip-002.utdallas.edu (ip-002.utdallas.edu [129.110.20.108]) by mx1.freebsd.org (Postfix) with ESMTP id AAD8D8FC19 for ; Fri, 19 Mar 2010 21:34:25 +0000 (UTC) X-Group: None X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsIEAFqLo0uBbgog/2dsb2JhbACDCZdXgVCqKpBLgSyCZGoEgx0 X-IronPort-AV: E=Sophos;i="4.51,276,1267423200"; d="scan'208";a="27300648" Received: from zxtm01.utdallas.edu (HELO utd65257.utdallas.edu) ([129.110.10.32]) by ip-002.utdallas.edu with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Mar 2010 16:34:23 -0500 Date: Fri, 19 Mar 2010 16:34:23 -0500 From: Paul Schmehl To: Alejandro Imass Message-ID: <8B123BA51B43B4AAC86E0F3C@utd65257.utdallas.edu> In-Reply-To: References: <20100319170159.GB71392@slackbox.erewhon.net> <20100319200130.GE265@comcast.net> <3D386E86A152519AA850205C@utd65257.utdallas.edu> X-Mailer: Mulberry/4.0.6 (Linux/x86) X-Munged-Reply-To: Figure it out MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Cc: freebsd-questions@freebsd.org Subject: Re: Elegant way to hack port source X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2010 21:34:26 -0000 --On Friday, March 19, 2010 17:04:17 -0400 Alejandro Imass = wrote: >> >> To the O.P.: >> >> How about submiting the patch to the community so it can be added by the >> port maintainer? =C2=A0If it actually fixes a bug in the software you can't = be >> the only one would benefit from the patch. >> > > That was going to be my next question, but I am currently debugging to > see why this common fix I've used in Linux is not not working on FBSD. Ports can throw you for a loop if you're used to building from source. Others=20 have given you good instructions on how to fix the problem, but here's a brief=20 overview: 1) Go in to the port directory 2) Type make clean to remove any work directories 3) Type make extract - this extracts the tarball into the working directories=20 that FreeBSD expects to find 4) Type make patch to apply any patches that the port maintainer has included 5) Enter the directory where the problem source file is - usually=20 work/portname-version/some subdir 6) Copy it to filename.c.orig 7) Edit filename.c to include your changes 8) Diff the two files and put the resulting patch file in portdir/files (Note:=20 If the file in question is already being patched by the port, you will need to=20 apply your diff to file as well as the edits in the existing patch - doing that = is not an exercise for the faint of heart. If that's the case here, respond=20 and folks will help you sort it out.) 9) Edit the patch file (now in portdir/files) so that the first two lines=20 "point" to the actual location of the file in the working directories. (For=20 example, if the working directory has a subdir named "sc", and your file is in=20 there, the first two lines of the patch would be edited thus: from filename.c to src/filename.c and from filename.c.orig to=20 src/filename.c.orig 10) Return to the portdir and type make clean 11) Type make extract and then make patch - if it works, you should be able to=20 do the install - if it doesn't work, post the errors here and we'll figure it=20 out --=20 Paul Schmehl, Senior Infosec Analyst As if it wasn't already obvious, my opinions are my own and not those of my employer. ******************************************* "It is as useless to argue with those who have renounced the use of reason as to administer medication to the dead." Thomas Jefferson