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

Re: Exporting ARCH to pbuilder through pdebuild?



Here is the complete .pbuilderrc:

    : ${ARCH:="$(dpkg --print-architecture)"}
    EXTRAPACKAGES="$EXTRAPACKAGES fakeroot"
    USEPROC=yes
    USEDEVPTS=yes
    USEDEVFS=no
    APTCACHEHARDLINK="yes"
    REMOVEPACKAGES="lilo"
    HOOKDIR=""
    export DEBIAN_FRONTEND="noninteractive"
    BUILDSOURCEROOTCMD="fakeroot"
    PBUILDERROOTCMD="sudo"
    DEBBUILDOPTS="-si -i"
    BUILDUSERID=1234
    BUILDUSERNAME=pbuilder
    BINDMOUNTS=""
    DEBOOTSTRAPOPTS[0]='--variant=buildd'
    export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
    export SHELL=/bin/bash
    DEBOOTSTRAP="debootstrap"
    PKGNAME_LOGFILE_EXTENTION="_$ARCH.build"
    PKGNAME_LOGFILE="yes"
    AUTO_DEBSIGN=yes
    UNSTABLE_CODENAME="sid"
    TESTING_CODENAME="squeeze"
    STABLE_CODENAME="lenny"
    STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports"
    DEBIAN_SUITES=(
	$UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME
	"unstable" "testing" "stable"
    )
    UBUNTU_SUITES=("jaunty" "intrepid" "hardy" "gutsy")
    DEBIAN_MIRROR="ftp.us.debian.org"
    MULTIMEDIA_MIRROR="deb http://www.debian-multimedia.org sid main"
    if [ -z "${DIST}" ] && [ -r "debian/changelog" ]; then
	DIST=$(dpkg-parsechangelog | awk '/^Distribution: / {print $2}')
	if $(echo "experimental UNRELEASED" | grep -q $DIST); then
	    DIST="$UNSTABLE_CODENAME"
	fi
    fi
    : ${DIST:="$(lsb_release --short --codename)"}
    case "$DIST" in
	unstable)
	    DIST="$UNSTABLE_CODENAME"
	    ;;
	testing)
	    DIST="$TESTING_CODENAME"
	    ;;
	stable)
	    DIST="$STABLE_CODENAME"
	    ;;
    esac
    NAME="$DIST"
    if [ -n "${ARCH}" ]; then
	NAME="$NAME-$ARCH"
	DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
    fi
    BASETGZ="/var/cache/pbuilder/$NAME-base.tgz"
    DISTRIBUTION="$DIST"
    BUILDRESULT="/var/cache/pbuilder/$NAME/result/"
    APTCACHE="/var/cache/pbuilder/$NAME/aptcache/"
    BUILDPLACE="/var/cache/pbuilder/build/"
    if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then
	MIRRORSITE="http://$DEBIAN_MIRROR/debian/";
	COMPONENTS="main contrib non-free"
	OTHERMIRROR="$OTHERMIRROR | $MULTIMEDIA_MIRROR"
	EXTRAPACKAGES="$EXTRAPACKAGES debian-multimedia-keyring"
	if $(echo "$STABLE_CODENAME stable" | grep -q $DIST); then
	    EXTRAPACKAGES="$EXTRAPACKAGES debian-backports-keyring"
	    OTHERMIRROR="$OTHERMIRROR | deb http://www.backports.org/debian $STABLE_BACKPORTS_SUITE $COMPONENTS"
	fi
    elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then
	MIRRORSITE="http://$UBUNTU_MIRROR/ubuntu/";
	COMPONENTS="main restricted universe multiverse"
    else
	echo "Unknown distribution: $DIST"
	exit 1
    fi
    #echo $BASETGZ
    #exit

Note that when the last two lines are uncommented, the basetgz is correctly
reported based on the architecture (as defined by ARCH) as one of the
following:

    - /var/cache/pbuilder/sid-amd64-base.tgz
    - /var/cache/pbuilder/sid-i386-base.tgz

However, when called with: 

    ARCH=i386 pdebuild --auto-debsign --buildresult /tmp/$(basename $PWD)

pbuilder still attemps to use the amd64 tarball. I can only get around
this by explicitly calling it with:

    -- --basetgz /var/cache/pbuilder/sid-i386-base.tgz

appended to the end of the pdebuild command line.

Why is pbuilder still using /var/cache/pbuilder/sid-amd64-base.tgz
instead of the correct /var/cache/pbuilder/sid-i386-base.tgz in this
instance?

-- 
"Oh, look: rocks!"
	-- Doctor Who, "Destiny of the Daleks"


Reply to: