From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Aug 30 16:20:14 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D6C8016A41F for ; Tue, 30 Aug 2005 16:20:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66BA943D55 for ; Tue, 30 Aug 2005 16:20:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j7UGKDSt058964 for ; Tue, 30 Aug 2005 16:20:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j7UGKDVN058963; Tue, 30 Aug 2005 16:20:13 GMT (envelope-from gnats) Resent-Date: Tue, 30 Aug 2005 16:20:13 GMT Resent-Message-Id: <200508301620.j7UGKDVN058963@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mark Murray Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85D5316A420 for ; Tue, 30 Aug 2005 16:10:35 +0000 (GMT) (envelope-from mark@grondar.org) Received: from storm.uk.FreeBSD.org (storm.uk.FreeBSD.org [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35F8E43D49 for ; Tue, 30 Aug 2005 16:10:34 +0000 (GMT) (envelope-from mark@grondar.org) Received: from storm.uk.FreeBSD.org (uucp@localhost [127.0.0.1]) by storm.uk.FreeBSD.org (8.13.3/8.13.3) with ESMTP id j7UGAV2t048764 for ; Tue, 30 Aug 2005 17:10:31 +0100 (BST) (envelope-from mark@grondar.org) Received: (from uucp@localhost) by storm.uk.FreeBSD.org (8.13.3/8.12.11/Submit) with UUCP id j7UGAT7W048763 for FreeBSD-gnats-submit@freebsd.org; Tue, 30 Aug 2005 17:10:29 +0100 (BST) (envelope-from mark@grondar.org) Received: from grunt.grondar.org (localhost [127.0.0.1]) by grunt.grondar.org (8.13.4/8.13.4) with ESMTP id j7UG8VwR049763 for ; Tue, 30 Aug 2005 17:08:31 +0100 (BST) (envelope-from mark@grunt.grondar.org) Received: (from mark@localhost) by grunt.grondar.org (8.13.4/8.13.4/Submit) id j7UG8VeV049762; Tue, 30 Aug 2005 17:08:31 +0100 (BST) (envelope-from mark) Message-Id: <200508301608.j7UG8VeV049762@grunt.grondar.org> Date: Tue, 30 Aug 2005 17:08:31 +0100 (BST) From: Mark Murray To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/85488: [PATCH] New "makepatch: " target to help ports authors X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mark Murray List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2005 16:20:15 -0000 >Number: 85488 >Category: ports >Synopsis: [PATCH] New "makepatch: " target to help ports authors >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Aug 30 16:20:12 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Mark Murray >Release: FreeBSD 6.0-BETA3 i386 >Organization: GTA >Environment: System: FreeBSD grunt.grondar.org 6.0-BETA3 FreeBSD 6.0-BETA3 #1: Mon Aug 29 20:50:36 BST 2005 root@grunt.grondar.org:/usr/src/sys/i386/compile/G_X86_32 i386 Relevant to any ports maintainers where patches are done. >Description: It can be annoying to have to make ${FILESDIR}/patch-* files during a development or upgrade cycle, particularly when the updated distribution sources conflict with patchesets. This is a tool ho help make that easier. If *.orig files are left behind when files are modified, then this patch will allow the maintainer to type "make makepatch", and this will find all *.orig files, and diff them with files of the same name but without the .orig). The diff is then put into ${FILESDIR} in a file called "patch-${PATH}${FILE}, where ${PATH} is the relative path of the file to be patched with '/' turned into'_'. This is a similar tool to "make makesum", in that it eases the port maintainers' jobs. >How-To-Repeat: Maintain an active port with many patches. :-) >Fix: Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.516 diff -u -d -r1.516 bsd.port.mk --- bsd.port.mk 28 Aug 2005 18:47:56 -0000 1.516 +++ bsd.port.mk 29 Aug 2005 09:52:35 -0000 @@ -927,6 +927,26 @@ # Most port authors should not need to understand anything after this point. # +# Look for ${WRKSRC}/.../*.orig files, and (re-)create +# ${FILEDIR}/patch-* files from them. + +.if !target(makepatch) +makepatch: + @cd ${.CURDIR} && ${MKDIR} ${FILESDIR} + @(cd ${WRKSRC}; \ + for i in `find . -type f -name '*.orig'`; do \ + ORG=$$i; \ + NEW=$${i%.orig}; \ + OUT=${FILESDIR}`${ECHO} $${NEW} | \ + ${SED} -e 's|/|__|g' \ + -e 's|^\.__|/patch-|'`; \ + ${ECHO} ${DIFF} -ud $${ORG} $${NEW} '>' $${OUT}; \ + ${DIFF} -ud $${ORG} $${NEW} > $${OUT} || ${TRUE}; \ + done \ + ) +.endif + + # Start of pre-makefile section. .if !defined(AFTERPORTMK) @@ -965,6 +985,7 @@ CUT?= /usr/bin/cut DC?= /usr/bin/dc DIALOG?= /usr/bin/dialog +DIFF?= /usr/bin/diff DIRNAME?= /usr/bin/dirname EGREP?= /usr/bin/egrep EXPR?= /bin/expr >Release-Note: >Audit-Trail: >Unformatted: