From 3b91e399172a25e8f0546f4cf2129eddaed43fa8 Mon Sep 17 00:00:00 2001 From: Gary Lowell Date: Mon, 24 Sep 2012 15:59:20 -0700 Subject: [PATCH] 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. --- get_rpm_code_name.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 get_rpm_code_name.sh diff --git a/get_rpm_code_name.sh b/get_rpm_code_name.sh new file mode 100755 index 00000000..527ecd2c --- /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 -- 2.39.5