webOS Nation Forums >  Homebrew >  webOS Patches > How can I test my patch before submitting it to webos-internals.org?
How can I test my patch before submitting it to webos-internals.org?
  Reply
 
Thread Tools Display Modes
Old 05/07/2013, 06:33 AM   #1 (permalink)
Member
 
iskitz's Avatar
 
Posts: 5
Default How can I test my patch before submitting it to webos-internals.org?

Hi All,

How can I test installation of my patch before submitting it to webos-internals.org?

I've fixed a few bugs in the webOS 3.0.5 Calendar app and have generated patch files using diff -dr ... from a terminal on my TouchPad as well as via the Unified Diff Creator app on Mac OS X desktop. The patch files from both tools look more or less the same (different from & to diff paths) but when I open either patch file in the Internalz Pro app and click the "Install Patch" button I get this error:

Patch installation failed.

The text leading up to this was:
...
x out of x hunks ignored

*** FAILED ***

I've tested the patch's changes in the app and am confident it works as expected but I'd really like to test its installation before officially submitting it to webos-internals.org.

Any tips on how to do this?

Thanks,
Mike

Last edited by iskitz; 05/11/2013 at 04:42 PM.
iskitz is offline   Reply With Quote
Old 05/07/2013, 09:52 AM   #2 (permalink)
Member
 
iskitz's Avatar
 
Posts: 5
Default

Quote:
Originally Posted by iskitz View Post
The patch files from both tools look more or less the same (different from & to diff paths) but when I open either patch file in the Internalz Pro app and click the "Install Patch" button I get this error:

Patch installation failed.

The text leading up to this was:
...
x out of x hunks ignored

*** FAILED ***
Seems to require

: A package_list file that contains the component's fullname (i.e. com.palm.app.calendar) to be in the same directory as the patch.

: The diff's file paths to include the absolute path of the patched file(s).

After making those changes I was able to sucessfully test installation and uninstallation of my patch :-)
iskitz is offline   Reply With Quote
Old 05/07/2013, 10:11 AM   #3 (permalink)
Member
 
GMMan's Avatar
 
Posts: 2,090
Default

Make sure when you're applying the patch you're applying it to the original files. I recommend pulling your changes and using Unified Diff Creator, then testing the resulting patch on your device.
__________________
Contact: @GMMan_BZFlag (me on Twitter) | webOS onTap | @webOSonTap
webOS Releases: Change your App Catalog country: TouchPad/PC | TouchPad/webOS Resources | Search suggestion patch for browser | Cycling Email Notifications | Don't Doctor! Make a good support request. | How to post logs | webOS Charge Monitor

I will be busy, so I may not be able to provide private support.
GMMan is offline   Reply With Quote
Thanked By: iskitz
Old 05/11/2013, 04:33 PM   #4 (permalink)
Member
 
iskitz's Avatar
 
Posts: 5
Default

Quote:
Originally Posted by GMMan View Post
Make sure when you're applying the patch you're applying it to the original files. I recommend pulling your changes and using Unified Diff Creator, then testing the resulting patch on your device.
Thanks GMMan.

What I've learned about the whole create and submit-a-patch process is:

Patch Creation:

1. Any tool that provides a unified diff as a result can be used; this includes the "diff" command available by default from the command prompt on webOS 3.0.5 and Jason Robitaille's Unified Diff Creator Java desktop tool.

2. webOS' default "diff" command allows you to generate a single diff file that captures patches across multiple directories and files. I've found that this command produces the leanest unified diff:

diff -dr -U 0 original.directory patched.directory > unified.diff.patch

2. The original path(s) (---) in the unified diff result needs to contain the absolute path to the original file(s) being patched. The patched path(s) (+++) doesn't need to contain the absolute path.

3. You can manually update the original path(s) in the diff file to point to the actual file(s) you intend to patch.

Patch Installation Testing:

1. Having the Internalz Pro app from Preware installed on your webOS device greatly simplifies testing patch installation and uninstallation.

2. Internalz Pro uses any existing package_list file it finds in the same directory as your patch to figure out where to install and uninstall patches to and from respectively.

3. The package_list file is a plain text file that should contain the application Id of the patched component i.e. com.palm.app.calendar

4. Once you've got your unified diff patch file and package_list file in the same directory, open your patch file in Internalz Pro. You should see an "Install Patch" button at the bottom of the screen.

5. Clicking the "Install Patch" button will install your patch if you've entered the component's application id correctly in your package_list file and used absolute path's to your original files in your unified diff patch file. If you made a mistake with either of those things you will get "x of x hunks ignored" errors. The hint in those errors that your application Id or original file paths are wrong is if there're no diff syntax errors but the "File to patch:" lines in the error message are blank.

6. Successful installation will end with a prompt that tells you that. It will also ask you to Restart Luna now or later. I recommend restarting right then to avoid confusing yourself later about whether you're actually testing your patch.

Patch Uninstallation Testing:

1. Once your patch is successfully installed you can confirm it by launching the Preware app on webOS then clicking "Installed Packages" => "Patch" and finding your patch in the list.

2. Once you've found your patch, click on it to view its details. The patch's ID will start with ca.canucksoftware.patches. but end with text including the directory containing the patch file from which you clicked "Install Patch".

3. In the patch's detail view you'll find a "Remove" button at the bottom of the screen. Clicking this will remove your patch and prompt you to restart Luna if successful.

Those are the steps I've used successfully over the past week to create, install, and uninstall my calendar app patch that's currently pending approval for listing in Preware.

Hope someone else finds this helpful, I was looking for information like this when I started this whole "let's make a patch process" ;-)

Mike

Last edited by iskitz; 05/12/2013 at 06:37 PM. Reason: typo
iskitz is offline   Reply With Quote
Old 05/14/2013, 11:23 AM   #5 (permalink)
Member
 
GMMan's Avatar
 
Posts: 2,090
Default

I haven't needed to create a package_list to install patches with Internalz. Just put your .patch in the media partition, open it with Internalz, and there should be an Install Patch button on the bottom automatically.
__________________
Contact: @GMMan_BZFlag (me on Twitter) | webOS onTap | @webOSonTap
webOS Releases: Change your App Catalog country: TouchPad/PC | TouchPad/webOS Resources | Search suggestion patch for browser | Cycling Email Notifications | Don't Doctor! Make a good support request. | How to post logs | webOS Charge Monitor

I will be busy, so I may not be able to provide private support.
GMMan is offline   Reply With Quote
Old 05/14/2013, 01:21 PM   #6 (permalink)
Member
 
Posts: 214
Default

Just to add to the discussion. When I do patching I find it much easier and faster to install a patch and safer to use WebOS Quick install and the emulator. Once it's ready to go on the actual devices I test it with WOQI and then another run with path file emailed to the device.
__________________
Pandora pausing patch | Enable Tasks on Touchpad FullScreen | Uber Cycling Email Dashboard
60RH is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get test feeds, webos internals down Kuffo Palm Pre and Pre Plus 2 02/24/2011 12:18 PM
OUTAGE: webos-internals.org and preware.org server outage Tue 23:00 UTC for up to 8h rwhitby WebOS Internals 43 09/29/2010 07:34 AM
webos-internals.org? Speedwagon Canuck Coding 6 07/13/2010 08:48 AM
www.webos-internals.org and ipkg.preware.org not loading daventx webOS Development 2 10/20/2009 06:07 PM
The Wiki is moving! predev.wikidot.com moving to www.webos-internals.org rwhitby webOS Development 5 07/19/2009 08:44 PM


 


Content Relevant URLs by vBSEO 3.6.0