Merging

Revision 6 as of 2007-11-21 10:52:56

Clear message

Include(UbuntuDevelopment/Header/Menu)

__          __  _____   _____  
\ \        / / |_   _| |  __ \ 
 \ \  /\  / /    | |   | |__) |
  \ \/  \/ /     | |   |  ___/ 
   \  /\  /     _| |_  | |     
    \/  \/     |_____| |_|     

Background & History

Ubuntu is based on the Debian GNU/Linux distribution and uses the same package management system. In the beginning of each Ubuntu development cycle the packages in Ubuntu are updated to those in Debian unstable. However, because Ubuntu is not the same as Debian, some of the packages need to be modified to work in Ubuntu. There might also be bug fixes that Ubuntu developers have introduced into the packages. You can determine whether this has taken place by noting the package version. If the package version includes ubuntu in it (an example would be gimp 2.2.9-3ubuntu2) then the Ubuntu developers have made some change and it is no longer the same as the Debian package. There are more than 1000 such packages in the Universe repository.

At the start of the development cycle a decision has to be made with regard to these Ubuntu-versioned packages. Of course if the Debian version hasn't changed since the last Ubuntu release then nothing needs to be changed. However, if there is a newer version of the package in Debian then one of two things should happen. If all of the reasons that the Ubuntu version existed (bug fixes, dependencies, etc.) are fixed in the new Debian package then we can just take the Debian package directly. This is called a sync. However, if the new Debian version has the same issues that caused the Ubuntu version to be made, then those changes need to be applied to the new Debian version. This is called merging.

The Process of Merging/Syncing

Currently Scott's excellent Merge-O-Matic tool (rather the output from that tool) at http://merges.ubuntu.com/ is used to lay the groundwork for the process. On http://merges.ubuntu.com/universe.html, you'll see a pretty lengthy list of pending merges. Near the leading vertical ("top") of the page, you'll see three links, one for outstanding merges, another for new, and another for updated.

  • 'Outstanding' merges are those that have not been tackled in Ubuntu at all across any release.
  • 'New' merges means that no one has tackled these merges yet in the current development cycle.
  • 'Updated' merges means that newer Debian versions are available for merges that have already been done in the current development cycle.

The above lists include all the packages that contain Ubuntu changes from their Debian counterparts at the time of the snapshot. Several packages that have previously been imported from Debian to Ubuntu are automatically synced at specific times in each release cycle. Those automatically "synced" packages are not include in the list of pending merges.

Outline of Algorithm for Tackling Merges

  1. Grab the Merge-O-Matic output. You can do this using [http://merges.ubuntu.com/grab-merge.sh grab-merge.sh].

  2. Read the Merge-O-Matic output (either in the extracted source or via REPORT on the website).
  3. Inspect the conflicts in each file listed in the M-O-M output, and follow this subroutine:
    1. Prefer the newer Debian changes when possible. This means we discard Ubuntu changes until we have to use one. BR Warning /!\ When packages split and introduce conflicts/replaces statements, we often cannot safely discard the Ubuntu version number, because the new conflicts statement may refer to the Debian version number, but in Ubuntu it needs to be the Ubuntu number.

    2. If newer Debian changes were made that don't affect the old Ubuntu source package, then extract the newer pristine Debian source package and check if those Debian changes allow the Ubuntu merges to be dropped from the merged source.
    3. If those Debian changes allow the Ubuntu merges to be dropped, then make the modifications in the merged source package.
    4. Continue this step for all files listed in the M-O-M output.
  4. Sanity-check the package. For instance, you don't want hardcoded paths for older software (that you just dropped) sitting in the source.
  5. Change the debian/changelog to note your work. Note which Ubuntu deltas are still valid and why invalid ones were dropped. Change the M-O-M e-mail address and name to yours.
  6. Generate a new merged source package using the merge-buildpackage script.
    • Remember to pass any necessary options like " -rfakeroot -k<your_gpg_key_id> ".

    • Also pass " -v<last version that was included in Ubuntu> ".

  7. Sanity-build the source package in pbuilder, check the contents of the created debs (using dpkg-deb -c foo.deb), and alert a MOTU to your merged source package.

Things to check during the merge

  • Does the package still require the Ubuntu delta?BR Sometimes changes in other packages will cause the Ubuntu delta to no longer apply, and the change can be dropped, even if not included in Debian.

  • Does the new Debian revision close any Ubuntu bugs?BR

    • Be sure to check the bug page in Launchpad for the package. Also, take a look at the Debian bugs that are closed in the Debian changelog. If bugs are closed, add a section to the changelog detailing the bugfixes, with the appropriate (LP: #bugnumber) entries.
  • Do any of the changes in the remaining Ubuntu delta apply to Debian?
    • If so, make sure that the patch has been submitted to Debian (create a new bug in the BTS if required).
    • If the issue addressed an Ubuntu bug, make sure that the Ubuntu bug is linked to the relevant Debian bug.
    • Also: document the changes still needed in the debian/changelog entry.

  • Checking the debian bug tracking system at http://bugs.debian.org/src:<packageName> might also prove useful.


Go back to [:UbuntuDevelopment].BR CategoryProcessBRCategoryUbuntuDevelopment