浏览代码

add support for RedHat WS/ES/AS and Fedora to %{l_platform} via latest OSSP platform

Ralf S. Engelschall 22 年之前
父节点
当前提交
d7677117c1
共有 2 个文件被更改,包括 19 次插入4 次删除
  1. 1 0
      openpkg/HISTORY
  2. 18 4
      openpkg/platform

+ 1 - 0
openpkg/HISTORY

@@ -2,6 +2,7 @@
 2003
 ====
 
+20031211 add support for RedHat WS/ES/AS and Fedora to %{l_platform} via latest OSSP platform
 20031211 uprade to GNU tar 1.13.91 (backed out again, because 1.13.91 is partly broken)
 20031205 fix rpmtool run-time under openpkg.boot environment
 20031129 do not enforce uudecode availability as raw tarballs introduced a month ago do no longer require it

+ 18 - 4
openpkg/platform

@@ -403,15 +403,18 @@ case "${UNAME}" in
         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 && \
-                /bin/ls *[_-]release *[_-]version 2>/dev/null | grep -v lsb | \
-                sed -e '/redhat-release/d'; echo redhat-release`; do
+            for tagfile in x \
+                `cd /etc && \
+                /bin/ls *[_-]release *[_-]version 2>/dev/null | \
+                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 @@ case "${UNAME}" in
                        -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 @@ case "${UNAME}" in
                     unitedlinux ) n="UnitedLinux"        ;;
                     *           ) n="${n}[ GNU/Linux]"   ;;
                 esac
+                if [ ".${t}" != . ]; then
+                    n="${n} ${t}"
+                fi
                 SP="$n $v"
                 break
             done