openSUSE / open-build-service

Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
https://openbuildservice.org
GNU General Public License v2.0
940 stars 440 forks source link

easier handling of parallel installable packages #5714

Open lnussel opened 6 years ago

lnussel commented 6 years ago

Following situation:

Leap has rubgem-arel version 8.0.0, Factory has rubygem-arel version 9.0.0. We can't replace rubygem-arel in Leap as it comes from SLE. So we need a parallel installable version. So far the approach to that is to copy the factory package to rubygem-arel-9, rename the spec file and in the spec file add %define mod_version_suffix -9. So quite some work for an almost identical package. So I was wondering if the "magic dot" handling of obs could be used there. Ie

osc sr openSUSE:Factory rubygem-arel openSUSE:Leap:15.1 rubygem-arel.9

Is there a way for the spec file to detect that it has this magic dot mode to activate the version suffix?

lnussel commented 6 years ago

A question mostly for @adrianschroeter I guess :)

adrianschroeter commented 6 years ago

you could get that from the disturl, the packid is the last part behind the - if that helps you.

adrianschroeter commented 6 years ago

There is no "dot mode" in this regard, just package container contains a dot. You get the entire container name via

%disturl =~ s/.*\/[^-]*//

lnussel commented 6 years ago

not sure rpm macros are powerful enough for that