2 message testing to remove relative path
4 # remove leading "../"; this behavior will be like the GNU tar.
6 echo -------------------------------------------------------------------
7 # "../xx/xx" -> "xx/xx"
9 $lha c $builddir/test-tmp-1.lzh ../test-1/test-a
13 cat <<"EOF" | diff - test-tmp-stderr
14 LHa: Warning: Removing leading `../' from member name.
18 $lha vvq test-tmp-1.lzh | head -1
19 $lha vvq test-tmp-1.lzh | head -1 | egrep '^test-1/test-a$'
22 echo -------------------------------------------------------------------
23 # ../xx/../xx (result: xx not "../xx")
25 $lha c $builddir/test-tmp-2.lzh ../test-1/../test-a
29 cat <<"EOF" | diff - test-tmp-stderr
30 LHa: Warning: Removing leading `../test-1/../' from member name.
34 $lha vvq test-tmp-2.lzh | head -1
35 $lha vvq test-tmp-2.lzh | head -1 | egrep '^test-a$'
37 echo -------------------------------------------------------------------
38 # ../xx/xx/../xx (result: xx not "xx/xx")
40 cp -pr test-1 test-tmp-3 &&
41 cp -p test-a test-tmp-3
44 $lha c $builddir/test-tmp-3.lzh ../test-tmp-3/test-1/../test-a
48 cat <<"EOF" | diff - test-tmp-stderr
49 LHa: Warning: Removing leading `../test-tmp-3/test-1/../' from member name.
53 $lha vvq test-tmp-3.lzh | head -1
54 $lha vvq test-tmp-3.lzh | head -1 | egrep '^test-a$'
56 echo -------------------------------------------------------------------
57 # just a ".." (result: ".")
59 cp -pr test-1 test-tmp-4
61 (cd test-tmp-4/test-1 &&
62 $lha c $builddir/test-tmp-4.lzh ..
66 cat <<"EOF" | diff - test-tmp-stderr
67 LHa: Warning: Removing leading `..' from member name.
68 LHa: Warning: Removing leading `../' from member name.
69 LHa: Warning: Removing leading `../' from member name.
70 LHa: Warning: Removing leading `../' from member name.
71 LHa: Warning: Removing leading `../' from member name.
75 $lha vvq test-tmp-4.lzh
76 $lha vvq test-tmp-4.lzh > test-tmp-stdout
79 cat <<"EOF" > test-tmp-expect
87 egrep -v -- '-lh' test-tmp-stdout | diff - test-tmp-expect
89 echo -------------------------------------------------------------------
90 # "xx/./xx" -> "xx/xx"
91 $lha c test-tmp-5.lzh test-1/./test-a
93 $lha vvq test-tmp-5.lzh
94 $lha vvq test-tmp-5.lzh > test-tmp-stdout
96 cat <<"EOF" > test-tmp-expect
100 egrep -v -- '-lh' test-tmp-stdout | diff - test-tmp-expect
102 echo -------------------------------------------------------------------
103 # "./xx/././xx" -> "xx/xx"
104 $lha c test-tmp-6.lzh ./test-1/././test-a
106 $lha vvq test-tmp-6.lzh
107 $lha vvq test-tmp-6.lzh > test-tmp-stdout
109 cat <<"EOF" > test-tmp-expect
113 egrep -v -- '-lh' test-tmp-stdout | diff - test-tmp-expect
115 echo -------------------------------------------------------------------
116 # "xx/./xx/./././xx" -> "xx/xx/xx"
118 cp -pr test-1 test-tmp-7 &&
119 cp -p test-a test-tmp-7
121 $lha c test-tmp-7.lzh test-tmp-7/./test-1/./././test-a
123 $lha vvq test-tmp-7.lzh
124 $lha vvq test-tmp-7.lzh > test-tmp-stdout
126 cat <<"EOF" > test-tmp-expect
127 test-tmp-7/test-1/test-a
130 egrep -v -- '-lh' test-tmp-stdout | diff - test-tmp-expect
132 echo -------------------------------------------------------------------
135 $lha c $builddir/test-tmp-8.lzh ./
138 $lha vvq test-tmp-8.lzh
139 $lha vvq test-tmp-8.lzh > test-tmp-stdout
141 cat <<"EOF" > test-tmp-expect
148 egrep -v -- '-lh' test-tmp-stdout | diff - test-tmp-expect
150 echo -------------------------------------------------------------------
153 $lha c $builddir/test-tmp-9.lzh .
156 $lha vvq test-tmp-9.lzh
157 $lha vvq test-tmp-9.lzh > test-tmp-stdout
159 cat <<"EOF" > test-tmp-expect
166 egrep -v -- '-lh' test-tmp-stdout | diff - test-tmp-expect
168 echo -------------------------------------------------------------------