Package: gcc-mingw-w64
Version: 4.6.3-5+6
Severity: wishlist
Tags: patch

Hi Stephen, 

as I see from your f126ca2 commit, you opted to use `lsb_release -is` to
"detect" Ubuntu. I propose that you use dpkg-dev's `dpkg-vendor
--derives-from` instead. It has the advantage of also detecting distributions
that derive from Ubuntu.

Patch against current master attached.

Cheers, 

OdyX

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (150, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_CH.UTF-8, LC_CTYPE=fr_CH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcc-mingw-w64 depends on:
ii  gcc-mingw-w64-base    4.6.3-5+6
ii  gcc-mingw-w64-i686    4.6.3-5+6
ii  gcc-mingw-w64-x86-64  4.6.3-5+6

Versions of packages gcc-mingw-w64 recommends:
ii  g++-mingw-w64       4.6.3-5+6
ii  gfortran-mingw-w64  4.6.3-5+6
ii  gnat-mingw-w64      4.6.3-5+6

gcc-mingw-w64 suggests no packages.

-- no debconf information
>From 4daaf38357cb8614d9fcf34d120968d6c97cb07b Mon Sep 17 00:00:00 2001
From: Didier Raboud <o...@debian.org>
Date: Sun, 6 May 2012 12:53:00 +0200
Subject: [PATCH] Use dpkg-dev instead of lsb_release to detect Ubuntu and derivatives.

---
 debian/control |    1 -
 debian/rules   |    4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 4ee8c60..649e3de 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,6 @@ Build-Depends: autotools-dev,
                libgmp-dev,
                libmpc-dev (>= 0.8.0),
                libmpfr-dev (>= 2.3.2),
-               lsb-release,
                mingw-w64-dev (>= 1.0),
                xz-utils,
                zlib1g-dev
diff --git a/debian/rules b/debian/rules
index 459d80f..90c9852 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,11 +17,11 @@ source_version := $(shell dpkg-query -W -f="\$${Version}\n" gcc-$(target_version
 deb_version := $(source_version)+$(shell dpkg-parsechangelog | sed -ne "s/^Version: \(.*\)/\1/p")
 deb_upstream_version := $(shell echo $(deb_version) | cut -d- -f1)
 base_version := $(shell echo $(deb_version) | sed -e 's/\([1-9]\.[0-9]\).*-.*/\1/')
-distribution := $(shell lsb_release -is)
+derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no")
 
 # First split version
 first_split_version := 4.6.3-3+4
-ifeq ($(distribution),Ubuntu)
+ifeq ($(derives_from_ubuntu),yes)
   first_split_version := 4.6.3-1ubuntu5+5ubuntu1
 endif
 
-- 
1.7.2.5

Reply via email to