<commit_before>#!/usr/bin/env bash
set -Eeuo pipefail

suites=(
	oldstable
	stable
	testing
	unstable

	wheezy
	jessie
	stretch
	sid
)

thisDir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
self="$(basename "$0")"

usage() {
	cat <<-EOU
		usage: $self <output-dir> <timestamp>
		   ie: $self output 2017-05-08T00:00:00Z
	EOU
}
eusage() {
	echo >&2 "error: $1"
	usage >&2
	exit 1
}

# a silly flag to skip "docker build" (for giggles/debugging)
build=1
if [ "${1:-}" = '--no-build' ]; then
	shift
	build=
fi

outputDir="${1:-}"; shift || eusage 'missing output-dir'
timestamp="${1:-}"; shift || eusage 'missing timestamp'

mkdir -p "$outputDir"
outputDir="$(readlink -f "$outputDir")"

dockerImage='tianon/docker-deboot'
[ -z "$build" ] || docker build -t "$dockerImage" -f "$thisDir/Dockerfile.builder" "$thisDir"

dpkgArch="$(docker run --rm "$dockerImage" dpkg --print-architecture)"
echo
echo "-- BUILDING TARBALLS FOR '$dpkgArch' --"
echo

for suite in "${suites[@]}"; do
	if ! wget --quiet --spider "http://deb.debian.org/debian/dists/$suite/main/binary-$dpkgArch/Release"; then
		echo >&2
		echo >&2 "warning: '$suite' not supported on '$dpkgArch'; skipping"<commit_msg>Switch "build-all.sh" to check for _security_ support rather than just main support<commit_after>#!/usr/bin/env bash
set -Eeuo pipefail

suites=(
	oldstable
	stable
	testing
	unstable

	wheezy
	jessie
	stretch
	sid
)

thisDir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
self="$(basename "$0")"

usage() {
	cat <<-EOU
		usage: $self <output-dir> <timestamp>
		   ie: $self output 2017-05-08T00:00:00Z
	EOU
}
eusage() {
	echo >&2 "error: $1"
	usage >&2
	exit 1
}

# a silly flag to skip "docker build" (for giggles/debugging)
build=1
if [ "${1:-}" = '--no-build' ]; then
	shift
	build=
fi

outputDir="${1:-}"; shift || eusage 'missing output-dir'
timestamp="${1:-}"; shift || eusage 'missing timestamp'

mkdir -p "$outputDir"
outputDir="$(readlink -f "$outputDir")"

dockerImage='tianon/docker-deboot'
[ -z "$build" ] || docker build -t "$dockerImage" -f "$thisDir/Dockerfile.builder" "$thisDir"

dpkgArch="$(docker run --rm "$dockerImage" dpkg --print-architecture)"
echo
echo "-- BUILDING TARBALLS FOR '$dpkgArch' --"
echo

for suite in "${suites[@]}"; do
	if ! wget --quiet --spider "http://security.debian.org/dists/$suite/updates/main/binary-$dpkgArch/Packages.gz"; then
		echo >&2
		echo >&2 "warning: '$suite' not (security) supported on '$dpkgArch'; skipping"
{'fraction_non_alphanumeric': 0.18885702580909464, 'fraction_numerical': 0.020483408439164276, 'mean_word_length': 4.308695652173913, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5950793', 'n_tokens_mistral': 987, 'n_tokens_neox': 914, 'n_words': 249}