From owner-freebsd-questions@FreeBSD.ORG Fri Mar 19 17:02:08 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 25B5A106566C for ; Fri, 19 Mar 2010 17:02:08 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr5.xs4all.nl (smtp-vbr5.xs4all.nl [194.109.24.25]) by mx1.freebsd.org (Postfix) with ESMTP id AFBEB8FC1F for ; Fri, 19 Mar 2010 17:02:07 +0000 (UTC) Received: from slackbox.erewhon.net (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id o2JH20nU076873; Fri, 19 Mar 2010 18:02:00 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.erewhon.net (Postfix, from userid 1001) id B71D8BA98; Fri, 19 Mar 2010 18:01:59 +0100 (CET) Date: Fri, 19 Mar 2010 18:01:59 +0100 From: Roland Smith To: Alejandro Imass Message-ID: <20100319170159.GB71392@slackbox.erewhon.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3lcZGd9BuhuYXNfi" Content-Disposition: inline In-Reply-To: X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner 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 List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2010 17:02:08 -0000 --3lcZGd9BuhuYXNfi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 19, 2010 at 12:35:30PM -0400, Alejandro Imass wrote: > Hi, >=20 > I need to modify a file from a port before building. Specifically, the > sane-backends pnm.c driver has a bug and the folks at the original > project has not fixed for a while. I need to modify pnm.c in the work > directory before compiling. What is an elegant way of doing this? If I > make and then modify, the main make file does not see the change made > in the file and will not recompile. And since there is no actual > makefile in the work subdirectory I can't compile there either! >=20 > There must be a FreeBSD way of dealing with modifying a port source > before compiling. Please advise. =20 Add the patch to the files/ directory of the port. The patch should be relative to the main source directory of the port, e.g. work/foo-x.y for the foo port. Use a name for the patch that doesn't exist yet. After creating the patch, use chflags to set the uschg and uunlnk flags for your patch. This way, if the port is updated, your patch cannot be removed. But you might need to update it. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --3lcZGd9BuhuYXNfi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkujrgcACgkQEnfvsMMhpyVKWwCghvJaZyiJV6qxGxxAyMmH2GYq ED8An10CKhZkl9lBA7i2wHeiGSZQGHMI =LQTX -----END PGP SIGNATURE----- --3lcZGd9BuhuYXNfi--