Go Back   webOS Nation Forums > webOS apps and software > webOS developer forums > Canuck Coding

Like Tree6Likes

Reply
 
LinkBack Thread Tools Display Modes
Old 10/21/2009, 03:06 PM     Thread Author   #1 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,880
Likes: 470
Thanks: 801
Thanked 12,876 Times in 1,489 Posts

Default Unified Diff Creator

I was adding patch creation to the upcoming v2.0 WebOS Theme Builder, when I figured it wouldn't be too much trouble to duplicate most of that section of code and make a quick gui to create unified format patches.

Hopefully someone will get some use of this. Personally I find it easier than commandline, but that's just my personal opinion, heh. Also attached is the source, along with its GPL license.

Clicking the "Original File" and "Altered File" text fields will bring up a handy file chooser.




Changelog
v1.3 - October 30, 09
- Fixed an issue that in rare circumstances would cause the .patch to fail

v1.2 - October 26, 09
- Fixed another issue with patches being created from files with no trailing newline character
- Added reset button
- Added file drag and drop support
- Added support for optional patch meta data for patch name, version, author, etc.

v1.1 - October 22, 09
- Fixed issue with creating patches of files not ending with new lines

v1.0 - October 21, 09
- Initial release
Attached Files
File Type: jar UnifiedDiffCreator.jar (220.9 KB, 918 views) Email Attachment
File Type: zip src.zip (44.4 KB, 167 views) Email Attachment

Last edited by Jason Robitaille; 10/30/2009 at 07:51 PM.
Jason Robitaille is offline   Reply With Quote
Liked by GreenHex, kostka, nxg125 and 2 others like this.
Old 10/21/2009, 03:27 PM   #2 (permalink)
Member

 
Join Date: Apr 2003
Location: Boston-area
Posts: 6,977
Likes: 112
Thanks: 418
Thanked 1,251 Times in 710 Posts

Default

Pretty cool. Too bad it doesn't support when multiple files are changed, so that I could create .patch files for some of the manual stuff I did, but thanks for this anyway, it should be helpful.
jhoff80 is offline   Reply With Quote
Old 10/21/2009, 03:47 PM   #3 (permalink)
Member
 
SirWill's Avatar
 
Join Date: Jun 2009
Location: Everett, WA
Posts: 441
Likes: 0
Thanks: 63
Thanked 48 Times in 41 Posts

Default

Like it how it is, but if only it could package it up in the .ipkg format for preware too. I can install OTA at work, but can't install via WOSQI at work and believe it or not, sometimes i have more spare time at work than at home. Darn kids...
__________________
-----------------
Palm III, Palm IIIc, TT, T3, T5, TX, Pre from Day 1.
SirWill is offline   Reply With Quote
Old 10/21/2009, 04:22 PM   #4 (permalink)
Member
 
elryon's Avatar
 
Join Date: Jul 2009
Location: Arizona
Posts: 716
Likes: 0
Thanks: 33
Thanked 373 Times in 163 Posts

Default

Quote:
Originally Posted by jhoff80 View Post
Pretty cool. Too bad it doesn't support when multiple files are changed, so that I could create .patch files for some of the manual stuff I did, but thanks for this anyway, it should be helpful.
yeah, multiple files would be good... but figured I'd just make multiple patch files and add them together... if that works...
__________________
Avatar on Left Patch
Call Rejecter Patch
Make your messanger look like the iphone's
SMS tone per Contact
No Alert During call

Thanks are always appreciated or for a really big Thanks you can always:
(it can go a long way to convince my fiancee that this is worth my time)

Please feel free to PM for more direct assistance.
elryon is offline   Reply With Quote
Old 10/21/2009, 04:28 PM     Thread Author   #5 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,880
Likes: 470
Thanks: 801
Thanked 12,876 Times in 1,489 Posts

Default

Quote:
Originally Posted by elryon View Post
yeah, multiple files would be good... but figured I'd just make multiple patch files and add them together... if that works...
yep, that'd work, but add each consecutive patch on the trailing empty line of the previous. As long as the only "" empty line is at the ends of the file, multiple patches should work
Jason Robitaille is offline   Reply With Quote
Old 10/21/2009, 04:53 PM   #6 (permalink)
Developer
 
Join Date: Jul 2009
Posts: 1,400
Likes: 3
Thanks: 17
Thanked 1,540 Times in 376 Posts

Default

Quote:
Originally Posted by Jason Robitaille View Post
yep, that'd work, but add each consecutive patch on the trailing empty line of the previous. As long as the only "" empty line is at the ends of the file, multiple patches should work
Empty lines don't matter, patch will ignore the extra junk (even blocks of comment text before diff - line should be ignored correctly).
__________________

-Eric G

WebOS Internals Developer.
Follow me on Twitter for updates to my projects: | Virtual Keyboard | wIRC | SuperTux | AUPT | KeyBoss | freeTether |

Donate
egaudet is offline   Reply With Quote
Old 10/21/2009, 04:54 PM     Thread Author   #7 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,880
Likes: 470
Thanks: 801
Thanked 12,876 Times in 1,489 Posts

Default

Quote:
Originally Posted by emoney_33 View Post
Empty lines don't matter, patch will ignore the extra junk (even blocks of comment text before diff - line should be ignored correctly).
*queues The More You Know music*
Jason Robitaille is offline   Reply With Quote
Old 10/21/2009, 10:01 PM   #8 (permalink)
Member
 
elryon's Avatar
 
Join Date: Jul 2009
Location: Arizona
Posts: 716
Likes: 0
Thanks: 33
Thanked 373 Times in 163 Posts

Default

grrrrr..... I keep getting hunk failed for every change.... arrrgh!!! I dont know what's wrong...
__________________
Avatar on Left Patch
Call Rejecter Patch
Make your messanger look like the iphone's
SMS tone per Contact
No Alert During call

Thanks are always appreciated or for a really big Thanks you can always:
(it can go a long way to convince my fiancee that this is worth my time)

Please feel free to PM for more direct assistance.
elryon is offline   Reply With Quote
Old 10/26/2009, 10:34 AM     Thread Author   #9 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,880
Likes: 470
Thanks: 801
Thanked 12,876 Times in 1,489 Posts

Default

New version out, hopefully I'm not the only one using this app, lol

v1.2 - October 26, 09
- Fixed another issue with patches being created from files with no trailing newline character
- Added reset button
- Added file drag and drop support
- Added support for optional patch meta data for patch name, version, author, etc.
Jason Robitaille is offline   Reply With Quote
Old 10/27/2009, 12:12 AM   #10 (permalink)
Member
 
Join Date: Aug 2009
Posts: 138
Likes: 0
Thanks: 7
Thanked 47 Times in 22 Posts

Default

I made a .patch with this utility (thank you, btw) but the change I am trying to make also requires an image change. How do I package the .patch and the image together as an .ipk?
PrestonJames is offline   Reply With Quote
Old 10/27/2009, 07:36 AM     Thread Author   #11 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,880
Likes: 470
Thanks: 801
Thanked 12,876 Times in 1,489 Posts

Default

Quote:
Originally Posted by PrestonJames View Post
I made a .patch with this utility (thank you, btw) but the change I am trying to make also requires an image change. How do I package the .patch and the image together as an .ipk?
Extra file including and packing as ipk would be part of WebOS-Internals autopatch system
Jason Robitaille is offline   Reply With Quote
Liked by GreenHex likes this.
Old 10/28/2009, 08:00 PM   #12 (permalink)
Member
 
elryon's Avatar
 
Join Date: Jul 2009
Location: Arizona
Posts: 716
Likes: 0
Thanks: 33
Thanked 373 Times in 163 Posts

Default

Quote:
Originally Posted by Jason Robitaille View Post
New version out, hopefully I'm not the only one using this app, lol

v1.2 - October 26, 09
- Fixed another issue with patches being created from files with no trailing newline character
- Added reset button
- Added file drag and drop support
- Added support for optional patch meta data for patch name, version, author, etc.
I've used it to make both my patches... hope the new version is even better...
__________________
Avatar on Left Patch
Call Rejecter Patch
Make your messanger look like the iphone's
SMS tone per Contact
No Alert During call

Thanks are always appreciated or for a really big Thanks you can always:
(it can go a long way to convince my fiancee that this is worth my time)

Please feel free to PM for more direct assistance.
elryon is offline   Reply With Quote
Old 11/09/2009, 12:36 AM   #13 (permalink)
Member
 
Join Date: Oct 2009
Posts: 7
Likes: 0
Thanks: 87
Thanked 1 Time in 1 Post

Default

Can't wait for a new version
Dogg006 is offline   Reply With Quote
Old 11/09/2009, 03:18 AM     Thread Author   #14 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,880
Likes: 470
Thanks: 801
Thanked 12,876 Times in 1,489 Posts

Default

Quote:
Originally Posted by Dogg006 View Post
Can't wait for a new version
What new version? current version not working for ya?
__________________
If you've liked my software, please consider to towards future development.

Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

@JayCanuck @CanuckCoding Facebook
Jason Robitaille is offline   Reply With Quote
Old 11/23/2009, 11:07 AM   #15 (permalink)
Forum Leader
 
mamouton's Avatar
 
Join Date: Jan 2007
Location: Fort Worth, TX
Posts: 5,771
Likes: 5
Thanks: 795
Thanked 1,165 Times in 801 Posts

Default

Hey Jason, the swap menu in active call patch worked great http://forums.precentral.net/webos-p...-hangup-2.html , but once you doctor your pre two files activecall.css and menus.css are gone. I can get them out of the emulator and apply the patch and the patch works great again.

My question after all the extra information is how do you create a patch to create a file that doesn't exist? The only way to apply the patch is to create the two files and apply the change.
mamouton is offline   Reply With Quote
Old 12/06/2009, 11:20 PM   #16 (permalink)
Member
 
Join Date: Jun 2009
Posts: 127
Likes: 0
Thanks: 14
Thanked 21 Times in 18 Posts

Default

I have a question about creating a patch using this tool. I already have a few patches applied to email.js and composeAssistant.js. I was browsing today and saw a post about how to address the reply font being too large and I created a patch, well 2 of them, for the 2 files above. I got it to work by comparing the new files that I got from the thread, and diff'd them to the already patched files from my pre. What process should I follow to get it to work with an original file as well as files that are already patched?
mike_pre is offline   Reply With Quote
Old 12/06/2009, 11:54 PM     Thread Author   #17 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,880
Likes: 470
Thanks: 801
Thanked 12,876 Times in 1,489 Posts

Default

Quote:
Originally Posted by mamouton View Post
Hey Jason, the swap menu in active call patch worked great http://forums.precentral.net/webos-p...-hangup-2.html , but once you doctor your pre two files activecall.css and menus.css are gone. I can get them out of the emulator and apply the patch and the patch works great again.

My question after all the extra information is how do you create a patch to create a file that doesn't exist? The only way to apply the patch is to create the two files and apply the change.
Well, you can create files that don't exist by alteing the patch header. For example:
Code:
--- /dev/null
+++ /usr/palm/new-file.js
The "/dev/null" basically tells GNU patch it's a new file. That said, looking into the 1.3.1 rom, both activecall.css and menus.css still exist.


Quote:
Originally Posted by mike_pre View Post
I have a question about creating a patch using this tool. I already have a few patches applied to email.js and composeAssistant.js. I was browsing today and saw a post about how to address the reply font being too large and I created a patch, well 2 of them, for the 2 files above. I got it to work by comparing the new files that I got from the thread, and diff'd them to the already patched files from my pre. What process should I follow to get it to work with an original file as well as files that are already patched?
It's always best to start from the base unaltered files (extracting the webos rom from the webosdoctor is always handy for this) and build patches from there.

As long as the file you use as the "original" is the unaltered original, and your multiple patches don't edit the exact same lines, then GNU patch should be able to automatically adjust for muliple patches on the same file.
__________________
If you've liked my software, please consider to towards future development.

Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

@JayCanuck @CanuckCoding Facebook
Jason Robitaille is offline   Reply With Quote
Old 12/07/2009, 12:10 AM   #18 (permalink)
Member
 
Join Date: Jun 2009
Posts: 127
Likes: 0
Thanks: 14
Thanked 21 Times in 18 Posts

Default

Ok, thanks for the pointers...I will try that and see how well it gets along with the other patches I have installed....
mike_pre is offline   Reply With Quote
Old 12/07/2009, 10:01 PM   #19 (permalink)
Member
 
Join Date: Jun 2009
Posts: 127
Likes: 0
Thanks: 14
Thanked 21 Times in 18 Posts

Default

Quote:
Originally Posted by Jason Robitaille View Post
yep, that'd work, but add each consecutive patch on the trailing empty line of the previous. As long as the only "" empty line is at the ends of the file, multiple patches should work
OK, I have 2 patches I created, 1 for each file, and they work great individually, now I want them to put them together. I am having troubles with this....My combination patch looks like this where the 2 meet...

Email.kSubjectPrefixRe = $L("Re: ");
Email.kSubjectPrefixFw = $L("Fw: ");
--- .orig/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
+++ /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
@@ -712,7 +712,8 @@
var editor = controller.get('msg_rte');

Where the Email.kSubjectPrefixFw = $L("Fw: "); line is the last line in the first patch file and var editor = controller.get('msg_rte'); is the first line in the second patch. I have tried many different combinations and keep getting hunk failures no matter how I join the 2 files.
mike_pre is offline   Reply With Quote
Old 12/07/2009, 10:06 PM     Thread Author   #20 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Join Date: May 2005
Location: Winnipeg, MB, Canada
Posts: 3,880
Likes: 470
Thanks: 801
Thanked 12,876 Times in 1,489 Posts

Default

Quote:
Originally Posted by mike_pre View Post
OK, I have 2 patches I created, 1 for each file, and they work great individually, now I want them to put them together. I am having troubles with this....My combination patch looks like this where the 2 meet...

Email.kSubjectPrefixRe = $L("Re: ");
Email.kSubjectPrefixFw = $L("Fw: ");
--- .orig/usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
+++ /usr/palm/applications/com.palm.app.email/app/controllers/compose-assistant.js
@@ -712,7 +712,8 @@
var editor = controller.get('msg_rte');

Where the Email.kSubjectPrefixFw = $L("Fw: "); line is the last line in the first patch file and var editor = controller.get('msg_rte'); is the first line in the second patch. I have tried many different combinations and keep getting hunk failures no matter how I join the 2 files.
can you email me the patches for me to take a quick look (one after the other should work)? support [at] canuck-software [dot] ca
__________________
If you've liked my software, please consider to towards future development.

Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

@JayCanuck @CanuckCoding Facebook
Jason Robitaille is offline   Reply With Quote

 

Content Relevant URLs by vBSEO 3.6.0