# -*- shell-script -*-
FILENAME=lha-test7
message testing to add/update files to archive.
$lha a test-tmp.lzh test-c
							check $? $LINENO
$lha a test-tmp.lzh test-b
							check $? $LINENO
$lha u test-tmp.lzh test-a
							check $? $LINENO
$lha xw=test-tmp test-tmp.lzh
							check $? $LINENO
diff -r test-1 test-tmp
							check $? $LINENO
(cd test-tmp
 echo foo > test-a
 echo bar > test-b
 echo baz > test-c

 # update with new files
 $lha u ../test-tmp.lzh test-[abc]
)
							check $? $LINENO

# old files are in test-1 and in current directory
# new files are in test-tmp

$lha xw=test-tmp2 test-tmp.lzh
							check $? $LINENO
diff -r test-tmp test-tmp2
							check $? $LINENO
# no update with old files
$lha u test-tmp.lzh test-[abc]

$lha xw=test-tmp3 test-tmp.lzh
							check $? $LINENO
diff -r test-tmp test-tmp3
							check $? $LINENO
# replace with old files
$lha a test-tmp.lzh test-[abc]

$lha xw=test-tmp4 test-tmp.lzh
							check $? $LINENO
diff -r test-1 test-tmp4
							check $? $LINENO
# replace with new files
(cd test-tmp &&
 $lha a ../test-tmp.lzh test-[abc]
)

$lha xw=test-tmp5 test-tmp.lzh
							check $? $LINENO
diff -r test-tmp test-tmp5
							check $? $LINENO
