This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository buildscripts. from 5988968 home/.buildscripts/x2go.conf: use more quotes and curly braces. new 21f2262 bin/build-rpm-package: fix find calls. Use weird read -r -d '' trick to parse 0-delimited pseudo-arrays. The 1 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 | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 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 21f2262912ad73a48f8325eed32fb8622c05373b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 3 03:49:25 2015 +0200 bin/build-rpm-package: fix find calls. Use weird read -r -d '' trick to parse 0-delimited pseudo-arrays. --- bin/build-rpm-package | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 4b8ccbf..c8158ce 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -704,13 +704,19 @@ build_packages() { --clean \ "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/rpmbuild/SOURCES/${PROJECT}.spec"; then mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/x86_64/" - find "/var/cache/obs-build/${l_DIST}/${l_CODENAME}/x86_64/${BUILD_RESULT}/RPMS/" -type f | grep -E '.*\.rpm$' | grep -Ev '.*\.src\.rpm$' | while read rpmfile; do + + # -r parameter to read: Backslashes may NOT escape any characters! + # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed + # by a NUL character, the delimiter is set to this very NUL (\000) character. + find "/var/cache/obs-build/${l_DIST}/${l_CODENAME}/x86_64/${BUILD_RESULT}/RPMS/" -type f \( -iname '*.rpm' -and -not -iname '*.src.rpm' \) -print0 | while read -r -d '' rpmfile; do cp "${rpmfile}" "${PKGDIST}/${l_DIST}/${l_CODENAME}/x86_64/" done rpmsign-unattended -D "%_gpg_name debian@x2go.org" --addsign "${PKGDIST}/${l_DIST}/${l_CODENAME}/x86_64/"*.rpm # also copy and sign source RPM's - find "/var/cache/obs-build/${l_DIST}/${l_CODENAME}/x86_64/${BUILD_RESULT}/SRPMS/" -type f | grep -E '.*\.rpm$' | while read rpmfile; do + # For information on why this weird -print0 | read -r -d '' construction works, + # refer to the first instance of this in this script. + find "/var/cache/obs-build/${l_DIST}/${l_CODENAME}/x86_64/${BUILD_RESULT}/SRPMS/" -type f -iname '*.rpm' -print0 | while read -r -d '' rpmfile; do cp "${rpmfile}" "$PKGDIST/${l_DIST}/${l_CODENAME}/SRPM/" done rpmsign-unattended -D "%_gpg_name debian@x2go.org" --addsign "${PKGDIST}/${l_DIST}/${l_CODENAME}/SRPM/"*.rpm @@ -726,7 +732,10 @@ build_packages() { # Obtain packages from our RPM repository. get_extra_repository "redhat" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "x86_64" "${RPM_WANT_EXTRA_REPOS}" - find "${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 + + # For information on why this weird -print0 | read -r -d '' construction works, + # refer to the first instance of this in this script. + find "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/rpmbuild/SRPMS/" -type 'f' -iname "${PROJECT}-${UPSTREAM_VERSION}-${PKG_SRCRELEASE}.${IS_RELEASE}.git${DATE}.${GITREV}.${COMPONENT}.*.src.rpm" -print0 | while read -r -d '' srpm; do if mock ${MOCK_CHROOT_CONFIG} --resultdir="${PKGDIST}/${l_DIST}/${l_CODENAME}/x86_64" "${srpm}"; then # copy and later sign source RPM cp "${srpm}" "${PKGDIST}/${l_DIST}/${l_CODENAME}/SRPM/" @@ -779,15 +788,20 @@ build_packages() { --clean \ "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/rpmbuild/SOURCES/${PROJECT}.spec"; then mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/i386/" - find "/var/cache/obs-build/${l_DIST}/${l_CODENAME}/i386/${BUILD_RESULT}/RPMS/" -type f | grep -E '.*\.rpm$' | grep -Ev '.*\.src\.rpm$' | while read rpmfile; do + + # For information on why this weird -print0 | read -r -d '' construction works, + # refer to the first instance of this in this script. + find "/var/cache/obs-build/${l_DIST}/${l_CODENAME}/i386/${BUILD_RESULT}/RPMS/" -type 'f' \( -iname '*.rpm' -and -not -iname '*.src.rpm' \) -print0 | while read -r -d '' rpmfile; do cp "${rpmfile}" "${PKGDIST}/${l_DIST}/${l_CODENAME}/i386/" done rpmsign-unattended -D "%_gpg_name debian@x2go.org" --addsign "${PKGDIST}/${l_DIST}/${l_CODENAME}/i386/"*.rpm # copy and later sign source RPM's, if needed (that is, not already generated by x86_64/noarch code above) - SEARCH_SRPM="$(find "${PKGDIST}/${l_DIST}/${l_CODENAME}/SRPM" -type 'f' -name "*.src.rpm" -print)" + SEARCH_SRPM="$(find "${PKGDIST}/${l_DIST}/${l_CODENAME}/SRPM" -type 'f' -iname "*.src.rpm" -print)" if [ -z "${SEARCH_SRPM}" ]; then - find "/var/cache/obs-build/${l_DIST}/${l_CODENAME}/i386/${BUILD_RESULT}/SRPMS/" -type 'f' | grep -E '.*\.src\.rpm$' | while read rpmfile; do + # For information on why this weird -print0 | read -r -d '' construction works, + # refer to the first instance of this in this script. + find "/var/cache/obs-build/${l_DIST}/${l_CODENAME}/i386/${BUILD_RESULT}/SRPMS/" -type 'f' -iname '*.src.rpm' -print0 | while read -r -d '' rpmfile; do cp "${rpmfile}" "${PKGDIST}/${l_DIST}/${l_CODENAME}/SRPM/" done rpmsign-unattended -D "%_gpg_name debian@x2go.org" --addsign "${PKGDIST}/${l_DIST}/${l_CODENAME}/SRPM/"*.rpm @@ -804,7 +818,10 @@ build_packages() { # Obtain packages from our RPM repository. get_extra_repository "redhat" "${l_DIST}" "${l_CODENAME}" "${COMPONENT}" "${PROJECT}" "i386" "${RPM_WANT_EXTRA_REPOS}" - find "${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 + + # For information on why this weird -print0 | read -r -d '' construction works, + # refer to the first instance of this in this script. + find "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/rpmbuild/SRPMS/" -type 'f' -iname "${PROJECT}-${UPSTREAM_VERSION}-${PKG_SRCRELEASE}.${IS_RELEASE}.git${DATE}.${GITREV}.${COMPONENT}.*.src.rpm" -print0 | while read -r -d '' 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 SIGN_SRPM="0" -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git