Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  How to sync patches?
« previous next »
  • Print
Pages: [1]

Author Topic: How to sync patches?  (Read 3393 times)

Offline digerati1338

  • Member
  • *
  • Posts: 60
  • Geek Genius
How to sync patches?
« on: July 12, 2007, 05:24:18 PM »
Just wondering if anyone could give me or point me to a quick lesson on syncing patches.  I have some experience with code, but don't know exactly what needs to be done to sync a patch.  

Thanks for the help.
Logged

Offline cpchan

  • Member
  • *
  • Posts: 198
Re: How to sync patches?
« Reply #1 on: July 13, 2007, 01:59:40 AM »
Quote from: digerati1338 on July 12, 2007, 05:24:18 PM
Just wondering if anyone could give me or point me to a quick lesson on syncing patches.  I have some experience with code, but don't know exactly what needs to be done to sync a patch.

1. Find all the reject files (they have the .rej extension).

2. Look through them and see what is being rejected and at what location.

3. Modified the source code in the corresponding files.

4. Make a unified diff against the pristine source.

Depending on how much the source have changed, you might need to do some coding or a complete rewrite of the patch.

Charles
« Last Edit: July 13, 2007, 02:09:03 AM by cpchan »
Logged

Offline tdtooke

  • Member
  • *
  • Posts: 151
Re: How to sync patches?
« Reply #2 on: July 13, 2007, 06:19:38 AM »
Basically what he said, you also want to use -r as well as -u.  I use cygwin and this is how I do it exactly:
diff -u -r name_original_source name_modified_source > name_of_patch.patch
Of course if your patch doesn't have any dependencies you could just do a diff against svn, just make sure there haven't been any new commits before you try it.  I don't recommend that though since there is always a chance somebody just upped a change.
« Last Edit: July 13, 2007, 02:57:11 PM by tdtooke »
Logged

Offline digerati1338

  • Member
  • *
  • Posts: 60
  • Geek Genius
Re: How to sync patches?
« Reply #3 on: July 15, 2007, 09:02:13 PM »
@cpchan:
1. Ok, I got that.
2. How exactly do I know what is being rejected, and how do i trace and fix the problem?
3. OK
4. Check.

Logged

Offline cpchan

  • Member
  • *
  • Posts: 198
Re: How to sync patches?
« Reply #4 on: July 15, 2007, 10:18:37 PM »
Quote from: digerati1338 on July 15, 2007, 09:02:13 PM
How exactly do I know what is being rejected,

It is very obvious in the reject files.

Quote
and how do i trace and fix the problem?

read and search through the code in the original files.

Charles
Logged

Offline digerati1338

  • Member
  • *
  • Posts: 60
  • Geek Genius
Re: How to sync patches?
« Reply #5 on: July 18, 2007, 02:47:43 PM »
OK so just to make sure I know what I'm doing:

1. I do a dry-run on a patch, and I see that it is out of sync.  No reject files are created in a dry run, so I have to apply the patch, then reverse-apply it so I keep my clean source?

2.  Check reject file, make necessary changes.

3.  Make a new unified diff.  I assume I need to use unpatched source when I do this?
Logged

Offline cpchan

  • Member
  • *
  • Posts: 198
Re: How to sync patches?
« Reply #6 on: July 18, 2007, 03:18:48 PM »
Quote from: digerati1338 on July 18, 2007, 02:47:43 PM
so I have to apply the patch, then reverse-apply it so I keep my clean source?

No, you should work with 2 trees- one is the clean pristine (unpatched) source and one is a working copy (for example "rockbox-new").

Quote
Check reject file, make necessary changes.

You don't revert the patch. You have to see what is being rejected and modify the source code in your working copy.

Quote
Make a new unified diff.  I assume I need to use unpatched source when I do this?

Yes, you make it against the upatched source.

Charles
 
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: How to sync patches?
« Reply #7 on: July 18, 2007, 03:57:38 PM »
Quote from: cpchan on July 18, 2007, 03:18:48 PM
No, you should work with 2 trees- one is the clean pristine (unpatched) source and one is a working copy (for example "rockbox-new")...

...Yes, you make it against the upatched source...

I don't think this is necessary. There is always a (hidden) clean tree available, as this is what SVN automatically does a diff against.

If you need it, you can always do make clean and this will use the clean tree.
« Last Edit: July 18, 2007, 03:59:50 PM by bascule »
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline cpchan

  • Member
  • *
  • Posts: 198
Re: How to sync patches?
« Reply #8 on: July 18, 2007, 04:07:25 PM »
Quote from: bascule on July 18, 2007, 03:57:38 PM
I don't think this is necessary. There is always a (hidden) clean tree available, as this is what SVN automatically does a diff against.

Yes, you are correct. I should really start  learning and using Subversion. I am still doing things the old fashioned way.

Charles
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: How to sync patches?
« Reply #9 on: July 18, 2007, 04:08:01 PM »
Quote from: digerati1338 on July 18, 2007, 02:47:43 PM
OK so just to make sure I know what I'm doing:

1. I do a dry-run on a patch, and I see that it is out of sync.  No reject files are created in a dry run, so I have to apply the patch, then reverse-apply it so I keep my clean source?

2.  Check reject file, make necessary changes.

3.  Make a new unified diff.  I assume I need to use unpatched source when I do this?


You are correct, except for the reverse-apply.

You apply the patch and see if there are any rejects.

If so,  then ignore the patch file (it has done it's job) and modify the relevant source files that the patch made changes to.

Once it compiles cleanly, then do the diff to a (differently-named) .patch file in order to re-submit to Flyspray.

It's a bit confusing, but you'll get there in the end.

If all else fails, you can always do the revert -R command to remove all local edits and get back to a clean copy.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: How to sync patches?
« Reply #10 on: July 18, 2007, 04:17:21 PM »
'make clean' just cleans up the build directory. It doesn't compile a build using clean sources.

svn revert -r * in your source directory (the same place you run svn update from) will revert any and all changes, after which a normal make will be 'clean' as it were.
Logged

Offline digerati1338

  • Member
  • *
  • Posts: 60
  • Geek Genius
Re: How to sync patches?
« Reply #11 on: July 26, 2007, 11:16:22 PM »
Quote
You are correct, except for the reverse-apply.

You apply the patch and see if there are any rejects.

If so,  then ignore the patch file (it has done it's job) and modify the relevant source files that the patch made changes to.

Once it compiles cleanly, then do the diff to a (differently-named) .patch file in order to re-submit to Flyspray.

It's a bit confusing, but you'll get there in the end.

If all else fails, you can always do the revert -R command to remove all local edits and get back to a clean copy.

Thanks.  This is exactly what I was looking for.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  How to sync patches?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.095 seconds with 14 queries.