[PATCHv3,9/9] scripts/common_pkg_build: don't create pkg's if no repo

Message ID 1447191136-21213-10-git-send-email-anders.roxell@linaro.org
State New
Headers show

Commit Message

Anders Roxell Nov. 10, 2015, 9:32 p.m.
We shouldn't support building packages from a tarball.

Suggested-by: Fathi Boudra <fathi.boudra@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 scripts/common_pkg_build.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch

diff --git a/scripts/common_pkg_build.sh b/scripts/common_pkg_build.sh
index cf4f6e3..eefc07d 100644
--- a/scripts/common_pkg_build.sh
+++ b/scripts/common_pkg_build.sh
@@ -10,7 +10,13 @@  prepare_tarball() {
 	./configure
 	make dist
 
-	version=$(cat ${ROOT_DIR}/.scmversion)
+	if [[ -d ${ROOT_DIR}/.git ]]; then
+		version=$(cat ${ROOT_DIR}/.scmversion)
+	else
+		echo "This script isn't expected to be used without"
+		echo "a git repository."
+		exit 1
+	fi
 
 	cp ${package}-${version}.tar.gz ${package}_${version}.orig.tar.gz
 	tar xzf ${package}_${version}.orig.tar.gz