Results 1 to 6 of 6
  1. iskitz's Avatar
    Posts
    6 Posts
    Global Posts
    5 Global Posts
       #1  
    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.
  2. iskitz's Avatar
    Posts
    6 Posts
    Global Posts
    5 Global Posts
       #2  
    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 :-)
  3. #3  
    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.
  4. iskitz's Avatar
    Posts
    6 Posts
    Global Posts
    5 Global Posts
       #4  
    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
  5. #5  
    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.
  6. #6  
    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.

Similar Threads

  1. How to get test feeds, webos internals down
    By Kuffo in forum Palm Pre and Pre Plus
    Replies: 2
    Last Post: 02/24/2011, 12:18 PM
  2. Replies: 43
    Last Post: 09/29/2010, 07:34 AM
  3. webos-internals.org?
    By Speedwagon in forum Canuck Coding
    Replies: 6
    Last Post: 07/13/2010, 08:48 AM
  4. www.webos-internals.org and ipkg.preware.org not loading
    By daventx in forum webOS Development
    Replies: 2
    Last Post: 10/20/2009, 06:07 PM
  5. Replies: 5
    Last Post: 07/19/2009, 08:44 PM

Posting Permissions