File: 057_setenv

package info (click to toggle)
fsvs 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,964 kB
  • ctags: 1,464
  • sloc: ansic: 16,650; sh: 5,885; perl: 783; makefile: 338; python: 90
file content (46 lines) | stat: -rwxr-xr-x 1,022 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

set -e 
$PREPARE_CLEAN > /dev/null
$INCLUDE_FUNCS
cd $WC


dir=1/a/X
fn=kairo22
path=$dir/$fn
logenv=$LOGDIR/056.env
logrev=$LOGDIR/056.rev

mkdir -p $dir
echo Data=$$ > $path

# We use update, to see whether the revision is set too.
# We have to read from STDIN, else FSVS cries.
# Again we have to use perl, because some shells put single ticks around 
# the values.
$BINdflt ps fsvs:update-pipe "perl -e '<STDIN>; print \"\$_=\$ENV{\$_}\\n\" for grep(/^FSVS_/, keys %ENV);' > $logenv" $path
$BINq ci -mx

$BINdflt up $WC2 > $logrev
rev=`grep "revision	" $logrev | tail -1 | cut -f2 -d"	" | cut -f1 -d.` 

function Check
{
  if ! grep --line-regexp "$@" "$logenv"
  then
    cat $logenv
		$ERROR "Didn't see $@"
  fi
}

Check FSVS_CONF=$FSVS_CONF
Check FSVS_WAA=$FSVS_WAA
Check FSVS_CURRENT_ENTRY=$path
Check FSVS_WC_ROOT=$WC2
Check FSVS_WC_CONF=$($TEST_PROG_DIR/path2spool $WC2 "^")
Check FSVS_TARGET_REVISION=$rev
# This is now unsetenv() if empty.
# FSVS_SOFTROOT=

$SUCCESS "Environment correctly set."