[X2Go-Commits] [buildscripts] 04/06: bin/build-rpm-package: check MOCK_BASE parameter for validity via RegEx.
git-admin at x2go.org
git-admin at x2go.org
Wed Apr 1 07:34:41 CEST 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository buildscripts.
commit 014e71963a120da2082994b1af083d884f117bd8
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed Apr 1 07:23:13 2015 +0200
bin/build-rpm-package: check MOCK_BASE parameter for validity via RegEx.
Additionally, pull out the distro name. We will need it later on.
---
bin/build-rpm-package | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index 3f4dd27..2614d16 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -264,6 +264,16 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET
fi
done
+ typeset DISTRO=""
+ typeset TMP_REGEX="^([[:alpha:]]+)-[[:alnum:]]+-[[:alnum:]].cfg$"
+ # distribution - version - arch
+ if [[ ! "${MOCK_BASE}" =~ ${TMP_REGEX} ]]; then
+ echo "Error: MOCK_BASE parameter not well formed. Must be: 'distro-version-arch.cfg'." >&2
+ exit -1
+ else
+ DISTRO="${BASH_REMATCH[1]}"
+ fi
+
# Note: there is no way to check for the component's validity,
# as LTS releases have "random" names assigned to them.
--
Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
More information about the x2go-commits
mailing list