From: Keith M. <kei...@us...> - 2007-10-18 20:43:43
|
On Thu, 2007-10-18 at 13:06 +0200, Vincent Torri wrote: > I use portmaker from cvs Do you have the 1.5 version of mingwPORT.sh? 1.4 didn't set the directory correctly, before attempting to apply the patch set: --- mingwPORT.sh 2006/09/09 09:21:45 1.4 +++ mingwPORT.sh 2007/04/27 19:16:17 1.5 @@ -42,8 +42,10 @@ then pref $mingwPORT.beforepatch - eval sed \"${PATCHFILTER-"s/x/x/"}\" $mingwPORT.patch \ - | patch -t -N $PATCHFLAGS + PATCHFLAGS=${PATCHFLAGS-"-p0"} + PATCHFILTER=${PATCHFILTER-"s,x,x,"} + sed ${PATCHFILTER} $mingwPORT.patch | ( cd "${SRCDIR}" && + patch -t -N $PATCHFLAGS ) pref $mingwPORT.afterpatch fi > >> So, in glew/, I have 2 files : Makefile and Makefile_new. I also > >> added in the mingwPORT/ dir the file mingwPORT.beforepatch (it set > >> -p0 as flag) As you can see from the above, with current CVS, `-p0' is the default; you don't need a mingwPORT.beforepatch to set that. > > In this file you need to change directory to the path containing the > > files to patch which should be the parent directory of mingwPORT/. With current `portmaker' CVS, the default is set up to handle patches created relative to the top source directory of a CVS working copy of the package in question; in this case, assuming you've checked `glew' out of CVS as:-- $ cvs -d $CVSROOT co glew to make a patch for your Makefile, you would:-- $ cd glew $ cvs diff -u Makefile > /path/to/mingwPORT/mingwPORT.patch and this would then be correctly formatted, to suit the default patch disposition of mingwPORT.sh. Alternatively, if you aren't working with a CVS copy, you could maintain two sibling trees, say `./orig/glew/' and `./repl/glew', (with your modified copy in the latter), and create your patch, (for the entire tree), thus:-- $ diff -Naur ./orig/glew ./repl/glew > /path/to/.../mingwPORT.patch In this case, you will need to adjust to `PATCHFLAGS="-p2"'; you may do that either by providing a mingwPORT.beforepatch, or simply by adding the definition to mingwPORT.ini. > >> I tried : > >> > >> in ~/ : diff -Naur glew/Makefile glew/Makefile_new > mingwPORT.patch > >> in ~/glew : diff -Naur Makefile Makefile_new > mingwPORT.patch > > > > Either works. You need -p1 for the first and -p0 for the second. But, does this maybe confuse `patch'? Is the file to patch called `Makefile' or `Makefile_new', (which of course doesn't exist in the source to patch)? (I confess that I've never tried this technique using dissimilar file names, so it may be ok). My own preference is the CVS option; I'll even create a temporary local CVS repository to facilitate it, when I don't have a CVS working copy already. Another option, which I've used for just a single file patch, is to create an RCS archive copy of the file, and `rcsdiff' against that. HTH, Keith. |