From a5bfa20d2f1335fd84124be79c2ab84b0d1b1f5b Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 20 Jan 2022 13:44:36 -0800 Subject: [PATCH] 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 --- ceph-build/build/build_rpm | 2 +- ceph-dev-build/build/build_rpm | 2 +- ceph-dev-new-build/build/build_rpm | 2 +- scripts/build_utils.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ceph-build/build/build_rpm b/ceph-build/build/build_rpm index 6e94bd3d1..2393951c5 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 33a76a8e5..e07d214ca 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 e7d74b734..740daec02 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 82479d9a0..989d88dc4 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 -- 2.47.3