This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository buildscripts. from 5784e37 bin/build-rpm-package: use RPM_WANT_EXTRA_REPOS when calling get_extra_repository(). new 0bfe67f bin/build-rpm-package: respect WANT_EXTRA parameter in get_extra_repository() for OBS builds. new 21d86e0 bin/build-rpm-package: rewrite the mock part of get_extra_repository() to use create_mock_config(). new 4ba5111 bin/build-rpm-package: move ${TEMP_BASE} into "global scope" to have it always defined. new 3ce70e8 bin/build-rpm-package: comment changes only. Typo fix. new e62636d bin/build-rpm-package: cleanup cleanup(). new a5e6b76 bin/build-rpm-package: add ERR trap handler. This script is executed with set -e and cleanup not used if any command errors otherwise. new d8cea8f bin/build-rpm-package: ignore errors when removing temporary mock config files in cleanup(). The 7 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 | 123 ++++++++++++++++++++++--------------------------- 1 file changed, 55 insertions(+), 68 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 21d86e0dc83df93a30d132a86428c83787f8ef89 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 09:55:52 2015 +0200 bin/build-rpm-package: rewrite the mock part of get_extra_repository() to use create_mock_config(). --- bin/build-rpm-package | 58 ++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 5c0f8f9..8be91e7 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -424,45 +424,33 @@ get_extra_repository () { "redhat") # Always use -r. ret="-r " - if [ -n "${RPM_MOCK_CONFIG_DIR}" ]; then - # FIXME: these files should probably be autogenerated to lessen maintenance load. - - # Itsy-bitsy problem here: mock versions prior to 1.2.0 are buggy in the sense that - # they *always* prepend /etc/mock/ and append .cfg to any chroot file specified - # via -r, even if the argument is an absolute path. - # We have to work around that by specifying ../..//PATH/TO/MOCK-CONFIG and leaving - # out the ".cfg" part. - # Find out if we're using a buggy version. - check_mock_version_atleast "1" "2" "0" && typeset MOCK_BUGGY="0" || typeset MOCK_BUGGY="1" - - [ "${MOCK_BUGGY}" -eq "1" ] && ret="${ret}../../" - - # Add config base dir if specified. - ret="${ret}${RPM_MOCK_CONFIG_DIR}/" - - # Mock config file names shall follow the format: - # distname-distversion-arch[-component-extra_repo_base_name[-extra_repo_full_name]] - # ^------ mandatory ------^^---------------------- optional ----------------------^ - # ^------- default -------^ ^--- for extras ---^^--- for everything ---^ - - # Add mandatory, default value. - ret="${ret}${DIST}-${CODENAME}-${ARCH}" - if [ -n "${RPM_EXTRA_REPO_MOCK_CONFIG_BASE}" ]; then - ret="${ret}-${COMPONENT}-${RPM_EXTRA_REPO_MOCK_CONFIG_BASE}" - - if [ -n "${RPM_EXTRA_REPO_MOCK_CONFIG_FULL_NAME}" ] && [ -z "${PACKAGE_WITHOUT_OTHERMIRROR}" ] || \ - [ "${PACKAGE_WITHOUT_OTHERMIRROR}" != "${PACKAGE}" ]; then - ret="${ret}-${RPM_EXTRA_REPO_MOCK_CONFIG_FULL_NAME}" - fi + + # Itsy-bitsy problem here: mock versions prior to 1.2.0 are buggy in the sense that + # they *always* prepend /etc/mock/ and append .cfg to any chroot file specified + # via -r, even if the argument is an absolute path. + # We have to work around that by specifying ../..//PATH/TO/MOCK-CONFIG and leaving + # out the ".cfg" part. + # Find out if we're using a buggy version. + check_mock_version_atleast "1" "2" "0" && typeset MOCK_BUGGY="0" || typeset MOCK_BUGGY="1" + + [ "${MOCK_BUGGY}" -eq "1" ] && ret="${ret}../../" + + if [ "${WANT_EXTRA}" -eq "1" ]; then + typeset WANT="base" + if [ -z "${PACKAGE_WITHOUT_OTHERMIRROR}" ] || [ "${PACKAGE_WITHOUT_OTHERMIRROR}" != "${PACKAGE}" ]; then + WANT="full" fi - # Add .cfg extension. - [ "${MOCK_BUGGY}" -eq "0" ] && ret="${ret}.cfg" + typeset GEN_CONFIG="$(create_mock_config "${DIST}-${CODENAME}-${ARCH}" "${COMPONENT}" "${WANT}")" + + # Remove the .cfg extension again... and maybe add it back later. + ret="${ret}${GEN_CONFIG%.cfg}" else - # As the default directory /etc/mock is non-writable, assume we don't have - # special mock configs. - ret="${ret}${DIST}-${CODENAME}-${ARCH}" + ret="${ret}${RPM_MOCK_CONFIG_DIR}/${DIST}-${CODENAME}-${ARCH}" fi + + # Add .cfg extension. + [ "${MOCK_BUGGY}" -eq "0" ] && ret="${ret}.cfg" ;; *) echo "Error: unknown type passed to ${FUNCNAME}()" >&2 -- 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 0bfe67fb6cc6e5c5c89ce6c10e087a21ecf0eae8 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 09:49:39 2015 +0200 bin/build-rpm-package: respect WANT_EXTRA parameter in get_extra_repository() for OBS builds. --- bin/build-rpm-package | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index f0ffdcd..5c0f8f9 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -409,13 +409,16 @@ get_extra_repository () { typeset WANT_EXTRA="$(make_boolean "${7}")" typeset ret="" - # Note: we always add the extras repo, because that's defined as "packages missing from the main repository". + # Note: we always add the extras repo, because that's defined as "packages missing from the main repository", + # unless explicitly overridden via ${WANT_EXTRA}. case "${TYPE}" in "suse") # FIXME: make this package repository consistent with our main ones. - ret="--repo http://${REPOS_SERVER}/${DIST}/${CODENAME}/extras" - if [ -z "${PACKAGE_WITHOUT_OTHERMIRROR}" ] || [ "${PACKAGE_WITHOUT_OTHERMIRROR}" != "${PACKAGE}" ]; then - ret="${ret} --repo http://${REPOS_SERVER}/${DIST}/${CODENAME}/${COMPONENT}/${ARCH}" + if [ "${WANT_EXTRA}" -eq "1" ]; then + ret="--repo http://${REPOS_SERVER}/${DIST}/${CODENAME}/extras" + if [ -z "${PACKAGE_WITHOUT_OTHERMIRROR}" ] || [ "${PACKAGE_WITHOUT_OTHERMIRROR}" != "${PACKAGE}" ]; then + ret="${ret} --repo http://${REPOS_SERVER}/${DIST}/${CODENAME}/${COMPONENT}/${ARCH}" + fi fi ;; "redhat") -- 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 3ce70e8edd112a68ac000beb420470e592c82aad Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 10:14:33 2015 +0200 bin/build-rpm-package: comment changes only. Typo fix. --- bin/build-rpm-package | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index e17cd9d..11c7075 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -57,11 +57,11 @@ 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. +# These parts are not user-serviceable. TMP_MOCK_CFG_DIR="" TMP_MOCK_CFG_FILE="" TEMP_BASE="${HOME}/tmp/" -# End of non-user-servicable part. +# End of non-user-serviceable part. set -ex -- 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 4ba5111b7ef34e107b0b20656b33e071bf27a6a6 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 10:13:52 2015 +0200 bin/build-rpm-package: move ${TEMP_BASE} into "global scope" to have it always defined. --- bin/build-rpm-package | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 8be91e7..e17cd9d 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -60,6 +60,7 @@ RPM_BUILD_FOR=${RPM_BUILD_FOR:-"fedora:$FEDORA_DISTROS epel:$EPEL_DISTROSi opens # These parts are not user-servicable. TMP_MOCK_CFG_DIR="" TMP_MOCK_CFG_FILE="" +TEMP_BASE="${HOME}/tmp/" # End of non-user-servicable part. set -ex @@ -123,9 +124,8 @@ function make_boolean () { } set_vars() { - TEMP_BASE="$HOME/tmp/" - mkdir -p "$TEMP_BASE" - chmod 2770 "$TEMP_BASE" + mkdir -p "${TEMP_BASE}" + chmod 2770 "${TEMP_BASE}" # first argv is the name of the Git project PROJECT_PATH="$1" @@ -163,7 +163,6 @@ set_vars() { LOCK_FILE=$PROJECT_DIR/../.$PROJECT.lock # creating paths - mkdir -p "$TEMP_BASE" mkdir -p "$PROJECT_DIR" mkdir -p "$PKGDIST" -- 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 e62636dfeaf85c0bc36ca596619ac5ab3c57637b Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 10:15:02 2015 +0200 bin/build-rpm-package: cleanup cleanup(). --- bin/build-rpm-package | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 11c7075..13fde20 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -69,25 +69,23 @@ set -ex # 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 + if [ -n "${TMP_MOCK_CFG_DIR}" ] && [ -e "${TMP_MOCK_CFG_DIR}" ]; then + case "${TMP_MOCK_CFG_DIR}" in + ("${TEMP_BASE}"*) break ;; + (*) echo "Warning: mock temporary config directory is not matching the temporary file base dir ${TEMP_BASE}. Not doing cleanup." >&2 + exit -1 + ;; + esac + + # Take care of the config file(s) first. + typeset file="" + for file in "${TMP_MOCK_CFG_DIR}/"*; do + if [ ! -f "${file}" ]; then + echo "Warning: mock temporary config file ${file} is not a regular file. Not unlinking." >&2 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 + rm "${TMP_MOCK_CFG_DIR}/*" fi - else - echo "Warning: mock temporary config directory set as ${TMP_MOCK_CFG_DIR}, but mock temporary config file unknown." >&2 - fi + done # And only later of the directory itself. if [ -e "${TMP_MOCK_CFG_DIR}" ]; then @@ -99,12 +97,10 @@ cleanup () { else echo "Warning: mock temporary config directory ${TMP_MOCK_CFG_DIR} does not exist." >&2 fi + elif [ -n "${TMP_MOCK_CFG_DIR}" ]; then + echo "Warning: mock temporary config directory ${TMP_MOCK_CFG_DIR} defined but does not exist. Skipping cleanup." >&2 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 + echo "Warning: mock temporary config directory not defined. Skipping cleanup." >&2 fi } -- 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 a5e6b7679e970cf540567ee50605ea74b68e5388 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 10:15:14 2015 +0200 bin/build-rpm-package: add ERR trap handler. This script is executed with set -e and cleanup not used if any command errors otherwise. --- bin/build-rpm-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 13fde20..a034ce1 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -105,7 +105,7 @@ cleanup () { } # Run cleanup() automatically. -trap cleanup EXIT SIGTERM SIGINT SIGHUP SIGPIPE SIGALRM SIGUSR1 SIGUSR2 +trap cleanup ERR EXIT SIGTERM SIGINT SIGHUP SIGPIPE SIGALRM SIGUSR1 SIGUSR2 # FIXME: this should really be in a common.(sh) file! function make_boolean () { -- 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 d8cea8feb90874620bbaff598c6c8d844f803938 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 10:17:10 2015 +0200 bin/build-rpm-package: ignore errors when removing temporary mock config files in cleanup(). --- bin/build-rpm-package | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index a034ce1..be686c9 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -83,7 +83,8 @@ cleanup () { if [ ! -f "${file}" ]; then echo "Warning: mock temporary config file ${file} is not a regular file. Not unlinking." >&2 else - rm "${TMP_MOCK_CFG_DIR}/*" + # Remove and ignore errors. + rm "${TMP_MOCK_CFG_DIR}/${file}" || : fi done -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git