launchpad-users team mailing list archive
-
launchpad-users team
-
Mailing list archive
-
Message #07088
Re: Getting the distribution series in a recipe
On Sun, Dec 08, 2019 at 03:59:50PM +0300, Alberto Mardegan wrote:
> Inside a recipe I can use several useful variables, specified in [1].
> Now, my project needs different packaging for different distribution
> series, so I was thinking to store the debian packaging in branches
> named like "packaging-xenial" and "packaging-bionic", and then have the
> recipe pick the correct one and merge it into the base code.
>
> However, there doesn't seem to be a variable carrying the distribution
> name, which would allow me to write a recipe command like
>
> merge packaging lp:~mardy/imaginario/packaging-{distribution}
Substitution variables are expanded in versions, but not in commands
such as "merge"; so even if such a variable existed (which it doesn't),
it wouldn't help you.
> I guess I need to use two different recipes, then, or is there some
> trick to achieve this with a single recipe?
The only way I know of to achieve this with a single recipe is to figure
out how to merge the multiple packaging branches into one, with
conditional behaviour in debian/rules etc. This should be possible in
most cases, although I appreciate it isn't always straightforward.
--
Colin Watson [cjwatson@xxxxxxxxxxxxx]
References