chiark / gitweb /
git-debrebase: introduce $claims_to_be_breakwater (nfc)
[dgit.git] / infra / get-suites
1 #!/bin/bash
2 set -e
3 set -o pipefail
4
5 srvdir=/srv/dgit.debian.org
6 dgitlive=${DGIT_TEST_INTREE-$srvdir/dgit-live}
7 output=${DGIT_GETSUITES_OUTPUT-$srvdir/data/suites}
8
9 export PERLLIB="$dgitlive${PERLLIB+:}${PERLLIB}"
10
11 $dgitlive/dgit archive-api-query /suites | perl -we '
12         use strict;
13         use JSON;
14         undef $/;
15         my $json = <STDIN>;
16         die $! if STDIN->error;
17         my $items = decode_json $json;
18         foreach my $item (@$items) {
19                 next unless ($item->{archive}//"") eq "ftp-master";
20                 next unless ($item->{codename});
21                 print $item->{codename}, "\n" or die $!;
22         }
23         flush STDOUT or die $!;
24 ' >$output.new
25
26 mv -f $output.new $output