Re: Matching mono architectures in d/control
On Tue, Jan 31, 2012 at 5:11 PM, Gergely Nagy <email@example.com> wrote:
> Mathieu Malaterre <firstname.lastname@example.org> writes:
>> So here is what I ended up doing:
>> $ cat rules
>> override_dh_auto_configure: check-mono-archs
>> gdcm_archs="$(shell grep -2 libvtkgdcm-cil debian/control | grep
>> Architecture | cut -d: -f2 | tr " " "\n" | sort -g)"
>> mono_sorted="$(shell echo ' $(mono_archs)' | tr ' ' '\n' | sort -g)"
>> if [ $(gdcm_archs) != $(mono_sorted) ]; then echo "Incompatible arch,
>> should be $(mono_archs)"; exit 1; fi
> That's... beyond horrifyingly ugly and inappropriate. I'm sorry.
> You basically have a package that has an architecture list, and
> deliberately FTBFS if it's an incompatible arch. That will, indeed, stop
> the build, but it still means the buildds will waste time trying it.
> I would propose a different solution, which, I believe is a lot nicer:
> instead of trying to do magic at build time, do it at source build
> Of course, the problem is, you MUST have debian/control ready when
> building the source tarball, and the unpacked source MUST include it
> too. So we can't generate it... or can we?
> I trick I used in the past, is to have a debian/control.in, which is the
> canonical source of debian/control, BUT, I do NOT regenerate
> debian/control at build time. I generate it using a separate script,
> which I hook into git-buildpackage (or whatever else I use this
> week). This hook can be used to update the arch list, and the source you
> build, will have the correct arches listed at the time of the source
Indeed, this is much much simplier and more robust. I'll update
d/rules to generate control from control.in