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

Bug#531680: debootstrap: Should not use obsolete dpkg --print-installation-architecture



Hello,

On Wed, Jun 3, 2009 at 2:24 PM, Otavio Salvador <otavio@ossystems.com.br> wrote:
> Hello Felix,
>
> On Wed, Jun 3, 2009 at 6:13 AM, Felix Zielcke <fzielcke@z-51.de> wrote:
>> The new dpkg in sid warns now that --print-installation-architecture is obsolete:
>>
>> fz:~# debootstrap sid chroot http://ftp.de.debian.org/debian
>> dpkg: warning: obsolete option '--print-installation-architecture', please use '--print-architecture' instead.
>>
>> This patch solves it.
>
> What people thinks about the alternative patch attached?

I fixed a minor issue with the patch and it works for me now. Please
use this version when reviewing.

-- 
Otavio Salvador                  O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br
Index: debian/changelog
===================================================================
--- debian/changelog	(revisão 58649)
+++ debian/changelog	(cópia de trabalho)
@@ -1,3 +1,11 @@
+debootstrap (1.0.14) UNRELEASED; urgency=low
+
+  * Use "dpkg --print-architecture" to avoid deprecation warning. Thanks
+    to Felix Zielcke <fzielcke@z-51.de> for the first version of the
+    patch. Closes: #531680.
+  
+ -- Otavio Salvador <otavio@ossystems.com.br>  Wed, 03 Jun 2009 14:26:22 -0300
+
 debootstrap (1.0.13) unstable; urgency=low
 
   [ Otavio Salvador ]
Index: debootstrap
===================================================================
--- debootstrap	(revisão 58649)
+++ debootstrap	(cópia de trabalho)
@@ -332,18 +332,20 @@
 
 ###########################################################################
 
-if [ "$ARCH" != "" ]; then
-	true
-elif [ -x /usr/bin/dpkg ] && \
-     /usr/bin/dpkg --print-installation-architecture >/dev/null 2>&1; then
-	ARCH=`/usr/bin/dpkg --print-installation-architecture`
-elif type udpkg >/dev/null 2>&1 && \
-     udpkg --print-architecture >/dev/null 2>&1; then
-	ARCH=`/usr/bin/udpkg --print-architecture`
-elif [ -e $DEBOOTSTRAP_DIR/arch ]; then
-	ARCH=`cat $DEBOOTSTRAP_DIR/arch`
-else
-	error 1 WHATARCH "Couldn't work out current architecture"
+if [ -z "$ARCH" ]; then
+	if [ -x /usr/bin/dpkg ]; then
+		DPKG="/usr/bin/dpkg"
+	elif type udpkg >/dev/null 2>&1; then
+		DPKG="udpkg"
+	fi
+
+	if [ -n "$DPKG" ] && $DPKG --print-architecture >/dev/null 2>&1; then
+		ARCH=`$DPKG --print-architecture`
+	elif [ -e $DEBOOTSTRAP_DIR/arch ]; then
+		ARCH=`cat $DEBOOTSTRAP_DIR/arch`
+	else
+		error 1 WHATARCH "Couldn't work out current architecture"
+	fi
 fi
 
 export ARCH SUITE TARGET

Reply to: