#!/bin/bash

set -e
set -o pipefail

extrepo enable debian_official 2>&1

if [ ! -f /etc/apt/sources.list.d/extrepo_debian_official.sources ]
then
	echo "enable failed"
	exit 1
fi

extrepo update --offlinedata --mirror http://ftp.fr.debian.org/debian debian_official
if ! grep -q -E "^Uris: http://ftp.fr.debian.org/debian" /etc/apt/sources.list.d/extrepo_debian_official.sources ; then
	echo "update failed"
	exit 1
fi
