This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository buildscripts. from 7aa6ef6 bin/build-rpm-package: fix typos. new 0df0a2a bin/build-rpm-package: add mock version checking function. new 3f90efd bin/build-rpm-package: add period to error sentences. new 67e6711 bin/build-rpm-package: work around buggy mock versions. The 3 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 | 88 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 8 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 0df0a2ac4a5c0c34d6f28b60e33df3b7ab4160a5 Author: Mihai Moldovan <ionic@ionic.de> Date: Tue Mar 24 04:58:27 2015 +0100 bin/build-rpm-package: add mock version checking function. --- bin/build-rpm-package | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index b99acbe..ec77ae1 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -106,6 +106,68 @@ set_vars() { return 0 } +# Check that mock version is at least the given version number. +# Returns 0 if the mock version is greater or equal the specified input, +# 1 otherwise. +check_mock_version_atleast () { + MAJOR="${1:?"Error: no major version passed to ${FUNCNAME}()."}" + MINOR="${2:?"Error: no minor version passed to ${FUNCNAME}()."}" + PATCH="${3:?"Error: no patch version passed to ${FUNCNAME}()."}" + + # Check input parameters for sanity. + SANITY_CHECK_MAJOR="$(sed -e 's/^\([0-9][0-9]*\)$//' <<< "${MAJOR}")" + SANITY_CHECK_MINOR="$(sed -e 's/^\([0-9][0-9]*\)$//' <<< "${MINOR}")" + SANITY_CHECK_PATCH="$(sed -e 's/^\([0-9][0-9]*\)$//' <<< "${PATCH}")" + + if [ -n "${SANITY_CHECK_MAJOR}" ] || [ -n "${SANITY_CHECK_MINOR}" ] || [ -n "${SANITY_CHECK_PATCH}" ]; then + echo "Error: input parameters of ${FUNCNAME}() are not pure integers and failed sanity check." >&2 + exit -1 + fi + + MOCK_VER="$(mock --version)" + + # Sanitize ${MOCK_VER}: + # Only take the first line into account. + MOCK_VER="$(head -n 1 <<< "${MOCK_VER}")" + + # Only accept a string that has number.number.number somewhere. + MOCK_VER="$(grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' <<< "${MOCK_VER}")" + + if [ -n "${MOCK_VER}" ]; then + echo "Error: the reported mock version can not be handled by ${FUNCNAME}()." >&2 + exit -1 + fi + + # The reason for this weird [0-9][0-9]* construct is that POSIX BRE does only specify * + # as a special character. POSIX ERE supports + as a special character, but sed is + # specified by POSIX to only support BRE. GNU sed supports a \+ special character in + # POSIX BRE standard mode, but this is a GNU extension. + MOCK_VER_MAJOR="$(sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*/\1/' <<< "${MOCK_VER}")" + MOCK_VER_MINOR="$(sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/' <<< "${MOCK_VER}")" + MOCK_VER_PATCH="$(sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)/\1/' <<< "${MOCK_VER}")" + + if [ -z "${MOCK_VER_MAJOR}" ] || [ -z "${MOCK_VER_MINOR}" ] || [ -z "${MOCK_VER_PATCH}" ]; then + echo "Error: unable to parse mock version in ${FUNCNAME}()." >&2 + exit -1 + else + ret="1" + if [ "${MOCK_VER_MAJOR}" -gt "${MAJOR}" ]; then + ret="0" + elif [ "${MOCK_VER_MAJOR}" -eq "${MAJOR}" ]; then + if [ "${MOCK_VER_MINOR}" -gt "${MINOR}" ]; then + ret="0" + elif [ "${MOCK_VER_MINOR}" -eq "${MINOR}" ]; then + if [ "${MOCK_VER_PATCH}" -gt "${PATCH}" ] || \ + [ "${MOCK_VER_PATCH}" -eq "${PATCH}" ]; then + ret="0" + fi + fi + fi + + return "${ret}" + fi +} + get_extra_repository () { TYPE="${1:?"Error: no type passed to ${FUNCNAME}()."}" 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
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 3f90efdcc56b1d758c1636c29ec5846b5158f992 Author: Mihai Moldovan <ionic@ionic.de> Date: Tue Mar 24 04:58:47 2015 +0100 bin/build-rpm-package: add period to error sentences. --- bin/build-rpm-package | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index ec77ae1..979605e 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -170,11 +170,11 @@ check_mock_version_atleast () { get_extra_repository () { TYPE="${1:?"Error: no type passed to ${FUNCNAME}()."}" - DIST="${2:?"Error: no distribution passed to ${FUNCNAME}()"}" - CODENAME="${3:?"Error: no codename (distro 'version') passed to ${FUNCNAME}()"}" - COMPONENT="${4:?"Error: no component (X2Go release group) passed to ${FUNCNAME}()"}" - PACKAGE="${5:?"Error: no package passed to ${FUNCAME}()"}" - ARCH="${6:?"Error: no architecture passed to ${FUNCNAME}()"}" + DIST="${2:?"Error: no distribution passed to ${FUNCNAME}()."}" + CODENAME="${3:?"Error: no codename (distro 'version') passed to ${FUNCNAME}()."}" + COMPONENT="${4:?"Error: no component (X2Go release group) passed to ${FUNCNAME}()."}" + PACKAGE="${5:?"Error: no package passed to ${FUNCAME}()."}" + ARCH="${6:?"Error: no architecture passed to ${FUNCNAME}()."}" ret="" # Note: we always add the extras repo, because that's defined as "packages missing from the main 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 67e67118efe85bd7cb977a81615a0bf3bf9074e2 Author: Mihai Moldovan <ionic@ionic.de> Date: Tue Mar 24 05:11:42 2015 +0100 bin/build-rpm-package: work around buggy mock versions. --- bin/build-rpm-package | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 979605e..afc8f4e 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -187,10 +187,20 @@ get_extra_repository () { ;; "redhat") # Always use -r. - ret="-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" && MOCK_BUGGY="0" || MOCK_BUGGY="1" + + [ "${MOCK_BUGGY}" -eq "1" ] && ret="${ret}../../" + # Add config base dir if specified. ret="${ret} ${RPM_MOCK_CONFIG_DIR}/" @@ -211,11 +221,11 @@ get_extra_repository () { fi # Add .cfg extension. - ret="${ret}.cfg" + [ "${MOCK_BUGGY}" -eq "0" ] && ret="${ret}.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}${DIST}-${CODENAME}-${ARCH}" fi ;; *) -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git