Proposal: mechanism for local patches

Dmitry Marakasov amdmi3 at amdmi3.ru
Wed Dec 3 05:12:54 PST 2008


* G. Paul Ziemba (pz-freebsd-ports at ziemba.us) wrote:

> I, too, am happy with the idea of an administrator-specifiable parallel
> tree that would have the same structure as /usr/ports. So this approach
> involves, for the administrator (I am restating Dmitry's comments):
> 
>     1. in /etc/make.conf, define USE_LOCALPATCHES=<patch-path>
>     2. put patches in <patch-path>/<category>/<portname>/patch-*
> 
> If I may offer comments on Dmitry's draft patch:
> 
> 1. Good that it's at the end of the do-patch target - that way local
>    patches can happen after the "official" patches

Not sure if it's good actually.

On the one hand, you usually have patches against vanilla sources, and
just want to drop them to some dir and have them applied.
Also, there's USE_DOS2UNIX that comes before any actual patching, so for
ports that use USE_DOS2UNIX you'll have to adapt patches by hand.

On the other hand, this may cause conflicts with patches from ports,
and those would be hard to resolve.

> 2. I'm not sure we need the test for *.orig|*.rej|*~|*,v, but it
>    wouldn't hurt. Maybe it helps admins who are actively developing
>    local patches. I see that it's in the existing do-patch code above.

I suppose that check was done to help to detect patching failures, so it
may be removed.

> 3. Does ${OPSYS} belong in the echoed messages for local patches?

Maybe not, I just copypasted the chunk. Yes, while what comes from
portstree is definitely `FreeBSD', local patches are more just simply
local & system-independent. I guess even patch- prefix is not required,
but I'll keep it for now.

Updated version here:
http://people.freebsd.org/~amdmi3/local-patchdir.patch

- Renamed some vars
  I guess LOCALPATCHDIR name is consistent with other user-settable
  directories (PORTSDIR, PKGDIR etc.) and internal PATCHDIR_LOCAL is
  (somewhat) consistent with PATCHDIR
  I guess s/LOCALPATCHDIR/LOCALPATCHESDIR/ may be even better
- Added comment in LOCALPATCHDIR
- Now uses 2 level tree under LOCALPATCHDIR (category/port)
- Removed some (likely unneeded) checks

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3 at amdmi3.ru  ..:  jabber: amdmi3 at jabber.ru    http://www.amdmi3.ru


More information about the freebsd-ports mailing list