Home Home > 2009 > 02 > 06 > Linking Buildservice packages with exact revisions
Sign up | Login

Linking Buildservice packages with exact revisions

February 6th, 2009 by

During the “cleanup” of the HP-Education repository, I used a very interesting feature of the openSUSE Build Service: linking against revisions.

Sometimes, you want to patch a package from another repository to build with special features enabled or disabled. The Build Service allows you to link the package from this other repository (and avoid wasting space by duplicating the sources) and add your patches.

Now think about a patch against a special version of a package – and you know that you don’t want a package with a newer version in your repository for a foreseeable time. But if you use the plain link command of the Build Service, the linked package in your repository will get updated if the original package in the original project is updated.

Luckily, the buildservice allows you to link against a “frozen” state of a package: it’s source-revision. People already knowing any revision control systems like Subversion also know that the revision of a source is increased each time, a new change is submitted. And that’s what we need now: link against a special revision of the package from the other repository and apply our patch against it. The webclient currently doesn’t support such special features, but with osc it’s very easy.

First, check the needed revision in the original project:

cd Education/MultiplicationStation
osc info


Project name: Education
Package name: MultiplicationStation
Path: /home/data/SVN/Education/MultiplicationStation
API URL: https://api.opensuse.org
Source URL: https://api.opensuse.org/source/Education/MultiplicationStation
srcmd5: 484c329659d613e3bbdd515a1a8d1099
Revision: 10
Link info: None

Now create a link with this (or any further) revision to your new project:

osc linkpac -r 10 Education MultiplicationStation isv:hp:education

..and in the resulting “_link” file in your new project, you’ll find:

<link project="Education" package="MultiplicationStation" rev="10">
<patches>
<!-- <apply name="patch" /> -->
<!-- <topadd>%define build_with_feature_x 1</topadd> -->
</patches>
</link>

So your linked package will always use the source revision 10 of the original project. Let’s start applying patches…

Both comments and pings are currently closed.

Comments are closed.