packages feed

darcs-beta-2.2.98.1: bugs/emailformat.sh

#!/usr/bin/env bash

# This appears to hang on Windows

set -ev
# TODO: is this really enough to make all commands interpret the given strings 
# as latin1?
export LANG="en_US.ISO-8859-1"

rm -rf temp1
rm -rf temp2
mkdir temp1
mkdir temp2
cd temp1

seventysevenaddy="<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@bbbbbbbbbb.cccccccccc.abrasoft.com>"

darcs init

echo "Have you seen the smørrebrød of René Çavésant?" > non_ascii_file
darcs add non_ascii_file
darcs record -am "non-ascii file add" -A test

cd ../temp2
darcs init
cd ../temp1

# long email adress: check that email adresses of <= 77 chars don't get split up
darcs send --from="Kjålt Überström $seventysevenaddy" \
           --subject "Un patch pour le répositoire" \
           --to="Un garçon français <garcon@francais.fr>" \
           --sendmail-command='cp /dev/stdin mail_as_file %<' \
           -a ../temp2

cat mail_as_file
# The long mail address should be in there as a whole
grep $seventysevenaddy mail_as_file

# Check that there are no non-ASCII characters in the mail
ghc -e 'getContents >>= return . not . any (> Data.Char.chr 127)' < mail_as_file | grep '^True$'


cd ..
rm -rf temp1
rm -rf temp2