File: command-names

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 (102 lines) | stat: -rw-r--r-- 2,509 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
if test -n "${sourced_command_names}"; then
   echo "Error: sourced common/command-names script twice" >&2
   exit 1
else
	sourced_command_names=1
fi
dir=${dir:-../../src}
# Get the canonical directory name
case "$dir" in 
	/*)   
		;; 
	*)	
		dir=`cd "$dir" && pwd || echo "$dir"`
		;;
esac
echo "Directory under test is $dir"

# Make a variable for each CSSC command.  These are the commands we run 
# in order to set up each test.  Because they are variables, we can set
# them (and $dir) to test any set of binaries we want.
get=${get:-${dir}/get}
admin=${admin:-${dir}/admin}
cdc=${cdc:-${dir}/cdc}
prs=${prs:-${dir}/prs}
prt=${prt:-${dir}/prt}
delta=${delta:-${dir}/delta}
sact=${sact:-${dir}/sact}
sccsprog=${sccsprog:-${dir}/sccs}
sccsdiff=${sccsdiff:-${dir}/sccsdiff}
unget=${unget:-${dir}/unget}
what=${what:-${dir}/what}
val=${val:-${dir}/val}
rmdel=${rmdel:-${dir}/rmdel}


DIFF=${DIFF:-diff}

for f in ${get} ${admin} ${csc} ${prs} ${prt} \
	${delta} ${sact} ${sccsdiff} ${unget} ${what} ${rmdel}
do
	case $f in 
		/*)
			test -x "$f" || echo "WARNING: cannot execute $f" >&2
			;;
		*)
			;;
	esac
done

# Find the sccs driver program.   Note that we use ${sccsprog} here;
# ${sccsprog} was set, above.

# We need to run the candidate 
# to find out if it accepts the --prefix option.

if test x"${sccs}" = x
then
    if test x"${sccsprog}" = x
    then
        if test -f "${dir}/sccs"
        then
	        sccsprog="${dir}/sccs"
        else
                sccsprog="sccs"
        fi
    fi

    # Find out if it takes the --prefix option.  If so,
    # use it.
    if ${sccsprog} --cssc >/dev/null 2>&1
    then
        sccsargs="--prefix=${dir}/"
    else
        sccsargs=""
    fi

    sccs="${sccsprog} ${sccsargs}"
fi

# Allow the user to disable Valgrind via the 
# environment, so that we can still execute
# "make dist" quickly when that's useful.
if test -n "$CSSC_DISABLE_VALGRIND"; then
   unset VALGRIND
fi

# Set up some valgrind-enabled commands so that we can use these
# in a targeted way.   If we use valgrind for every invocation,
# the regression tests will run very slowly.
vg_get="${VALGRIND} ${get}"
vg_admin="${VALGRIND} ${admin}"
vg_cdc="${VALGRIND} ${cdc}"
vg_prs="${VALGRIND} ${prs}"
vg_prt="${VALGRIND} ${prt}"
vg_delta="${VALGRIND} ${delta}"
vg_sact="${VALGRIND} ${sact}"
vg_sccsdiff="${VALGRIND} ${sccsdiff}"
vg_unget="${VALGRIND} ${unget}"
vg_what="${VALGRIND} ${what}"
vg_val="${VALGRIND} ${val}"
vg_rmdel="${VALGRIND} ${rmdel}"
vg_sccs="${VALGRIND} ${sccs}"