Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / bugs / add_permissions.sh
bloba0b213537cf6dce479ee2f7360a222d2f587f920
1 #!/usr/bin/env bash
2 set -ev
4 # add should fail on files it can't read (because it would fail to record it later anyway)
6 if echo $OS | grep -i windows; then
7 echo This test does not work on Windows
8 exit 0
9 fi
11 rm -rf temp1
12 mkdir temp1
13 cd temp1
14 darcs init
15 touch no_perms.txt
16 chmod 0000 no_perms.txt
17 # surely there is an easier way to write this 'not'
18 # i'm think of the 'finally' in try/catch/finally
19 dacrs add no_perms.txt 2> log && (chmod 0755 no_perms.txt ; exit 1) || chmod 0755 no_perms.txt
20 grep -i 'permission denied' log
22 cd ..
23 rm -rf temp1