From: Martin Pitt Date: Fri, 26 Oct 2018 07:05:25 +0000 (+0200) Subject: mockspec: Allow changing chroot with $OS X-Git-Url: https://piware.de/gitweb/?p=bin.git;a=commitdiff_plain;h=d2ffc770edd7a6050eaf46b9ce58e6745723930f;hp=343e156dfb61ceefd01f9d2245d0421fa0622c2e mockspec: Allow changing chroot with $OS --- diff --git a/mockspec b/mockspec index 1e1831b..1a32eee 100755 --- a/mockspec +++ b/mockspec @@ -1,7 +1,8 @@ #!/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") $@