0
      ÁˆÏ�þZn¬à„ãñŒBy÷�üÿä„Ž‰ßãÃá ?÷     Á#!/bin/bash
# Simple shell script for driving a remote cowbuilder via ssh
#
# Copyright(C) 2007, 2008, 2009, 2011, 2012, 2014, Ron <ron@debian.org>
# This script is distributed according to the terms of the GNU GPL.

set -e

#BUILDD_HOST=
#BUILDD_USER=
BUILDD_ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH 2>/dev/null)"

# The 'default' dist is whatever cowbuilder is locally configured for
BUILDD_DIST="default"

INCOMING_DIR="cowbuilder-incoming"
PBUILDER_BASE="/var/cache/pbuilder"

#SIGN_KEYID=
#UPLOAD_QUEUE="ftp-master"
BUILDD_ROOTCMD="sudo"

REMOTE_SCRIPT="cowssh_it"
DEBOOTSTRAP="cdebootstrap"

for f in /etc/cowpoke.conf ~/.cowpoke .cowpoke "$COWPOKE_CONF"; do [ -r "$f" ] && . "$f"; done


get_archdist_vars() {
    _ARCHDIST_OPTIONS="RESULT_DIR BASE_PATH BASE_DIST CREATE_OPTS UPDATE_OPTS BUILD_OPTS SIGN_KEYID UPLOAD_QUEUE"
    _RESULT_DIR="result"
    _BASE_PATH="base.cow"

    for arch in $BUILDD_ARCH; do
	for dist in $BUILDD_DIST; do
	    for var in $_ARCHDIST_OPTIONS; do
		eval "val=( \"\${${arch}_${dist}_${var}[@]}\" )"

		if [ "$1" = "display" ]; then
		    case $var in
			RESULT_DIR | BASE_PATH )
			    [ ${#val[@]} -gt 0 ] || eval "val=\"$PBUILDER_BASE/$arch/$dist/\$_$var\""
			    echo "   ${arch}_${dist}_${var} = $val"
			    ;;

			*_OPTS )
			    # Don't display these if they are overridden on the command line.
			    eval "override=( \"\${OVERRIDE_${var}[@]}\" )"
			    [ ${#override[@]} -gt 0 ] || [ ${#val[@]} -eq 0 ] ||
				echo "   ${arch}_${dist}_${var} =$(printf " '%s'" "${val[@]}")"
			    ;;

			* )
			    [ ${#val[@]} -eq 0 ] || echo "   ${arch}_${dist}_${var} = $val"
			    ;;
		    esac
		else
		    case $var in
			RESULT_DIR | BASE_PATH )
			    # These are always a single value, and must always be set,
			    # either by the user or to their default value.
			    [ ${#val[@]} -gt 0 ] || eval "val=\"$PBUILDER_BASE/$arch/$dist/\$_$var\""
			    echo "${arch}_${dist}_${var}='$val'"
			    ;;

			*_OPTS )
			    # These may have zero, one, or many values which we must not word-split.
			    # They can safely remain unset if there are no values.
			    #
			    # We don't need to worry about the command line overrides here,
			    # they will be taken care of in the remote script.
			    [ ${#val[@]} -eq 0 ] ||
				echo "${arch}_${dist}_${var}=($(printf " %q" "${val[@]}") )"
			    ;;

			SIGN_KEYID | UPLOAD_QUEUE )
			    # We don't need these in the remote script
			    ;;

			* )
			    # These may have zero or one value.
			    # They can safely remain unset if there are no values.
			    [ ${#val[@]} -eq 0 ] || echo "${arch}_${dist}_${var}='$val'"
			    ;;
		    esac
		fi
	    done
	done
    done
}

display_override_vars() {
    _OVERRIDE_OPTIONS="CREATE_OPTS UPDATE_OPTS BUILD_OPTS SIGN_KEYID UPLOAD_QUEUE"

    for var in $_OVERRIDE_OPTIONS; do
	eval "override=( \"\${OVERRIDE_${var}[@]}\" )"
	[ ${#override[@]} -eq 0 ] || echo "   override: $var =$(printf " '%s'" "${override[@]}")"
    done
}


PROGNAME=${0##*/}
version() {
    echo \
"This is $PROGNAME, from the Debian devscripts package, version 2.23.4+deb12u2
This code is Copyright 2007-2014, Ron <ron@debian.org>.
This program comes with ABSOLUTELY NO WARRANTY.
You are free to redistribute this code under the terms of the
GNU General Public License."
    exit 0
}

usage() {
    cat 1>&2 <<EOF

cowpoke [options] package.dsc

  Uploads a Debian source package to a cowbuilder host and builds it,
  optionally also signing and uploading the result to an incoming queue.
  The following options are supported:

   --arch="arch"         Specify the Debian architecture(s) to build for.
   --dist="dist"         Specify the Debian distribution(s) to build for.
   --buildd="host"       Specify the remote host to build on.
   --buildd-user="name"  Specify the remote user to build as.
   --create              Create the remote cowbuilder root if necessary.
   --return[="path"]     Copy results of the build to 'path'.  If path is
                         not specified, return them to the current directory.
   -