Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jun 2007 04:57:37 +0200
From:      Karel Miklav <karel@lovetemple.net>
To:        freebsd-ports@freebsd.org
Subject:   Re: Generating patch files
Message-ID:  <467897A1.2070804@lovetemple.net>
In-Reply-To: <E1I0o0k-0005n1-Sk@a-traxx.reactor.local>
References:  <E1I0o0k-0005n1-Sk@a-traxx.reactor.local>

next in thread | previous in thread | raw e-mail | index | archive | help
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 \
   )




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