summaryrefslogtreecommitdiff
path: root/tests/envvar-check
blob: 8d1d3b903d57893ab64f3f49446e15ac53747b2a (plain)
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
# -*- sh -*-
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
  as_unset=unset
else
  as_unset=false
fi

envvar_check_failed=0
vars='
  BLOCKSIZE
  BLOCK_SIZE
  CDPATH
  DF_BLOCK_SIZE
  DU_BLOCK_SIZE
  LS_BLOCK_SIZE
  POSIXLY_CORRECT
  SIMPLE_BACKUP_SUFFIX
  TIME_STYLE
  VERSION_CONTROL
'
for var in $vars
do
  $as_unset $var
  if eval test \"\${$var+set}\" = set; then
    echo "$0: the $var environment variable is set --" \
      ' unset it and rerun this test' >&2
    envvar_check_failed=1
  fi
done

test "$envvar_check_fail" = 1 && exit 1