summaryrefslogtreecommitdiff
path: root/infra/get-suites
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-06-28 23:54:13 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-06-28 23:54:13 +0100
commit76cbbc78a07e44b4c917bbaa93bf7cd602387082 (patch)
tree47f69b5db2e9de7e0fad3ed1af0018b02d786ccb /infra/get-suites
parent64c9202d27994e1b0f433d462f2e5704799d6cc8 (diff)
Infra: Add get-suites
Diffstat (limited to 'infra/get-suites')
-rwxr-xr-xinfra/get-suites26
1 files changed, 26 insertions, 0 deletions
diff --git a/infra/get-suites b/infra/get-suites
new file mode 100755
index 0000000..c5a4c56
--- /dev/null
+++ b/infra/get-suites
@@ -0,0 +1,26 @@
+#!/bin/bash
+set -e
+set -o pipefail
+
+srvdir=/srv/dgit.debian.org
+dgitlive=${DGIT_TEST_INTREE-$srvdir/dgit-live}
+output=${DGIT_GETSUITES_OUTPUT-$srvdir/data/suites}
+
+export PERLLIB="$dgitlive${PERLLIB+:}${PERLLIB}"
+
+$dgitlive/dgit archive-api-query /suites | perl -we '
+ use strict;
+ use JSON;
+ undef $/;
+ my $json = <STDIN>;
+ die $! if STDIN->error;
+ my $items = decode_json $json;
+ foreach my $item (@$items) {
+ next unless ($item->{archive}//"") eq "ftp-master";
+ next unless ($item->{codename});
+ print $item->{codename}, "\n" or die $!;
+ }
+ flush STDOUT or die $!;
+' >$output.new
+
+mv -f $output.new $output