File: GETDISTNAME

package info (click to toggle)
r-base 2.1.0-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 43,944 kB
  • ctags: 23,283
  • sloc: ansic: 200,913; fortran: 68,557; sh: 12,127; perl: 8,510; makefile: 5,810; tcl: 2,953; yacc: 2,077; java: 455; asm: 268; sed: 16
file content (24 lines) | stat: -rwxr-xr-x 653 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#
# ${RHOME}/tools/GETDISTNAME

TOOLS_DIR=`echo ${0} | sed 's%/[^/][^/]*$%%'`
(cd ${TOOLS_DIR}/..
  maj=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\1/' < VERSION`
  min=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\2/' < VERSION`
  rev=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\3/' < VERSION`
  if test -z "${rev}" ; then
    res=R-${maj}.${min}
  else
    y=`cut -d/ -f1 < date-stamp`
    m=`cut -d/ -f2 < date-stamp`
    d=`cut -d/ -f3 < date-stamp`
    if test "${rev}" = "Under development (unstable)"; then
      res="R-devel_"${y}-${m}-${d}
    else
      rev=`echo ${rev} | tr [A-Z] [a-z]`
      res="R-${rev}_"${y}-${m}-${d}
    fi
  fi
  echo ${res}
)