From: Gary Lowell Date: Mon, 24 Sep 2012 22:59:20 +0000 (-0700) Subject: ceph-build: add get_rpm_code_name.sh script X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3b91e399172a25e8f0546f4cf2129eddaed43fa8;p=ceph-build.git ceph-build: add get_rpm_code_name.sh script New script to generate names for rpm based distributions that might not provide meaningful code names via lsb_release. --- diff --git a/get_rpm_code_name.sh b/get_rpm_code_name.sh new file mode 100755 index 000000000..527ecd2c1 --- /dev/null +++ b/get_rpm_code_name.sh @@ -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