]> piware.de Git - bin.git/blobdiff - mockspec
build-debian-toolbox: Avoid deb.debian.org
[bin.git] / mockspec
index 7334f2d5eac6d435f0c7545bfb909bb5d780c8d4..6f32dbca09afe7773d17a49d06a208fc1baab45e 100755 (executable)
--- 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 -r $OS --init
 specfile="$1"
 shift
-mock --offline -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; p}' "$specfile") $@
+mock -r $OS -i $(sed -n '/^BuildRequires:/ {s/^.*: //; s/>=.*$//; s/%{.*}//; p}' "$specfile") $@