OSDN Git Service

PMA extracting sources were licensed under the MIT license
[lha/lha.git] / tests / lha-test18
1 # -*- shell-script -*-
2 message restore directory permission
3
4 echo -------------------------------------------------------------------
5
6 mkdir -p test-tmp1/test1/test2 &&
7 cp -r test-1 test-tmp1/test1/test2 &&
8 chmod 544 test-tmp1/test1/test2/test-1 &&
9 chmod 766 test-tmp1/test1/test2 &&
10 chmod 744 test-tmp1/test1 &&
11 chmod 544 test-tmp1
12                                                         check $? $LINENO
13
14 $lha c test-tmp1.lzh test-tmp1
15                                                         check $? $LINENO
16 $lha v test-tmp1.lzh
17                                                         check $? $LINENO
18 $lha xw=test-tmp1x test-tmp1.lzh
19                                                         check $? $LINENO
20
21 diff -r test-tmp1x/test-tmp1 test-tmp1
22                                                         check $? $LINENO
23
24 ls -ld test-tmp1x/test-tmp1                    | grep '^dr-xr--r--' &&
25 ls -ld test-tmp1x/test-tmp1/test1              | grep '^drwxr--r--' &&
26 ls -ld test-tmp1x/test-tmp1/test1/test2        | grep '^drwxrw-rw-' &&
27 ls -ld test-tmp1x/test-tmp1/test1/test2/test-1 | grep '^dr-xr--r--'
28                                                         check $? $LINENO
29 echo -------------------------------------------------------------------
30
31 mkdir -p test-tmp2/test1/test2 &&
32 cp -r test-1 test-tmp2/test1/test2 &&
33 chmod 766 test-tmp2/test1/test2 &&
34 chmod 744 test-tmp2/test1 &&
35 chmod 544 test-tmp2
36                                                         check $? $LINENO
37
38
39 change_timestamp 01020304.05 test-tmp2
40                                                         check $? $LINENO
41
42 $lha c test-tmp3.lzh ./test-tmp2/test1/test2 \
43                      ./test-tmp2/test1 \
44                      ./test-tmp2
45                                                         check $? $LINENO
46
47 $lha c test-tmp2.lzh ./test-tmp2/test1/test2
48                                                         check $? $LINENO
49 $lha a --debug=norecursion --debug=nosort test-tmp2.lzh \
50                      ./test-tmp2/test1/
51                                                         check $? $LINENO
52
53 chmod 444 test-tmp2
54                                                         check $? $LINENO
55 $lha a --debug=norecursion --debug=nosort test-tmp2.lzh \
56                      ./test-tmp2/
57                                                         check $? $LINENO
58
59 # PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
60 # ---------- ----------- ------- ------- ------ ---------- ------------ ----------
61 # drwxrw-rw-  1010/513         0       0 ****** -lhd- 0000 Mar  8 20:27 test-tmp2/test1/test2/
62 # drwxr-xr-x  1010/513         0       0 ****** -lhd- 0000 Mar  8 20:27 test-tmp2/test1/test2/test-1/
63 # -rw-r--r--  1010/513        16     400   4.0% -lh5- 6e5b Mar  8 20:27 test-tmp2/test1/test2/test-1/test-a
64 # -rw-r--r--  1010/513        17     400   4.2% -lh5- 8fe6 Mar  8 20:27 test-tmp2/test1/test2/test-1/test-b
65 # -rw-r--r--  1010/513        17     400   4.2% -lh5- 0861 Mar  8 20:27 test-tmp2/test1/test2/test-1/test-c
66 # drwxr--r--  1010/513         0       0 ****** -lhd- 0000 Mar  8 20:27 test-tmp2/test1/
67 # dr--r--r--  1010/513         0       0 ****** -lhd- 0000 Jan  2 03:04 test-tmp2/
68 $lha v test-tmp2.lzh
69                                                         check $? $LINENO
70
71 $lha v test-tmp3.lzh
72                                                         check $? $LINENO
73
74 $lha xqw=test-tmp2x test-tmp2.lzh
75                                                         check $? $LINENO
76
77 $lha xqw=test-tmp3x test-tmp3.lzh
78                                                         check $? $LINENO
79
80 ls -ld test-tmp2x/test-tmp2                    | grep '^dr--r--r--'
81                                                         check $? $LINENO
82 chmod 544 test-tmp2x/test-tmp2
83                                                         check $? $LINENO
84
85 find test-tmp2x | xargs ls -ld
86 # drwxr-xr-x+ 3 arai \82È\82µ   0 Mar  8 20:30 test-tmp2x
87 # dr-xr--r--+ 3 arai \82È\82µ   0 Jan  2 03:04 test-tmp2x/test-tmp2
88 # drwxr--r--+ 3 arai \82È\82µ   0 Mar  8 20:30 test-tmp2x/test-tmp2/test1
89 # drwxrw-rw-+ 3 arai \82È\82µ   0 Mar  8 20:30 test-tmp2x/test-tmp2/test1/test2
90 # drwxr-xr-x+ 2 arai \82È\82µ   0 Mar  8 20:30 test-tmp2x/test-tmp2/test1/test2/test-1
91 # -rw-r--r--  1 arai \82È\82µ 400 Mar  8 20:30 test-tmp2x/test-tmp2/test1/test2/test-1/test-a
92 # -rw-r--r--  1 arai \82È\82µ 400 Mar  8 20:30 test-tmp2x/test-tmp2/test1/test2/test-1/test-b
93 # -rw-r--r--  1 arai \82È\82µ 400 Mar  8 20:30 test-tmp2x/test-tmp2/test1/test2/test-1/test-c
94 # dr-xr--r--+ 3 arai \82È\82µ 0 Jan  2 03:04 test-tmp2x/test-tmp2
95 # drwxr--r--+ 3 arai \82È\82µ 0 Mar  8 20:30 test-tmp2x/test-tmp2/test1
96 # drwxrw-rw-+ 3 arai \82È\82µ 0 Mar  8 20:30 test-tmp2x/test-tmp2/test1/test2
97
98 diff -r test-tmp2x test-tmp3x
99                                                         check $? $LINENO
100
101 ls -ld test-tmp2x/test-tmp2                    | grep '^dr-xr--r--' &&
102 ls -ld test-tmp2x/test-tmp2/test1              | grep '^drwxr--r--' &&
103 ls -ld test-tmp2x/test-tmp2/test1/test2        | grep '^drwxrw-rw-'
104                                                         check $? $LINENO