[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Matching mono architectures in d/control



Mathieu Malaterre <mathieu.malaterre@gmail.com> writes:

> So here is what I ended up doing:
>
> $ cat rules
> ...
> override_dh_auto_configure: check-mono-archs
> ...
> mono_archs=$(DEB_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)"
> check-mono-archs:
> 	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
time.

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
build.

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
architectures change.

I believe that's an acceptable compromise, and also produces a debian/
that is a lot easier to understand.

-- 
|8]


Reply to: