INFRA_PROGRAMS=dgit-repos-server dgit-ssh-dispatch \
dgit-repos-policy-debian dgit-repos-admin-debian \
dgit-repos-policy-trusting
-INFRA_EXAMPLES=get-dm-txt ssh-wrap drs-cron-wrap
+INFRA_EXAMPLES=get-dm-txt ssh-wrap drs-cron-wrap get-suites
INFRA_PERLMODULES=Debian/Dgit/Policy/Debian.pm
all:
--- /dev/null
+#!/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