[gobolinux-users] Recipe / patch question

Jonas Karlsson jonka750 at student.liu.se
Sat Nov 25 11:06:47 UTC 2006


On Sat, 25 Nov 2006 11:37:04 +0100, V <mkdm_2000 at yahoo.com> wrote:

> Hi,
>
> I'm trying to create a recipe for a program.  Source
> is an svn server and with my current recipe, the
> program appears in /Files/Compile/Sources/ as
> "trunk-program".

Does it appears as "trunk-program" or as "trunk-<program>" (the difference  
is that the latter has the program name instead of <program>)? Why I ask  
is because it should be listed as "<program>-svn" (not that it realy  
matters if it works, but still behaviour should be consistant). Which  
version of Compile do you use?

>
> There are a few patches to the program which I've
> manually tested by applying to another copy of the
> fresh source; cd trunk-program, patch -p0 < file.patch
> .  All patches apply cleanly, program compiles OK.
>
> I'm attempting to create a Recipe for this program.
> My Recipe checks out the svn source, and since I've
> renamed the patches 01-patch1.patch, 02-patch2.patch,
> etc and placed them with the Recipe, they should be
> automatically applied.

Yes, if the patches end with '.patch' and are placed in the recipe  
directory they are automatically applied. Please take the time to name the  
patches after what they try to fix, like  
'01-Makefile_install-prefix.patch', which should fix installation with  
prefix in the Makefile.

>
> However, I get error messages because the patch inside
> the patches assume I have cd'ed into the main folder
> (i.e. I am sitting inside /trunk-program).
>
Compile do apply the patches from within the folder, but it does it with  
'-p1', stripping of one directory. What you should do is edit the patches  
and add a slash and something before each listing. For example the  
following patch should be applied from within the rlocate source directory  
(with '-p0')

--- doc/rlocate.html  2006-01-19 10:04:52.000000000 +0100
+++ doc/rlocate.html  2006-01-19 19:10:20.000000000 +0100
@@ -223,6 +223,6 @@
  permissions of the rlocate and rlocated binaries. To do this execute
  the following commands.</p>
  <pre>
-        chown root:rlocate /usr/local/bin/rlocate
+        chown 0:rlocate /usr/local/bin/rlocate
          chmod 2755 /usr/local/bin/rlocate

but that doesn't work with Compile so I add a directory to the path (the  
first two rows), like this:

--- rlocate/doc/rlocate.html  2006-01-19 10:04:52.000000000 +0100
+++ rlocate/doc/rlocate.html  2006-01-19 19:10:20.000000000 +0100
@@ -223,6 +223,6 @@
  permissions of the rlocate and rlocated binaries. To do this execute
  the following commands.</p>
  <pre>
-        chown root:rlocate /usr/local/bin/rlocate
+        chown 0:rlocate /usr/local/bin/rlocate
          chmod 2755 /usr/local/bin/rlocate

and then they work with Compile. It's not that much editing, so don't  
worry abour breaking anything. You could try the patches with '-p1' from  
within the source directory before you call Compile if you want to make  
sure they apply cleanly.

> I'd rather not edit the patches to include
> "trunk-program" in the paths and screw something up
> there -- is there any clean way to instruct the
> Compile scripts to cd into the correct folder before
> applying the patches?
>
> I tried a pre_patch(
> 'cd /Files/Compile/Sources/trunk-program"
> )
>
> and also a pre_build with the same command with no
> luck.
>
As mentioned, Compile does indeed change directory into the source  
directory it self before applying patches, so this does not work and the  
'-p1' option to patch from within Compile is static (it's impossible to  
guess what should be used, so therefore it's defined as '-p1'). The only  
way to fix this is to edit the patches (not that much of a change).

-- 
/Jonas

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the gobolinux-users mailing list