Rockbox Development > Starting Development and Compiling

Patching Rockbox

(1/2) > >>

ajgisme:
I had just managed to compile the source code thingy, and i wanted to put a patch on it when i put in the code it said it couldn't patch it something about HUNK at line 8 or something!
1.) Please can someone help, i really want to put the patches on rockbox!!!!
2.) And also, with the source code, i know you can edit the menus, but how?
Because when i go to the menu it comes up with all these random letters!

007quick:
I can only answer the first question. When Hunks fail, it means that the patch is out of sync. It will save a .rej file which will show you what the patch is supposed to do. Sometimes it is easy to add in the rejects, but other times you will have to ask the maker of the patch for a sync.

ajgisme:
what do you mean add in the rejects?

007quick:
I think that you need to understand some concepts first.  The source code, is just a whole lot of c type files.  Patches, modify the c code.  When the developers commit stuff to svn, the source code changes.  The patch program is often not smart enough to find where it is supposed to replace the code.  If this happens, it will say, Hunk #1, etc failed. Saving rejejts to ....
You will need to look at the .rej file which will have lines with (-) and (+) the lines with the - need to be taken out of the appropriate file, while the lines with the + need to be added. Really, it is a matter of trying.
If you try to add in the rej, but it won't compile correctly.
Type,

--- Code: ---svn revert -R *
--- End code ---
And if you want to get rid of all the leftover files that shouldn't be there. Run this command, knowing that it will get rid of your patch! So back it up

--- Code: ---svn st | grep "^?" | cut "-d " -f7 | xargs rm -f -R
--- End code ---
Do those commands from the root of your rockbox source.
Hope this helps!

Rincewind:
to get an understanding how patches work, you can try this:

open the patch file in an editor (good editors do syntax highlighting on patches).
Every Hunk has a header which says which file is changed and at what line the change should happen. Next come a few lines of source code, some of them with "+" and "-" in front of them. These lines tell the patch file what to do - remove lines with "-", add lines with "+".
I would suggest to open the patch file and the corresponding source file side by side, try to figure out what it does, then apply the patch and look again.
If the Hunk failed only because of a small error you can fix it yourself without knowing much about programming. If you have a good editor with syntax highlighting, then you can sometimes see from the colors when something won't work.

Navigation

[0] Message Index

[#] Next page

Go to full version