#!/bin/sh -eu

# Some helper functions for displaying stuff
COMMAND_STYLE="$(tput bold)$(tput setaf 4)"
NORMAL_STYLE="$(tput sgr0)"
run() {
    echo "${COMMAND_STYLE}\$ $@${NORMAL_STYLE}"
    "$@"
    echo
}

# Let's work in a temporary directory and clean up at the then
trap 'run rm -rf "$TEMPDIR"' EXIT
TEMPDIR="$(mktemp -d)"
cd "$TEMPDIR"

# The main thing now
run git clone https://salsa.debian.org/Debian/xe.git
run cd xe
run sed -i 's,git\.vuxu\.org/xe/,nicolas.braud-santoni.eu/tmp/xe.bare/,' debian/watch
run cat debian/watch
run uscan --force-download -v
