Generating patch files

Edwin Groothuis edwin at mavetju.org
Wed Jun 20 03:48:14 UTC 2007


On Wed, Jun 20, 2007 at 02:25:20AM +0200, Steffen Beyer wrote:
> 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.

Make sure that the directory files exist, Go to the ${WRKSRC}, and
run "makediff path/and/file.extension"

Edwin
-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin at mavetju.org    |              Weblog: http://www.mavetju.org/weblog/
-------------- next part --------------
#!/bin/sh

filename=$1
filesdir=../../files

if [ -z "`echo ${filename} | grep _`" ]; then
    patchfile="${filesdir}/patch-`echo ${filename} | sed -e 's/\//__/g'`"
else
    patchfile="${filesdir}/patch-`echo ${filename} | sed -e 's/\//_/g'`"
fi

test -f ${filename}.orig || cp ${filename} ${filename}.orig 
vi ${filename}

p=`grep -l " ${filename}	" ${filesdir}/*`
test ! -z "${p}" && patchfile=${p}

diff -u ${filename}.orig ${filename} > ${patchfile}
echo "Saving diff to ${patchfile}"


More information about the freebsd-ports mailing list