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:
Project name: Education
Package name: MultiplicationStation
API URL: https://api.opensuse.org
Source URL: https://api.opensuse.org/source/Education/MultiplicationStation
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">
<!-- <apply name="patch" /> -->
<!-- <topadd>%define build_with_feature_x 1</topadd> -->
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.