Check-in Number:
|
3691 | |
Date: |
2003-Dec-11 21:43:41 (local)
2003-Dec-11 20:43:41 (UTC) |
User: | rse |
Branch: | |
Comment: |
add RedHat AS, ES, WS and Fedora support |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/platform/platform.sh 1.18 -> 1.19
--- platform.sh 2003/10/31 20:43:57 1.18
+++ platform.sh 2003/12/11 20:43:41 1.19
@@ -403,15 +403,18 @@
if [ -f /etc/lsb-release ]; then
eval `( . /etc/lsb-release
echo "SC=\"LSB${LSB_VERSION}\""
- if [ ".${DISTRIB_ID}" != . ]; then
+ if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then
echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\""
fi
) 2>/dev/null`
fi
if [ ".$SP" = . ]; then
- for tagfile in x `cd /etc && \
+ for tagfile in x \
+ `cd /etc && \
/bin/ls *[_-]release *[_-]version 2>/dev/null | \
- sed -e '/redhat-release/d'; echo redhat-release`; do
+ sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \
+ echo redhat-release lsb-release`
+ do
[ ".${tagfile}" = .x ] && continue
[ ! -f "/etc/${tagfile}" ] && continue
n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'`
@@ -421,8 +424,16 @@
-e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
-e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
-e 's/^#.*$//'`
+ t=""
+ if [ ".${n}" = .redhat ]; then
+ t=`head -1 /etc/${tagfile} | \
+ sed -e 's/^/#/' \
+ -e 's/^#.*Red Hat Enterprise Linux \([AEW]S\).*$/\1/' \
+ -e 's/^#.*$//'`
+ fi
case "`util_lower ${n}`" in
debian ) n="Debian[ GNU/Linux]" ;;
+ fedora ) n="Fedora[ GNU/Linux]" ;;
redhat ) n="RedHat[ Linux]" ;;
suse ) n="SuSE[ Linux]" ;;
mandrake ) n="Mandrake[ Linux]" ;;
@@ -432,6 +443,9 @@
unitedlinux ) n="UnitedLinux" ;;
* ) n="${n}[ GNU/Linux]" ;;
esac
+ if [ ".${t}" != . ]; then
+ n="${n} ${t}"
+ fi
SP="$n $v"
break
done
|
|