File: set_scripts_executable.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 (68 lines) | stat: -rw-r--r-- 1,163 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash

# Some tests for the --set-scripts-executable option.

. lib

abort_windows

rm -rf temp1 temp2

mkdir temp1
cd temp1
darcs init
cat > script.pl << FOO
#!/usr/bin/env perl
print "Hello\n";
FOO
chmod 0644 script.pl
date > nonscript
# pre-tests
test -r script.pl
test -r nonscript
test ! -x script.pl
test ! -x nonscript
darcs add script.pl nonscript
darcs record --patch-name 'uno' --all
cd ..

# sans --set-scripts-executable (should not be executable)
mkdir temp2
cd temp2
darcs init
darcs pull -a ../temp1
# sanity check
test -r script.pl
test -r nonscript
# nothing should be executable
test ! -x script.pl
test ! -x nonscript
cd ..
rm -rf temp2

# with --set-scripts-executable
mkdir temp2
cd temp2
darcs init
darcs pull -a ../temp1 --set-scripts-executable
# sanity check
test -r script.pl
test -r nonscript
# script should be executable
test -x script.pl
test ! -x nonscript
cd ..
rm -rf temp2

# now let's try the same thing with get
darcs get --set-scripts-executable temp1 temp2
cd temp2
# sanity check
test -r script.pl
test -r nonscript
# script should be executable
test -x script.pl
test ! -x nonscript
cd ..

rm -rf temp1 temp2