M tests/container/Containerfile +1 -0
@@ 2,6 2,7 @@ FROM fedora
RUN yum install \
-y --setopt=install_weak_deps=False \
+ git \
mercurial \
python-pip \
python-pip-wheel \
M tests/container/build.sh +32 -10
@@ 1,23 1,45 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
python=python3
-url="https://hg.sr.ht/~phlogistonjohn/sambacc"
-
-mkdir -p /var/tmp/build/
+url="https://github.com/phlogistonjohn/sambacc"
bdir="/var/tmp/build/sambacc"
-if [ -d "$bdir" ] && hg --cwd "$bdir" log -r. ; then
+checked_out() {
+ local d="$1"
+ # allow manual clones with either git or hg
+ [[ -d "$d" && ( -d "$d/.git" || -d "$d/.hg" ) ]]
+}
+
+clone() {
+ # if the script is doing the cloning we default to git
+ # as obnoxxx has peer-pressured me into it
+ git clone "$1" "$2"
+}
+
+update() {
+ local d="$1"
+ local node="$2"
+ if [[ -d "$d/.hg" ]]; then
+ hg update --check "${node}"
+ else
+ git checkout "${node}"
+ fi
+}
+
+mkdir -p /var/tmp/build/ || true
+if checked_out "${bdir}" ; then
echo "repo already checked out"
else
- hg clone "$url" "$bdir"
+ clone "$url" "${bdir}"
fi
-set -e
-cd "$bdir"
+cd "${bdir}"
if [ "$1" ]; then
- # a revision id was specified on the cli
- hg update --check "$1"
+ # a tag or revision id was specified on the cli
+ update "${bdir}" "$1"
fi
# Allow the tests to use customized passwd file contents in order