File: external.sh

package info (click to toggle)
darcs 2.4.4-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,292 kB
  • ctags: 259
  • sloc: haskell: 26,818; sh: 7,051; ansic: 1,572; perl: 124; makefile: 24
file content (40 lines) | stat: -rw-r--r-- 811 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash

# Skip: Requires network connectivity
exit 200

# Some tests for launching external commands

. lib

rm -rf temp1

touch_fakessh='./touch-fakessh'
if echo $OS | grep -i windows; then
  touch_fakessh="touch_fakessh.bat"
fi
export DARCS_SSH=$touch_fakessh
export DARCS_SCP=$touch_fakessh
export DARCS_SFTP=$touch_fakessh
rm -rf 'fakessh'
rm -rf 'touch-fakessh'

# make our ssh command one word only
echo 'echo hello > fakessh' > $touch_fakessh
chmod u+x $touch_fakessh
# first test the DARCS_SSH environment variable
not darcs get example.com:foo
grep hello fakessh
rm -f fakessh

# now make sure that we don't launch ssh for nothing
mkdir temp1
cd temp1
darcs init
cd ..
darcs get temp1 > log
not grep fakessh log
not darcs get http://example.com/foo
not grep fakessh log
cd ..
rm -rf temp1