Skip site navigation (1)Skip section navigation (2)
Date:      Tue,  5 Dec 2000 01:53:58 +0100 (CET)
From:      sec@ice.42.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/23287: allow system-local patches for ports
Message-ID:  <20001205005358.F34E611D@ice.42.org>
Resent-Message-ID: <200012050100.eB5101J37103@freefall.freebsd.org>

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

>Number:         23287
>Category:       ports
>Synopsis:       allow system-local patches for ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 04 17:00:01 PST 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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