X-Git-Url: https://piware.de/gitweb/?p=bin.git;a=blobdiff_plain;f=mockspec;h=1a32eee9f5c7e11a27754f5fa153345365023db0;hp=1e1831b8870d2d9c98d9e50bc61563fa9e6d5301;hb=d2ffc770edd7a6050eaf46b9ce58e6745723930f;hpb=343e156dfb61ceefd01f9d2245d0421fa0622c2e 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") $@