FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian dpkg

 
 
LinkBack Thread Tools
 
Old 10-08-2011, 05:48 PM
Thorsten Glaser
 
Default A bufix and a way to prevent future bugs like this

Hi,

when looking at the new architecture.mk to design a patch for
vim to not build its GNOME flavour on m68k, due to lack of an
installable GNOME there, I’ve spotted a bug, looks like pasto
since DEB_HOST_ARCH_BITS wasn’t set properly.

Then I looked at the code again and thought “that can be enu‐
merated programmatically”. The 0002 format-patch does that in
the most compact form I could think of (no idea whether gmake
allows to break the over-long line), and this works for me in
a test Makefile, which I also attached.

Please test and apply then consider applying to 1.16.1.1 too.

bye,
//mirabilos
--
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mkshFrom 6ebabaf5fa618ced2fb3e3c7a6de82e02610359c Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@mirbsd.org>
Date: Sat, 8 Oct 2011 17:25:08 +0000
Subject: [PATCH 1/2] fix an obvious typo


Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
---
scripts/mk/architecture.mk | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/mk/architecture.mk b/scripts/mk/architecture.mk
index 4379e00..56eaabe 100644
--- a/scripts/mk/architecture.mk
+++ b/scripts/mk/architecture.mk
@@ -7,7 +7,7 @@ dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shel
DEB_HOST_ARCH ?= $(call dpkg_late_eval,DEB_HOST_ARCH,dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS ?= $(call dpkg_late_eval,DEB_HOST_ARCH_OS,dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_ARCH_CPU ?= $(call dpkg_late_eval,DEB_HOST_ARCH_CPU,dpkg-architecture -qDEB_HOST_ARCH_CPU)
-DEB_HOST_ARCH ?= $(call dpkg_late_eval,DEB_HOST_ARCH,dpkg-architecture -qDEB_HOST_ARCH_BITS)
+DEB_HOST_ARCH_BITS ?= $(call dpkg_late_eval,DEB_HOST_ARCH,dpkg-architecture -qDEB_HOST_ARCH_BITS)
DEB_HOST_ARCH_ENDIAN ?= $(call dpkg_late_eval,DEB_HOST_ARCH_ENDIAN,dpkg-architecture -qDEB_HOST_ARCH_ENDIAN)
DEB_HOST_GNU_CPU ?= $(call dpkg_late_eval,DEB_HOST_GNU_CPU,dpkg-architecture -qDEB_HOST_GNU_CPU)
DEB_HOST_GNU_SYSTEM ?= $(call dpkg_late_eval,DEB_HOST_GNU_SYSTEM,dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
@@ -17,7 +17,7 @@ DEB_HOST_MULTIARCH ?= $(call dpkg_late_eval,DEB_HOST_MULTIARCH,dpkg-architecture
DEB_BUILD_ARCH ?= $(call dpkg_late_eval,DEB_BUILD_ARCH,dpkg-architecture -qDEB_BUILD_ARCH)
DEB_BUILD_ARCH_OS ?= $(call dpkg_late_eval,DEB_BUILD_ARCH_OS,dpkg-architecture -qDEB_BUILD_ARCH_OS)
DEB_BUILD_ARCH_CPU ?= $(call dpkg_late_eval,DEB_BUILD_ARCH_CPU,dpkg-architecture -qDEB_BUILD_ARCH_CPU)
-DEB_BUILD_ARCH ?= $(call dpkg_late_eval,DEB_BUILD_ARCH,dpkg-architecture -qDEB_BUILD_ARCH_BITS)
+DEB_BUILD_ARCH_BITS ?= $(call dpkg_late_eval,DEB_BUILD_ARCH,dpkg-architecture -qDEB_BUILD_ARCH_BITS)
DEB_BUILD_ARCH_ENDIAN ?= $(call dpkg_late_eval,DEB_BUILD_ARCH_ENDIAN,dpkg-architecture -qDEB_BUILD_ARCH_ENDIAN)
DEB_BUILD_GNU_CPU ?= $(call dpkg_late_eval,DEB_BUILD_GNU_CPU,dpkg-architecture -qDEB_BUILD_GNU_CPU)
DEB_BUILD_GNU_SYSTEM ?= $(call dpkg_late_eval,DEB_BUILD_GNU_SYSTEM,dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
--
1.6.3.1

From 5fa6ccd7049f1ed9e1950ceff51000399e1f8ca2 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@mirbsd.org>
Date: Sat, 8 Oct 2011 17:42:00 +0000
Subject: [PATCH 2/2] programmatically enumerate the dpkg-buildflags variables

to prevent bugs like the one fixed in
6ebabaf5fa618ced2fb3e3c7a6de82e02610359c

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
---
scripts/mk/architecture.mk | 22 ++++------------------
1 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/scripts/mk/architecture.mk b/scripts/mk/architecture.mk
index 56eaabe..08d1e65 100644
--- a/scripts/mk/architecture.mk
+++ b/scripts/mk/architecture.mk
@@ -4,22 +4,8 @@

dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))

-DEB_HOST_ARCH ?= $(call dpkg_late_eval,DEB_HOST_ARCH,dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_ARCH_OS ?= $(call dpkg_late_eval,DEB_HOST_ARCH_OS,dpkg-architecture -qDEB_HOST_ARCH_OS)
-DEB_HOST_ARCH_CPU ?= $(call dpkg_late_eval,DEB_HOST_ARCH_CPU,dpkg-architecture -qDEB_HOST_ARCH_CPU)
-DEB_HOST_ARCH_BITS ?= $(call dpkg_late_eval,DEB_HOST_ARCH,dpkg-architecture -qDEB_HOST_ARCH_BITS)
-DEB_HOST_ARCH_ENDIAN ?= $(call dpkg_late_eval,DEB_HOST_ARCH_ENDIAN,dpkg-architecture -qDEB_HOST_ARCH_ENDIAN)
-DEB_HOST_GNU_CPU ?= $(call dpkg_late_eval,DEB_HOST_GNU_CPU,dpkg-architecture -qDEB_HOST_GNU_CPU)
-DEB_HOST_GNU_SYSTEM ?= $(call dpkg_late_eval,DEB_HOST_GNU_SYSTEM,dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
-DEB_HOST_GNU_TYPE ?= $(call dpkg_late_eval,DEB_HOST_GNU_TYPE,dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_HOST_MULTIARCH ?= $(call dpkg_late_eval,DEB_HOST_MULTIARCH,dpkg-architecture -qDEB_HOST_MULTIARCH)
+define DPKG_ARCHITECTURE_template
+$(1) ?= $$(call dpkg_late_eval,$(1),dpkg-architecture -q$(1))
+endef

-DEB_BUILD_ARCH ?= $(call dpkg_late_eval,DEB_BUILD_ARCH,dpkg-architecture -qDEB_BUILD_ARCH)
-DEB_BUILD_ARCH_OS ?= $(call dpkg_late_eval,DEB_BUILD_ARCH_OS,dpkg-architecture -qDEB_BUILD_ARCH_OS)
-DEB_BUILD_ARCH_CPU ?= $(call dpkg_late_eval,DEB_BUILD_ARCH_CPU,dpkg-architecture -qDEB_BUILD_ARCH_CPU)
-DEB_BUILD_ARCH_BITS ?= $(call dpkg_late_eval,DEB_BUILD_ARCH,dpkg-architecture -qDEB_BUILD_ARCH_BITS)
-DEB_BUILD_ARCH_ENDIAN ?= $(call dpkg_late_eval,DEB_BUILD_ARCH_ENDIAN,dpkg-architecture -qDEB_BUILD_ARCH_ENDIAN)
-DEB_BUILD_GNU_CPU ?= $(call dpkg_late_eval,DEB_BUILD_GNU_CPU,dpkg-architecture -qDEB_BUILD_GNU_CPU)
-DEB_BUILD_GNU_SYSTEM ?= $(call dpkg_late_eval,DEB_BUILD_GNU_SYSTEM,dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
-DEB_BUILD_GNU_TYPE ?= $(call dpkg_late_eval,DEB_BUILD_GNU_TYPE,dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_BUILD_MULTIARCH ?= $(call dpkg_late_eval,DEB_BUILD_MULTIARCH,dpkg-architecture -qDEB_BUILD_MULTIARCH)
+$(foreach where,BUILD HOST,$(foreach what,ARCH ARCH_OS ARCH_CPU ARCH_BITS ARCH_ENDIAN GNU_CPU GNU_SYSTEM GNU_TYPE MULTIARCH,$(eval $(call DPKG_ARCHITECTURE_template,DEB_${where}_${what}))) )
--
1.6.3.1

include ./architecture.mk

all:
@printf '%s="%s"
' 'DEB_HOST_ARCH' '${DEB_HOST_ARCH}'
@printf '%s="%s"
' 'DEB_HOST_ARCH_OS' '${DEB_HOST_ARCH_OS}'
@printf '%s="%s"
' 'DEB_HOST_ARCH_CPU' '${DEB_HOST_ARCH_CPU}'
@printf '%s="%s"
' 'DEB_HOST_ARCH_BITS' '${DEB_HOST_ARCH_BITS}'
@printf '%s="%s"
' 'DEB_HOST_ARCH_ENDIAN' '${DEB_HOST_ARCH_ENDIAN}'
@printf '%s="%s"
' 'DEB_HOST_GNU_CPU' '${DEB_HOST_GNU_CPU}'
@printf '%s="%s"
' 'DEB_HOST_GNU_SYSTEM' '${DEB_HOST_GNU_SYSTEM}'
@printf '%s="%s"
' 'DEB_HOST_GNU_TYPE' '${DEB_HOST_GNU_TYPE}'
@printf '%s="%s"
' 'DEB_HOST_MULTIARCH' '${DEB_HOST_MULTIARCH}'
@printf '%s="%s"
' 'DEB_BUILD_ARCH' '${DEB_BUILD_ARCH}'
@printf '%s="%s"
' 'DEB_BUILD_ARCH_OS' '${DEB_BUILD_ARCH_OS}'
@printf '%s="%s"
' 'DEB_BUILD_ARCH_CPU' '${DEB_BUILD_ARCH_CPU}'
@printf '%s="%s"
' 'DEB_BUILD_ARCH_BITS' '${DEB_BUILD_ARCH_BITS}'
@printf '%s="%s"
' 'DEB_BUILD_ARCH_ENDIAN' '${DEB_BUILD_ARCH_ENDIAN}'
@printf '%s="%s"
' 'DEB_BUILD_GNU_CPU' '${DEB_BUILD_GNU_CPU}'
@printf '%s="%s"
' 'DEB_BUILD_GNU_SYSTEM' '${DEB_BUILD_GNU_SYSTEM}'
@printf '%s="%s"
' 'DEB_BUILD_GNU_TYPE' '${DEB_BUILD_GNU_TYPE}'
@printf '%s="%s"
' 'DEB_BUILD_MULTIARCH' '${DEB_BUILD_MULTIARCH}'
 

Thread Tools




All times are GMT. The time now is 09:21 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org