Control: tag -1 patch

Hi!

On Tue, 2008-03-04 at 18:28:45 +0900, Paul Wise wrote:
> Package: devscripts
> Version: 2.10.18.1
> Severity: wishlist

> I'd like a script to transfer data to and login to the Debian porting
> machines that are up and available to me. The script could: 
> 
>       * connect to ldap or parse machines.cgi 
>       * choose machines to login to based on all/DD/restricted,
>         architecture, status, have chroots, distribution
>         (etch/sarge/etc) 
>       * transfer a tarball and a script to run on the machines 
>       * chmod and run the script in the dchroot (or outside it) 
>       * detect if dchroot is available, run the script normally if not 
>       * log script output to a file and transfer the result back after
>         logging out 
>       * have an option to leave an interactive session after running the
>         script on each host 
>       * have an option to have each machine in a separate xterm for
>         parallel execution
> 
> I don't need such a script very often but it would be nice to have.

This seems quite some requirements, when I think most people tend to
want mostly to know where to connect to.

This was discussed on debian-devel some years ago [P], and several
scripts were posted. I've been using Faidon Liambotis' one locally for a
while, and today while this came up again on #debian-apt, improved it to
cover the foreign chroot cases. I'm attaching the script, which I think
could go as is, and can always be improved/extended later on.

  [P] <https://lists.debian.org/debian-devel/2014/06/msg00231.html>

I've included the host and arch in the output, so that for the foreign
cases, people can choose the beefier arches if available. But I guess
this could then be modified with a command-line option or similar if
desired.

I'm pondering though that deb-porterbox might be abusing the «deb-»
namespace and it might be better to call this «debian-porterbox»?

I'm also not sure what license Faidon would like to add to this.
Personally I'd be fine with permissive or copyleft, or whatever other
default license is used in devscripts.

Thanks,
Guillem
#!/bin/sh

set -e

arch="$1"
if [ -z "$arch" ]; then
  echo "error: missing architecture argument" 2>&1
  exit 1
fi

case "$arch" in
i386)
  sarch=amd64
  ;;
armel|armhf)
  sarch=arm64
  ;;
mips)
  sarch=mips64
  ;;
mips64el)
  # The host is mipsel, but the kernel is 64-bit MIPS.
  sarch=mipsel
  ;;
mipsel)
  sarch=mips64el
  ;;
powerpc)
  sarch=ppc64
  ;;
esac

archfilter="(architecture=$arch)"
if [ -n "$sarch" ]; then
  archfilter="(|$archfilter(architecture=$sarch))"
fi

exec ldapsearch -LLL -x -h db.debian.org -b ou=hosts,dc=debian,dc=org \
  "(&(purpose=porterbox)$archfilter)" hostname architecture | \
  sed -e '/^dn:/d;s/^hostname:/host:/;s/^architecture:/arch:/'

Reply via email to