Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Mar 2010 18:01:59 +0100
From:      Roland Smith <rsmith@xs4all.nl>
To:        Alejandro Imass <ait@p2ee.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Elegant way to hack port source
Message-ID:  <20100319170159.GB71392@slackbox.erewhon.net>
In-Reply-To: <a14066a01003190935t4bbef41esc44c60a5b00e6144@mail.gmail.com>
References:  <a14066a01003190935t4bbef41esc44c60a5b00e6144@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100319170159.GB71392>