OSSP CVS Repository

ossp - Check-in [4508]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4508
Date: 2004-Apr-21 17:07:41 (local)
2004-Apr-21 15:07:41 (UTC)
User:rse
Branch:
Comment: Port "sh.platform" to full POSIX 1003.1-2001 (SUSv3) compliance by replacing "head -1" with "sed -e 'q'" and "tail -1" with "sed -n -e '$p'".
Tickets:
Inspections:
Files:
ossp-pkg/shtool/ChangeLog      1.199 -> 1.200     6 inserted, 0 deleted
ossp-pkg/shtool/sh.platform      1.5 -> 1.6     3 inserted, 3 deleted

ossp-pkg/shtool/ChangeLog 1.199 -> 1.200

--- ChangeLog    2004/04/07 07:58:14     1.199
+++ ChangeLog    2004/04/21 15:07:41     1.200
@@ -9,6 +9,12 @@
 
  ChangeLog
 
+ Changes between 2.0b2 and 2.0b3 (07-Apr-2004 to 21-Apr-2004):
+
+   *) Port "sh.platform" to full POSIX 1003.1-2001 (SUSv3) compliance by
+      replacing "head -1" with "sed -e 'q'" and "tail -1" with "sed -n -e '$p'".
+      [Ralf S. Engelschall]
+
  Changes between 2.0b1 and 2.0b2 (17-Feb-2004 to 07-Apr-2004):
 
    *) Replace "tr 'x-' 'x_'" with "sed -e 's/-/_/g'" constructs


ossp-pkg/shtool/sh.platform 1.5 -> 1.6

--- sh.platform  2004/02/12 16:06:27     1.5
+++ sh.platform  2004/04/21 15:07:41     1.6
@@ -200,7 +200,7 @@
         v_kern=`echo "${UNAME_RELEASE}" |\
             sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`
         v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\
-            sort -n | tail -1 | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null`
+            sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null`
         ST="GNU/<Linux >${v_libc}/<${v_kern}>"
         if [ -f /etc/lsb-release ]; then
             eval `( . /etc/lsb-release
@@ -220,7 +220,7 @@
                 [ ".${tagfile}" = .x ] && continue
                 [ ! -f "/etc/${tagfile}" ] && continue
                 n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'`
-                v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | head -1 |\
+                v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\
                    sed -e 's/^/#/' \
                        -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
                        -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
@@ -379,7 +379,7 @@
             alpha ) AP="Alpha" ;;
         esac
         alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\
-            sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | head -n 1`
+            sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'`
         AT="${AP}${alpha_type}"
         AC="${AP}"
         #   determine system

CVSTrac 2.0.1