This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository buildscripts. from aceba1d bin/build-rpm-package: make repeat_str() actually terminate. new 4520489 bin/build-rpm-package: add cleanup() function and signal handlers. new a8fe13f bin/build-rpm-package: finally create the temporary dir and file. new 7a992b3 bin/build-rpm-package: base mock config base shall better be readable, OR ELSE! new 014e719 bin/build-rpm-package: check MOCK_BASE parameter for validity via RegEx. new ebc7f12 bin/build-rpm-package: rename main => release and heuler => nightly in create_mock_config(). This is what the x2go.repo files do and codenames are weird anyway... new a6bf0b9 bin/build-rpm-package: add some boilerplate code for reading in config files. The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: bin/build-rpm-package | 99 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 96 insertions(+), 3 deletions(-) -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 452048972380f27a28e47d44094140580895dd73 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 06:39:43 2015 +0200 bin/build-rpm-package: add cleanup() function and signal handlers. --- bin/build-rpm-package | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 67c451f..7be653e 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -56,8 +56,59 @@ NO_DELAY=${NO_DELAY:-"no"} FORCE_BUILD=${FORCE_BUILD:-"no"} RPM_BUILD_FOR=${RPM_BUILD_FOR:-"fedora:$FEDORA_DISTROS epel:$EPEL_DISTROSi opensuse:$OPENSUSE_DISTROS" sle:$SLE_DISTROS} +# These parts are not user-servicable. +TMP_MOCK_CFG_DIR="" +TMP_MOCK_CFG_FILE="" +# End of non-user-servicable part. + set -ex +# Cleans up temporary directories and files. +# RFC SHOULD be called by trap handlers. +cleanup () { + # We always assume the temporary mock config file is below the temporary config directory. + if [ -n "${TMP_MOCK_CFG_DIR}" ]; then + # Take care of the config file first. + if [ -n "${TMP_MOCK_CFG_FILE}" ]; then + if [ -e "${TMP_MOCK_CFG_FILE}" ]; then + # Explicit test after the general existence test so that we can + # print an error message if the file we're looking at is not a + # regular file. + # BEWARE OF RACE CONDITIONS, though. + if [ -f "${TMP_MOCK_CFG_FILE}" ]; then + rm "${TMP_MOCK_CFG_DIR}/${TMP_MOCK_CFG_FILE}" + else + echo "Warning: file '$(readlink -nf "${TMP_MOCK_CFG_DIR}/${TMP_MOCK_CFG_FILE}")' is not a regular file. Not unlinking." >&2 + fi + else + echo "Warning: mock temporary config directory set as ${TMP_MOCK_CFG_DIR}, but mock temporary config file ${TMP_MOCK_CFG_FILE} does not exist." >&2 + fi + else + echo "Warning: mock temporary config directory set as ${TMP_MOCK_CFG_DIR}, but mock temporary config file unknown." >&2 + fi + + # And only later of the directory itself. + if [ -e "${TMP_MOCK_CFG_DIR}" ]; then + if [ -d "${TMP_MOCK_CFG_DIR}" ]; then + rmdir "${TMP_MOCK_CFG_DIR}" || echo "Warning: unable to remove mock temporary config directory ${TMP_MOCK_CFG_DIR}. Is it non-empty?" >&2 + else + echo "Warning: mock temporary config directory ${TMP_MOCK_CFG_DIR} is not actually a directory. Not unlinking." >&2 + fi + else + echo "Warning: mock temporary config directory ${TMP_MOCK_CFG_DIR} does not exist." >&2 + fi + else + if [ -n "${TMP_MOCK_CFG_FILE}" ]; then + echo "Warning: mock temp not set, but temporary mock config file ${TMP_MOCK_CFG_FILE} set." >&2 + else + echo "Warning: did not find any mock temporary config directory or file set. Not removing anything." >&2 + fi + fi +} + +# Run cleanup() automatically. +trap cleanup EXIT SIGTERM SIGINT SIGHUP SIGPIPE SIGALRM SIGUSR1 SIGUSR2 + set_vars() { TEMP_BASE="$HOME/tmp/" mkdir -p "$TEMP_BASE" -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit a8fe13f19fd5631f7b9f8d7ffcf2fcfd85562464 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 06:44:56 2015 +0200 bin/build-rpm-package: finally create the temporary dir and file. --- bin/build-rpm-package | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 7be653e..de2e02d 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -271,6 +271,19 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET echo "Error: TARGET parameter must be either full or base." >&2 exit -1 fi + + # Create temporary directory for our soon-to-be temporary mock config file. + TMP_MOCK_CFG_DIR="$(mktemp -d --tmpdir="${TEMP_BASE}" "${RPM_EXTRA_REPO_MOCK_CONFIG_BASE_NAME}-mock-$(repeat_str "X" "24")")" + if [ "$?" -ne "0" ]; then + echo "Error: creating mock temporary config directory failed. Aborting." >&2 + exit -1 + fi + + TMP_MOCK_CFG_FILE="$(mktemp --tmpdir="${TEMP_BASE}" "$(basename "${TMP_MOCK_CFG_DIR}")/${MOCK_BASE}-${RPM_EXTRA_REPO_MOCK_CONFIG_BASE_NAME}-${COMPONENT}-${TARGET}.$(repeat_str "X" "24").cfg")" + if [ "$?" -ne "0" ]; then + echo "Error: creating mock temporary config file failed. Aborting." >&2 + exit -1 + fi } get_extra_repository () { -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 7a992b32bef068f119ceeb09aaf1a8b81d5dfef2 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 07:22:30 2015 +0200 bin/build-rpm-package: base mock config base shall better be readable, OR ELSE! --- bin/build-rpm-package | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index de2e02d..3f4dd27 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -257,9 +257,9 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET exit -1 } - # Must exist. - if [ ! -f "/etc/mock/${!i}" ]; then - echo "Error: ${i} parameter must exist and be a regular file." >&2 + # Must exist and be readable. + if [ ! -f "/etc/mock/${!i}" ] || [ ! -r "/etc/mock/${!i}" ]; then + echo "Error: ${i} parameter must exist, be a regular file and readable." >&2 exit -1 fi done -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
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@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
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit ebc7f12b4bc844a4de4818fe2e6fca206544e04f Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 07:32:09 2015 +0200 bin/build-rpm-package: rename main => release and heuler => nightly in create_mock_config(). This is what the x2go.repo files do and codenames are weird anyway... --- bin/build-rpm-package | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 2614d16..10fc0fb 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -274,6 +274,13 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET DISTRO="${BASH_REMATCH[1]}" fi + # Rename "main" to "release" and "heuler" to "nightly". + if [ "${COMPONENT}" = "main" ]; then + COMPONENT="release" + elif [ "${COMPONENT}" = "heuler" ]; then + COMPONENT="nightly" + 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
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit a6bf0b9a5b83187e8ecb2b0d824e6c8997f7f0a5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 07:34:13 2015 +0200 bin/build-rpm-package: add some boilerplate code for reading in config files. --- bin/build-rpm-package | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 10fc0fb..f088bb9 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -301,6 +301,18 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET echo "Error: creating mock temporary config file failed. Aborting." >&2 exit -1 fi + + # Fetch the requested lines from ${CUSTOM_REPO} and store them in an array. + typeset -a extra_repo + typeset -i FETCH_SECTION=0 + while read line; do + + done < "/etc/mock/${CUSTOM_REPO}" + + typeset -i REPO_START=0 + while read line; do + + done < "/etc/mock/${MOCK_BASE}" } get_extra_repository () { -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git