[X2Go-Commits] [buildscripts] 02/03: bin/build-rpm-package: add the easy part of create_mock_config().
git-admin at x2go.org
git-admin at x2go.org
Wed Apr 1 05:01:21 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 3c9f2cb4c63388d66903c448fd4b6769787918b4
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed Apr 1 05:00:05 2015 +0200
bin/build-rpm-package: add the easy part of create_mock_config().
---
bin/build-rpm-package | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index ca88489..5b60fa5 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -182,6 +182,45 @@ repeat_str() { # INPUT COUNT
printf "${ret}"
}
+# Creates a custom mock config file given a base config (taken from
+# /etc/mock/), a custom repository file (also taken from /etc/mock/),
+# the build component and the target specification ("full" or "base").
+# Base refers to adding x2go-extras only, while full means also
+# adding the full X2Go upstream repository with all published files.
+# The created config file path is returned.
+create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET
+ typeset MOCK_BASE="${1:?"Error: no mock base config passed to ${FUNCNAME}()."}"
+ typeset CUSTOM_REPO="${2:?"Error: no mock custom repository file passed to ${FUNCNAME}()."}"
+ typeset COMPONENT="${3:?"Error: no component (X2Go release group) passed to ${FUNCNAME}()."}"
+ typeset TARGET="${4:?"Error: no target (full or base) passed to ${FUNCNAME}()."}"
+
+ typeset ret=""
+
+ # Check argument sanity.
+ typeset i=""
+ for i in MOCK_BASE CUSTOM_REPO; do
+ # Must be plain file.
+ grep -q -s "/" <<< "${!i}" && {
+ echo "Error: ${i} parameter must not be a path but a simple file name." >&2
+ exit -1
+ }
+
+ # Must exist.
+ if [ ! -f "/etc/mock/${!i}" ]; then
+ echo "Error: ${i} parameter must exist and be a regular file." >&2
+ exit -1
+ fi
+ done
+
+ # Note: there is no way to check for the component's validity,
+ # as LTS releases have "random" names assigned to them.
+
+ if [ "${TARGET}" != "base" ] && [ "${TARGET}" != "full" ]; then
+ echo "Error: TARGET parameter must be either full or base." >&2
+ exit -1
+ fi
+}
+
get_extra_repository () {
typeset TYPE="${1:?"Error: no type passed to ${FUNCNAME}()."}"
typeset DIST="${2:?"Error: no distribution passed to ${FUNCNAME}()."}"
--
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