Best Known Methods (BKMs) for Package Updating

From Yocto Project
Revision as of 18:30, 10 November 2010 by Scottrifw (talk | contribs) (Created page with 'This page is used for capturing the Best Known Methods (BKMs) of package upgrading as we get reviewed and process more of the packages. ==Don't Retain older Versions== Unless t…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page is used for capturing the Best Known Methods (BKMs) of package upgrading as we get reviewed and process more of the packages.

Don't Retain older Versions

Unless there is a specific need (which will probably occur for GPLv2, this has also happened in the past when platforms have known bugs in the latest version) don't retain older versions of the recipe files and patches.

Use git mv to rename recipe and patches

From Josh: Generally the way I perform recipe upgrades is to use git mv to rename the old file to the new version, this means that you don't have to consciously delete the old version later (win 1) and that git tracks the rename and the differences with the old file, which doesn't happen with a delete and add (win 2).

The advantage of this is that you and any reviewers can more easily see what has changed with the updated version of the recipe.


Nitin: Actually {git mv a b} is nothing but {mv a b; git rm a; git add b} And the file renames are detected by git automatically by looking at the file contents. Because of this git behavior, git shows some renames as renames and sometimes not. And I did not find a way to force git to understand renames. So if after "git mv" git is showing "file add & file remove", then don't get surprised, it's normal git operation.

Reset PR to 0 (or add PR) when upgrading recipes

This is a good visual reminder to bump in the future if needed.

For upgrades it's ok to use OE for inspiration

When upgrading packages, do the git mv as above, and build if it breaks, it's OK to check the OE equivalent and grab new patch or configuration change, just don't grab the whole recipe.

Be sure to add a credit to OE in your commit message when you do take a change like this.

Review: Merging packages from OpenEmbedded

For new package grab OE version, but sanitize them

Follow the recipe rules for Yocto when you take an OE recipe, be sure to clean all the OE'isms out

Again, give credit to OE in commit messages

Review: Merging packages from OpenEmbedded

Do NOT Merge .inc / .bb files

This was a decision that slipped by me, and was not communicated well, we do not want to merge the common ".inc" files and recipe (.bb) files. This is the case even if the .bb only contains a require and a PR="r0" line. This does not mean split everything at this point, but don't merge going forward.

White Space Management

  • Most variables such as SRC_URI should use spaces.
  • Shell functions should use tabs
  • Python functions should use spaces (4 spaces per indent).

Commenting in Patches

When you change or add patches, be sure to include attributions of where the patch came from, along with your full name and email similar to "Signed-off-by", no special tag is needed (yet?), but having your full name and email is important to track it.

New style patch application

The patch and pnum parameters have been renamed to the more logical apply and striplevel. The apply parameter takes either "yes" or "no" and the striplevel parameter takes an integer (0, 1, etc).

Both parameters are now optional with "sane" defaults.

The apply parameter is optional for SRC_URI lines with patch or diff extensions, which will default to being applied.

The striplevel parameter is also optional with a default striplevel of 1.

Old style parameters (patch and pnum) will continue to work for some time but it would be useful to move to the new style syntax as people are updating other parts of their recipes.

Therefore a patch line would be changed from:

file://some.patch;patch=1;pnum=2

to:

file://some.patch;striplevel=2

and a patch line: