]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-{,dev,dev-new} build: fix conditional for cephadm package test 1952/head
authorDan Mick <dmick@redhat.com>
Thu, 20 Jan 2022 21:44:36 +0000 (13:44 -0800)
committerDan Mick <dmick@redhat.com>
Thu, 20 Jan 2022 21:44:36 +0000 (13:44 -0800)
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 <dmick@redhat.com>
ceph-build/build/build_rpm
ceph-dev-build/build/build_rpm
ceph-dev-new-build/build/build_rpm
scripts/build_utils.sh

index 6e94bd3d1c7d85e9980244158fd2a36bfb2e68bb..2393951c59eb93fde27c9f4d67be2af89f6ec063 100644 (file)
@@ -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
index 33a76a8e5b8b6b058012a71df80ef52ceabec019..e07d214ca3acac46b7b9186d7ece48a34a9eed67 100644 (file)
@@ -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
index e7d74b73447d148869f1de483b60555aca3a8f8d..740daec02fee98c81c6aa0b0bda1d6d50405ab23 100644 (file)
@@ -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
index 82479d9a0c0107e539c3abcdbba14216faa2d70f..989d88dc44e6c5af02f33a8c9d42132e011f6294 100644 (file)
@@ -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