On 07/09/2011 11:22 PM, David Lowe wrote:
> The new upstream FreeCiv 2.2.6 requires a patch.  However, my new
> tentative info file doesn't seem to work.  I assume i should be doing
> this differently, but how?


> Index: client/gui-gtk-2.0/menu.c
> ===================================================================
> --- client/gui-gtk-2.0/menu.c (revision 19908)
> +++ client/gui-gtk-2.0/menu.c (working copy)

You didn't post the actual error you're seeing, but I think I can see 
the problem.

The default PatchScript to apply patches is "patch -p1 < %{PatchFile}" 
and is applied from inside the expanded tarball directory (eg 
/sw/src/fink.build/pkg-1.2-3/pkg-1.2).  The -p1 flag tells patch to 
remove the first directory level in the file identifier (the --- line 
and is "client" in this case) and then modify the file specified by the 
remaining identifier.  Since "client" is an important part of the path, 
patch then can't successfully find the file.

You have two choices to fix this:

1) Add an explicit PatchScript field (keep PatchFile) that contains just 
this line "patch -p0 < %{PatchFile}".  -p0 tells patch not to trim 
anything from the file identifier

2) Modify your existing patch file by adding a single directory level 
before 'client' to the --- and +++ lines.  The string doesn't matter 
since it'll get trimmed by patch anyway.  You could use the pair "orig/" 
and "new/" or "a/" & "b/".  It doesn't matter since it'll get trimmed by 
the "patch -p1 "command (may have to add something in the leading 
"Index: " line too, but I don't remember patch parsing exactly).

Another thing, it is customary to name your patch files with the name of 
the package that they belong to (so freeciv.patch) so that it is obvious 
what package they belong to.

Hanspeter

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to