Date: Tue, 30 Aug 2005 17:08:31 +0100 (BST) From: Mark Murray <markm@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/85488: [PATCH] New "makepatch: " target to help ports authors Message-ID: <200508301608.j7UG8VeV049762@grunt.grondar.org> Resent-Message-ID: <200508301620.j7UGKDVN058963@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508301608.j7UG8VeV049762>