Re: Matching mono architectures in d/control
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
If that changes, you rebuild the source, upload, done.
This has the advantage of resulting in an orig.tar.gz + debian.tar.gz
pair that has the correct arch listed, without any build-time magic,
without deliberately failing on certain arches. All at the cost of
having to manually regenerate debian/control whenever the list of
I believe that's an acceptable compromise, and also produces a debian/
that is a lot easier to understand.