File: get-suites

package info (click to toggle)
dgit 13.20
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,084 kB
  • sloc: perl: 13,961; sh: 7,268; makefile: 340; python: 334; tcl: 69
file content (27 lines) | stat: -rwxr-xr-x 653 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -e
set -o pipefail
shopt -s inherit_errexit # #514862, wtf

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