File: need-prt

package info (click to toggle)
cssc 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,540 kB
  • ctags: 10,602
  • sloc: cpp: 39,776; sh: 16,907; ansic: 13,767; python: 3,923; makefile: 1,698; perl: 342; awk: 15
file content (32 lines) | stat: -rw-r--r-- 760 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/sh

if test -z "${prt}"; then
    echo '${prt} is not set, please source common/test-common before common/need-prt' >&2
    exit 1
fi

# Find out if we have a "prt" executable. 

if test -x "${prt}"
then
    HAVE_PRT=true
else
    "${prt}" ; rv=$?
    if test $rv -gt 120 
    then
	HAVE_PRT=false
    else
	# We passed no arguments to prt so it returned an error code
	# but that error code is smaller than the error code we would have 
	# got if the executable had been missing. 
	HAVE_PRT=true
    fi
fi

$HAVE_PRT || {
    echo "The tests in $0 will not be carried out on this system because ${prt} is missing."

    # Exit successfully because we want the test suite to pass when run against
    # SCCS implementations that lack prt.
    exit 0
}