]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-build: add get_rpm_code_name.sh script
authorGary Lowell <glowell@inktank.com>
Mon, 24 Sep 2012 22:59:20 +0000 (15:59 -0700)
committerGary Lowell <glowell@inktank.com>
Mon, 24 Sep 2012 22:59:20 +0000 (15:59 -0700)
New script to generate names for rpm based distributions that might
not provide meaningful code names via lsb_release.

get_rpm_code_name.sh [new file with mode: 0755]

diff --git a/get_rpm_code_name.sh b/get_rpm_code_name.sh
new file mode 100755 (executable)
index 0000000..527ecd2
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh -x
+
+LSB_RELEASE=/usr/bin/lsb_release
+[ ! -x $LSB_RELEASE ] && echo unknown && exit
+
+ID=`$LSB_RELEASE --short --id`
+
+case $ID in
+CentOS)
+       RELEASE=`$LSB_RELEASE --short --release | cut -d. -f1`
+       DIST=$ID$RELEASE
+       ;;
+Fedora)
+       RELEASE=`$LSB_RELEASE --short --release`
+       DIST=$ID$RELEASE
+       ;;
+*)
+       DIST=unknown
+       ;;
+esac
+
+echo $DIST