Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / tests / send-external.sh
blob3512b78b90ccf4eb425ae0acf70c0b491169c07c
1 #!/usr/bin/env bash
2 set -ev
4 DARCS_EDITOR=echo
5 export DARCS_EDITOR
7 rm -rf temp1 temp2
8 mkdir temp1 temp2
10 cd temp2
11 darcs init
12 cd ..
14 cd temp1
15 darcs init
16 date > foobar
17 darcs add foobar
18 darcs rec -a -m add-foobar
20 cat > saveit.sh <<EOF
21 #!/bin/sh
22 # send-mail1.sh: Test sendmail command for darcs send 1
23 # 2008-Oct-06 22.25 / TN
24 set -ev
25 echo all: \$0 "\$@" >>saved.out
26 echo \$6 contains: >>saved.out
27 ls -ltr >>saved.out
28 cat "\$6" >>saved.out
29 echo End of \$6 contents >>saved.out
30 grep add-foobar \$6
31 CNT=0
32 while [ "\$#" != "0" ]; do
33 CNT=`expr \$CNT + 1`
34 echo \$0: arg[\$CNT] = \"\$1\" >>saved.out
35 shift
36 done
37 echo \$0: Total \$CNT arguments >>saved.out
38 echo \$0: Input: >>saved.out
39 cat >>saved.out
40 echo \$0: End of input: >>saved.out
41 EOF
43 chmod +x saveit.sh
45 # foobar
46 darcs send --author=me -a --to=random@random \
47 --sendmail-command='bash ./saveit.sh %s %t %c %b %f %a %S %t %C %B %F %A something' ../temp2
49 cat saved.out
50 grep add-foobar saved.out
51 grep 'addfile ./foobar' saved.out
53 cd ..
54 rm -rf temp1 temp2