#!/bin/sh
# start mock session with build deps from given .spec file
+OS="${OS:-default}"
set -eu
-[ -d "$(mock --print-root-path)" ] || mock --init
+[ -d "$(mock -r $OS --print-root-path)" ] || mock --init
specfile="$1"
shift
-mock -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; s/%{.*}//; p}' "$specfile") $@
+mock -r $OS -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; s/%{.*}//; p}' "$specfile") $@