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

[cjwatson@ubuntu.com: Re: Accepted util-linux 2.12p-4ubuntu4 (source)]

Forwarded at Scott's request.

Colin Watson                                       [cjwatson@debian.org]

----- Forwarded message from Colin Watson <cjwatson@ubuntu.com> -----

Date: Tue, 31 May 2005 19:04:35 +0100
From: Colin Watson <cjwatson@ubuntu.com>
To: Scott James Remnant <scott@netsplit.com>
Cc: ubuntu-devel@lists.ubuntu.com
Subject: Re: Accepted util-linux 2.12p-4ubuntu4 (source)
Mail-Followup-To: Scott James Remnant <scott@netsplit.com>,
User-Agent: Mutt/1.5.9i

On Mon, May 23, 2005 at 07:16:57PM +0100, Scott James Remnant wrote:
> On Sat, 2005-05-21 at 12:50 +0100, Colin Watson wrote:
> > Changes: 
> >  util-linux (2.12p-4ubuntu4) breezy; urgency=low
> >  .
> >    * dpkg-architecture says DEB_HOST_GNU_SYSTEM is "linux-gnu" now, not
> >      "linux". Take account of this, and add compatibility code for old
> >      dpkg-architecture (closes: Ubuntu #11012).
> You should use the value of DEB_HOST_ARCH_OS (linux) rather than relying
> on GNU triplets not changing in future.

So, the full form of my current rune for dealing with this stuff in a
backward-compatible way looks like this:

DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)

# Take account of old dpkg-architecture output.
ifeq ($(DEB_HOST_ARCH_CPU),)
  DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
  ifeq ($(DEB_HOST_ARCH_CPU),x86_64)
    DEB_HOST_ARCH_CPU := amd64
ifeq ($(DEB_HOST_ARCH_OS),)
  DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM))
  ifeq ($(DEB_HOST_ARCH_OS),gnu)
    DEB_HOST_ARCH_OS := hurd

... and similarly for DEB_BUILD_ARCH_*. I then go through and change
everything that refers to DEB_HOST_GNU_CPU and DEB_HOST_GNU_SYSTEM to
refer to DEB_HOST_ARCH_CPU and DEB_HOST_ARCH_OS, and to change the
naming scheme where necessary (x86_64 => amd64, gnu => hurd,
kfreebsd-gnu => kfreebsd, knetbsd-gnu => knetbsd, netbsdelf-gnu =>

Naturally a build-depend on dpkg-dev (>= 1.13.2) would be simpler, but
I'm not in a position to do that for most of the code I care about yet,
since it has to build on Debian unstable too.

This is fairly non-trivial and took a bit of reading of dpkg source to
figure out (and I'm still not sure I've got all the special cases right,
especially where the BSDs are concerned). Do you think you could put
something like the above example into the "BACKWARD COMPATIBILITY"
section of dpkg-architecture(1)? Bonus points for using .nf and .fi to
fix the nroff formatting while you're at it ...


Colin Watson                                       [cjwatson@ubuntu.com]

----- End forwarded message -----

Reply to: