From sec@ice.42.org  Mon Dec  4 16:54:00 2000
Return-Path: <sec@ice.42.org>
Received: from ice.42.org (ice.42.org [194.246.250.222])
	by hub.freebsd.org (Postfix) with ESMTP id 0D60237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  4 Dec 2000 16:54:00 -0800 (PST)
Received: by ice.42.org (Postfix, from userid 1000)
	id F34E611D; Tue,  5 Dec 2000 01:53:58 +0100 (CET)
Message-Id: <20001205005358.F34E611D@ice.42.org>
Date: Tue,  5 Dec 2000 01:53:58 +0100 (CET)
From: sec@ice.42.org
Reply-To: sec@ice.42.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: allow system-local patches for ports
X-Send-Pr-Version: 3.2

>Number:         23287
>Category:       ports
>Synopsis:       allow system-local patches for ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 04 17:00:01 PST 2000
>Closed-Date:    Tue Mar 26 00:24:12 PST 2002
>Last-Modified:  Tue Mar 26 00:24:12 PST 2002
>Originator:     Stefan `Sec` Zehl
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
>Environment:

	

>Description:

Sometimes I'm not completely happy with a single specific aspect of a port,
while i still like the rest of it.
Thus I often have to do the

make extract
cd work/portname
vi file (modify somthing)
cd ../..
make install

cycle to install a port.


I've started to collect these modifications in patch-format on my systems
in /pub/patches.

To make it even easier, I modified bsd.port.mk (patch below).

If you set 'USERPATCHES' in /etc/make.conf it will look into that directory
for patches with the name $PORTNAME.* and apply them.

This makes installing ports on a new system so much easier and faster, so I
hope this modification could find its way back into FreeBSD.

>How-To-Repeat:

>Fix:

--- /usr/ports/Mk/bsd.port.mk.orig	Tue Dec  5 01:31:44 2000
+++ /usr/ports/Mk/bsd.port.mk	Tue Dec  5 01:48:13 2000
@@ -1704,6 +1704,14 @@
 
 .if !target(do-patch)
 do-patch:
+.if defined(USERPATCHES)
+		@if [ "`echo ${USERPATCHES}/${PORTNAME}.*`" != "${USERPATCHES}/${PORTNAME}.*" ]; then \
+			${ECHO_MSG} "===>  Applying user patches for ${PKGNAME}" ; \
+			for i in ${USERPATCHES}/${PORTNAME}.*; do \
+						${PATCH} ${PATCH_ARGS} < $$i ; \
+			done; \
+		fi;
+.endif
 .if defined(PATCHFILES)
 	@${ECHO_MSG} "===>  Applying distribution patches for ${PKGNAME}"
 	@(cd ${_DISTDIR}; \




Possibly also add this to /etc/defaults/make.conf:

# USERPATCHES controls where individual patches for ports are searched.
# If this is set, it looks for patches of the form
# $USERPATCHES/$PORTNAME.*
#
#USERPATCHES=/pub/patches

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->asami 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sun Dec 10 17:50:06 PST 2000 
Responsible-Changed-Why:  
Satoshi maintains bsd.port.mk. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23287 
Responsible-Changed-From-To: asami->portmgr 
Responsible-Changed-By: will 
Responsible-Changed-When: Wed Apr 4 01:17:30 PDT 2001 
Responsible-Changed-Why:  
Over to new maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23287 

From: Maxim Sobolev <sobomax@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, sec@ice.42.org
Cc:  
Subject: Re: ports/23287: allow system-local patches for ports
Date: Wed, 04 Apr 2001 11:28:45 +0300

 I think it is unnecessary complication. Nobody prohibits you from
 putting your local patches into the same directory where official
 patches are, just appending .local suffix. For example:
 /usr/ports/foocat/barport/files/patch-xx.local.
 
 -Maxim
 
State-Changed-From-To: open->closed 
State-Changed-By: sobomax 
State-Changed-When: Tue Mar 26 00:23:43 PST 2002 
State-Changed-Why:  
We already have similar behaviour: patch-xx.local. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23287 
>Unformatted:
