From 85c1d571aa7b969d40cef0c57ef82e492bfa36b5 Mon Sep 17 00:00:00 2001
From: Tomas Krizek <tomas.krizek@nic.cz>
Date: Thu, 27 Jun 2019 09:58:11 +0200
Subject: [PATCH] scripts/obs-build.sh: support build for different repos

---
 scripts/obs-build.sh     | 24 ++++++++++++++++++++++++
 scripts/obs-testbuild.sh | 40 ----------------------------------------
 2 files changed, 24 insertions(+), 40 deletions(-)
 create mode 100755 scripts/obs-build.sh
 delete mode 100755 scripts/obs-testbuild.sh

diff --git a/scripts/obs-build.sh b/scripts/obs-build.sh
new file mode 100755
index 0000000000..c33594a3f6
--- /dev/null
+++ b/scripts/obs-build.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Builds the checked out version in OBS repository
+
+set -o errexit -o nounset -o xtrace
+
+obs_repo=$1
+
+# Clean working tree
+if [[ $(git status --porcelain | wc -l) -ne 0 ]]; then
+    echo "working tree dirty: git clean -dfx && git reset --hard"
+    exit 1
+fi
+
+# Create tarball
+autoreconf -if
+./configure
+make distcheck AM_DISTCHECK_CONFIGURE_FLAGS="--disable-fastparser"
+
+# Submit to OBS
+scripts/make-distrofiles.sh -s
+scripts/build-in-obs.sh $obs_repo
+
+echo "Check results at https://build.opensuse.org/package/show/home:CZ-NIC:$obs_repo/knot"
diff --git a/scripts/obs-testbuild.sh b/scripts/obs-testbuild.sh
deleted file mode 100755
index c3fa604315..0000000000
--- a/scripts/obs-testbuild.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-#
-# Builds the checked out version in knot-dns-testing OBS repository
-
-set -o errexit -o nounset -o xtrace
-
-force=false
-
-# Read options
-while getopts "f" o; do
-    case "${o}" in
-        f)
-            force=true
-            ;;
-        *)
-            ;;
-    esac
-done
-shift $((OPTIND-1))
-
-# Clean working tree
-if [[ $(git status --porcelain | wc -l) -ne 0 ]]; then
-    if [ "$force" = false ]; then
-        echo "working tree dirty. force clean with '-f'"
-        exit 1
-    fi
-    git clean -dfx
-    git reset --hard
-fi
-
-# Create tarball
-autoreconf -if
-./configure
-make distcheck AM_DISTCHECK_CONFIGURE_FLAGS="--disable-fastparser"
-
-# Submit to OBS
-scripts/make-distrofiles.sh -s
-scripts/build-in-obs.sh knot-dns-testing
-
-echo "Check results at https://build.opensuse.org/package/show/home:CZ-NIC:knot-dns-testing/knot"
-- 
GitLab