]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
radosgw-agent: remove dependency on host naming scheme
authorKen Dreyer <kdreyer@redhat.com>
Fri, 5 Jun 2015 22:48:04 +0000 (16:48 -0600)
committerKen Dreyer <kdreyer@redhat.com>
Fri, 5 Jun 2015 22:49:29 +0000 (16:49 -0600)
Don't use the hostname to determine the type of OS or build (Deb/RPM) to
do.

Instead, determine the OS type using the same code that we're using in
ceph-build.

radosgw-agent/build/build

index 42b68b63b6e4c07e390f98c4266db16dddbd4f3b..26c85d39cc6e262d6a9fcb4b93937a98414a686d 100644 (file)
@@ -24,8 +24,15 @@ echo "  WS=$WORKSPACE"
 echo "  PWD=$(pwd)"
 ls -l
 
-case $HOST in
-*rpm*)
+is_suse() {
+    if hash zypper 2>/dev/null; then
+        echo 1
+    else
+        echo 0
+    fi
+}
+
+if [[ ! -f /etc/redhat-release && is_suse -eq 1 ]] ; then
         rm -rf ./dist  # Remove any previous artifacts
         mkdir -p $WORKSPACE/dist/noarch
         mkdir -p $WORKSPACE/dist/SRPMS
@@ -55,8 +62,7 @@ case $HOST in
                 cp -avf $HOME/rpmbuild/* $WORKSPACE/dist/
             fi
         fi
-        ;;
-*deb* | tala*)
+else
         DEB_VERSION=$(dpkg-parsechangelog | sed -rne 's,^Version: (.*),\1, p')
         BP_VERSION=${DEB_VERSION}${BPTAG}
         DEBEMAIL="sandon@inktank.com" dch -D $DIST --force-distribution -b -v "$BP_VERSION" "$comment"
@@ -69,9 +75,4 @@ case $HOST in
             mv ../*.changes ../*.dsc ../*.deb ../*.tar.gz dist/.
 
         fi
-        ;;
-*)
-       echo "Can't determine build host type"
-        exit 4
-        ;;
-esac
+fi