From owner-freebsd-ports@FreeBSD.ORG Wed Jun 20 03:32:46 2007 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F24316A400 for ; Wed, 20 Jun 2007 03:32:46 +0000 (UTC) (envelope-from karel@lovetemple.net) Received: from imgr.siol.net (imgr.siol.net [193.189.160.82]) by mx1.freebsd.org (Postfix) with ESMTP id 72D9E13C48A for ; Wed, 20 Jun 2007 03:32:45 +0000 (UTC) (envelope-from karel@lovetemple.net) Received: from edge2.siol.net ([10.10.10.211]) by mta1.siol.net with ESMTP id <20070620025739.URSC21179.mta1.siol.net@edge2.siol.net> for ; Wed, 20 Jun 2007 04:57:39 +0200 Received: from tp.unitedpeople.net ([86.61.115.163]) by edge2.siol.net with ESMTP id <20070620025739.IFEH1923.edge2.siol.net@tp.unitedpeople.net> for ; Wed, 20 Jun 2007 04:57:39 +0200 Message-ID: <467897A1.2070804@lovetemple.net> Date: Wed, 20 Jun 2007 04:57:37 +0200 From: Karel Miklav User-Agent: Thunderbird 2.0.0.0 (X11/20070523) MIME-Version: 1.0 To: freebsd-ports@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Generating patch files X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2007 03:32:46 -0000 Steffen Beyer wrote: > Currently, there are several files to patch. Usually I would run "diff > -r" to create one large patch, but the build system -- and the rules ,) > -- expect a separate diff for each file to be patched. > > Is there an easy way to create this set of files, i.e. cutting the patch > into pieces and naming the files accordingly? I looked through the > handbook and various tools, but couldn't find the right one. Maybe you could use 'make makepatch': lama> grep makepatch /usr/ports/Mk/bsd.port.mk -B4 -A12 | sed 's/ / /g' # 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 \ )