From: Dan Mick Date: Thu, 20 Jan 2022 21:44:36 +0000 (-0800) Subject: ceph-{,dev,dev-new} build: fix conditional for cephadm package test X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a5bfa20d2f1335fd84124be79c2ab84b0d1b1f5b;p=ceph-build.git ceph-{,dev,dev-new} build: fix conditional for cephadm package test https://github.com/ceph/ceph-build/pull/1919 added a conditional test to check for cephadm package existence (so the code to extract cephadm could work on older builds that did not have a cephadm package). However, it used bash's [[ operator, and that doesn't expand file globs in its arguments, so it effectively stopped creating the cephadm binary altogether. Switch to [, which doesn't have that problem. Signed-off-by: Dan Mick --- diff --git a/ceph-build/build/build_rpm b/ceph-build/build/build_rpm index 6e94bd3d..2393951c 100644 --- a/ceph-build/build/build_rpm +++ b/ceph-build/build/build_rpm @@ -38,7 +38,7 @@ if [ "$THROWAWAY" = false ] ; then find release/${vers}/rpm/*/SRPMS | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/source find release/${vers}/rpm/*/RPMS/* | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH} # extract cephadm if it exists - if [[ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ]] ; then + if [ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ] ; then rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm | cpio -i --to-stdout *sbin/cephadm > cephadm echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} fi diff --git a/ceph-dev-build/build/build_rpm b/ceph-dev-build/build/build_rpm index 33a76a8e..e07d214c 100644 --- a/ceph-dev-build/build/build_rpm +++ b/ceph-dev-build/build/build_rpm @@ -56,7 +56,7 @@ if [ "$THROWAWAY" = false ] ; then find release/${vers}/rpm/*/SRPMS | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/source/flavors/${FLAVOR} find release/${vers}/rpm/*/RPMS/* | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} # extract cephadm if it exists - if [[ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ]] ; then + if [ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ] ; then rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm | cpio -i --to-stdout *sbin/cephadm > cephadm echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm | cpio -i --to-stdout *sbin/cephadm > cephadm diff --git a/ceph-dev-new-build/build/build_rpm b/ceph-dev-new-build/build/build_rpm index e7d74b73..740daec0 100644 --- a/ceph-dev-new-build/build/build_rpm +++ b/ceph-dev-new-build/build/build_rpm @@ -57,7 +57,7 @@ if [ "$THROWAWAY" = false ] ; then find release/${vers}/rpm/*/SRPMS | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/source/flavors/${FLAVOR} find release/${vers}/rpm/*/RPMS/* | grep rpm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} # extract cephadm if it exists - if [[ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ]] ; then + if [ -f ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm ] ; then rpm2cpio ${BUILDAREA}/RPMS/noarch/cephadm-*.rpm | cpio -i --to-stdout *sbin/cephadm > cephadm echo cephadm | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${ARCH}/flavors/${FLAVOR} fi diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 82479d9a..989d88dc 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -953,7 +953,7 @@ build_debs() { $venv/chacractl binary ${chacra_flags} create ${chacra_endpoint} # extract cephadm if it exists - if [[ -f release/${vers}/cephadm_${vers}*.deb ]] ; then + if [ -f release/${vers}/cephadm_${vers}*.deb ] ; then dpkg-deb --fsys-tarfile release/${vers}/cephadm_${vers}*.deb | tar -x -f - --strip-components=3 ./usr/sbin/cephadm echo cephadm | $venv/chacractl binary ${chacra_flags} create ${chacra_endpoint} fi