hBasic > hSuite > Patches

hSuite
Patches

Patches change the source code of hBasic.

They are used for either temporary fixes or optional features.

Patches represent the differences between the base (the master) and a future version.

All official hBasic versions have most of the patches applied to the master and released under the name of hBasic.

Normally, by applying all of the patches, you end up with the current version of hBasic.
Alternatively by choosing patches, or manually modifying the source code yourself,
you can create a custom version of hBasic.





How to use hPatcher
Using patches with hPatcher

The Patch List
Selection
Apply
Create
Regen
Reset

Creating Patches without hPatcher
Manual Patch Making


Guidelines for Patches Modifying source code







How to use hPatcher

The Patch List

The first pane you see in hpatcher is the available patches list.

The patch list is generated by looking for patch_ID.desc files in the work directory.
These are one-line description files for the list and can be created with a text editor.

The accompanying patch_ID.patch files must also exist, as these are the actual patch files.

Selection

Select the patches that you want to operate with.

Apply button

Selected patches are merged and applied to the work/basic/ directory.
The source file(s) under the 'basic' directory will then be modified  according to the patches.

Create button

Creates a new patch to contain the differences between [basic] and [master].
Follow the prompts.

If successful, a patch_ID.patch file is created.
You need to manually create a patch_ID.desc file in order for the patch to appear in hPatcher.

Regen button

You can Re-Generate patches with hSuite.
This will sync their offsets with the master copy.
You should do this if you had made changes to the master.

Make sure you backup all your changes.

A backup of [basic] is copied to a [patch_name] directory.
[basic] is  overwriiten with a copy of [master] during and after the operation.

If successful, the existing patch_ID.patch file is overwritten.

Check your patch file manually (with an editor), if it looks ok, you can safely delete the
[patch_name]
directory.


If not succesful, you will see an error message.
Theoretically the more patches there are, the more likely you'll have conflicts.
If this happens, you need to manually combine patches that use the same area of code or are very close to one another, into a single patch.

Reset button

Overwrites the [basic] directory with a copy of [master]
You will need this if want to lose all your [basic] modifications and start afresh.
You will also need to do this if you want to re-apply any patches.



Creating Patches without hPatcher

Manual Patch Making

You can make your own patches manually without hPatcher.

Reset the work/basic/ in hpatcher to a fresh copy of the master.

Copy your modified source tree under the [work] directory as the patch_ID name

        e.g work/mypatch/

Open a Terminal in the directory [work].

To make a patch (the differences between [mypatch] and [basic] use the hpatch program.

../bin/hpatch make mypatch

will produce mypatch.patch

Create a text file called mypatch.desc
with the first line of text as a short description. e.g "my super new command"

Re-opening hpatcher will then pick up the patch in it's selection list.



Guidelines for Patches
Modifying Source Code

You modify the [basic] source code to make a difference between [basic] and [master].
After your modifications, you make a patch.

The less differences there are, the easier It is for the patching programs.

Keep to these rules to minimize conflict;

DO NOT change anything that doesn't need changing.
Don't use editors that reformat the code, tabs, indentation..etc
The official Basic source uses;
* a single LF at the end of lines.
* 4 char tab indentation.
Change as little as possible. The less the change, the smaller the patch file.

-End.


Leading Cloud Surveillance, Recording and Storage service; IP camera live viewing

Leading Enterprise Cloud IT Service; cloud file server, FTP Hosting, Online Storage, Backup and Sharing

Powered by FirstCloudIT.com, a division of DriveHQ, the leading Cloud IT and Cloud Surveillance Service provider since 2003.