This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository buildscripts. from 47938e2 bin/build-rpm-package: also pass through the line when detecting the start of yum config file. new cff96a2 bin/build-rpm-package: do not use create_mock_config() in a subshell. It needs to edit variables in global scope. new 0b2027f bin/build-rpm-package: make get_extra_repository() edit OTHERMIRROR or MOCK_CHROOT_CONFIG directly. Do not call it in a subshell. It needs to modify global variables. The 2 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 | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 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 0b2027f09ccba69f6aa12d57cd19495c4e2d677b Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 11:32:47 2015 +0200 bin/build-rpm-package: make get_extra_repository() edit OTHERMIRROR or MOCK_CHROOT_CONFIG directly. Do not call it in a subshell. It needs to modify global variables. --- bin/build-rpm-package | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index b439522..a5bc52b 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -401,7 +401,9 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET # the build component (X2Go release group), the package, the architecture # and an optional boolean value that determines whether to add any additional # repositories at all. -# Returns a string that can be passed to obs-build or mock. +# +# Edits either OTHERMIRROR for type == suse or MOCK_CHROOT_CONFIG for type == redhat. +# It is an error to execute this function in a subshell, as it MUST edit global variables. get_extra_repository () { typeset TYPE="${1:?"Error: no type passed to ${FUNCNAME}()."}" typeset DIST="${2:?"Error: no distribution passed to ${FUNCNAME}()."}" @@ -411,22 +413,22 @@ get_extra_repository () { typeset ARCH="${6:?"Error: no architecture passed to ${FUNCNAME}()."}" 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", # unless explicitly overridden via ${WANT_EXTRA}. case "${TYPE}" in "suse") # FIXME: make this package repository consistent with our main ones. + OTHERMIRROR="" if [ "${WANT_EXTRA}" -eq "1" ]; then - ret="--repo http://${REPOS_SERVER}/${DIST}/${CODENAME}/extras" + OTHERMIRROR="--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}" + OTHERMIRROR="${OTHERMIRROR} --repo http://${REPOS_SERVER}/${DIST}/${CODENAME}/${COMPONENT}/${ARCH}" fi fi ;; "redhat") # Always use -r. - ret="-r " + MOCK_CHROOT_CONFIG="-r " # 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 @@ -436,7 +438,7 @@ get_extra_repository () { # 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}../../" + [ "${MOCK_BUGGY}" -eq "1" ] && MOCK_CHROOT_CONFIG="${MOCK_CHROOT_CONFIG}../../" if [ "${WANT_EXTRA}" -eq "1" ]; then typeset WANT="base" @@ -447,14 +449,14 @@ get_extra_repository () { create_mock_config "${DIST}-${CODENAME}-${ARCH}" "${COMPONENT}" "${WANT}" # Remove the .cfg extension again... and maybe add it back later. - ret="${ret}${TMP_MOCK_CFG_FILE%.cfg}" + MOCK_CHROOT_CONFIG="${MOCK_CHROOT_CONFIG}${TMP_MOCK_CFG_FILE%.cfg}" else - ret="${ret}${RPM_MOCK_CONFIG_DIR}/${DIST}-${CODENAME}-${ARCH}" + MOCK_CHROOT_CONFIG="${MOCK_CHROOT_CONFIG}${RPM_MOCK_CONFIG_DIR}/${DIST}-${CODENAME}-${ARCH}" fi # Add .cfg extension. - [ "${MOCK_BUGGY}" -eq "0" ] && ret="${ret}.cfg" + [ "${MOCK_BUGGY}" -eq "0" ] && MOCK_CHROOT_CONFIG="${MOCK_CHROOT_CONFIG}.cfg" ;; *) echo "Error: unknown type passed to ${FUNCNAME}()" >&2 @@ -462,8 +464,6 @@ get_extra_repository () { exit -1 ;; esac - - echo "${ret}" } prepare_workspace() { @@ -590,7 +590,7 @@ build_packages() { rm -f $PKGDIST/$l_DIST/$l_CODENAME/x86_64/build.log # Obtain packages from our RPM repository. - MOCK_CHROOT_CONFIG="$(get_extra_repository "redhat" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "x86_64" "${RPM_WANT_EXTRA_REPOS}")" + get_extra_repository "redhat" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "x86_64" "${RPM_WANT_EXTRA_REPOS}" if mock --buildsrpm \ ${MOCK_CHROOT_CONFIG} \ --resultdir="$PKGDIST/$l_DIST/$l_CODENAME/rpmbuild/SRPMS" \ @@ -630,7 +630,7 @@ build_packages() { done # Obtain packages from our RPM repository. - OTHERMIRROR="$(get_extra_repository "suse" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "x86_64" "${RPM_WANT_EXTRA_REPOS}")" + get_extra_repository "suse" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "x86_64" "${RPM_WANT_EXTRA_REPOS}" if sudo obs-build \ --nosignature \ ${OTHERMIRROR} \ @@ -661,7 +661,7 @@ build_packages() { done # Obtain packages from our RPM repository. - MOCK_CHROOT_CONFIG="$(get_extra_repository "redhat" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "x86_64" "${RPM_WANT_EXTRA_REPOS}")" + get_extra_repository "redhat" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "x86_64" "${RPM_WANT_EXTRA_REPOS}" ls $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE.$IS_RELEASE.git$DATE.$GITREV.$COMPONENT.*.src.rpm | while read srpm; do if mock ${MOCK_CHROOT_CONFIG} --resultdir="$PKGDIST/$l_DIST/$l_CODENAME/x86_64" "$srpm"; then # copy and later sign source RPM @@ -707,7 +707,7 @@ build_packages() { done # Obtain packages from our RPM repository. - OTHERMIRROR="$(get_extra_repository "suse" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "i386" "${RPM_WANT_EXTRA_REPOS}")" + get_extra_repository "suse" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "i386" "${RPM_WANT_EXTRA_REPOS}" if linux32 sudo obs-build \ --nosignature \ ${OTHERMIRROR} \ @@ -741,7 +741,7 @@ build_packages() { rm -f $PKGDIST/$l_DIST/$l_CODENAME/i386/build.log # Obtain packages from our RPM repository. - MOCK_CHROOT_CONFIG="$(get_extra_repository "redhat" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "i386" "${RPM_WANT_EXTRA_REPOS}")" + get_extra_repository "redhat" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "i386" "${RPM_WANT_EXTRA_REPOS}" ls $PKGDIST/$l_DIST/$l_CODENAME/$l_ARCH/rpmbuild/SRPMS/$PROJECT-$UPSTREAM_VERSION-$PKG_SRCRELEASE.$IS_RELEASE.git$DATE.$GITREV.$COMPONENT.*.src.rpm | while read srpm; do if nice mock ${MOCK_CHROOT_CONFIG} --resultdir="$PKGDIST/$l_DIST/$l_CODENAME/i386" "$srpm"; then # only copy and sign source RPM if necessary -- 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 cff96a2a5ce261e8937fcdd3b73ad9c4cbee8a0a Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 1 11:11:13 2015 +0200 bin/build-rpm-package: do not use create_mock_config() in a subshell. It needs to edit variables in global scope. --- bin/build-rpm-package | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 94eaa61..b439522 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -247,14 +247,14 @@ repeat_str () { # INPUT COUNT # /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. +# +# Calling this function in a subshell is an error, as it NEEDS to modify +# variables in global scope! create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET typeset MOCK_BASE="${1:?"Error: no mock base config passed to ${FUNCNAME}()."}" typeset COMPONENT="${2:?"Error: no component (X2Go release group) passed to ${FUNCNAME}()."}" typeset TARGET="${3:?"Error: no target (full or base) passed to ${FUNCNAME}()."}" - typeset ret="" - # Check argument sanity. typeset DISTRO="" @@ -393,9 +393,6 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET # Reset input field separator to original value. IFS="${OLDIFS}" - - # Strictly speaking not necessary, but do it anyway. - printf "${TMP_MOCK_CFG_FILE}" } # Fetches extras repositories, if requested. @@ -447,10 +444,11 @@ get_extra_repository () { WANT="full" fi - typeset GEN_CONFIG="$(create_mock_config "${DIST}-${CODENAME}-${ARCH}" "${COMPONENT}" "${WANT}")" + create_mock_config "${DIST}-${CODENAME}-${ARCH}" "${COMPONENT}" "${WANT}" # Remove the .cfg extension again... and maybe add it back later. - ret="${ret}${GEN_CONFIG%.cfg}" + ret="${ret}${TMP_MOCK_CFG_FILE%.cfg}" + else ret="${ret}${RPM_MOCK_CONFIG_DIR}/${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