Bug#531680: debootstrap: Should not use obsolete dpkg --print-installation-architecture
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?
--
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: 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: