| 1 |
#!/bin/sh |
| 2 |
# SPDX-License-Identifier: 0BSD |
| 3 |
|
| 4 |
trap 'umount "${tmpd}m" 2>/dev/null; rm -rf "$tmpd"' EXIT INT |
| 5 |
tmpd="$(mktemp -d)/" |
| 6 |
|
| 7 |
|
| 8 |
ar r "${tmpd}ar" archivemount.cpp archivemount.1.in 2>/dev/null |
| 9 |
mkdir "${tmpd}m" |
| 10 |
./archivemount -f "${tmpd}ar" "${tmpd}m" & |
| 11 |
sleep 0.1 |
| 12 |
for f in archivemount.cpp archivemount.1.in; do |
| 13 |
cmp "$f" "${tmpd}m/$f" || exit |
| 14 |
done |
| 15 |
umount "${tmpd}m" |
| 16 |
wait $! || exit |
| 17 |
|
| 18 |
|
| 19 |
tar -cf "${tmpd}tar" archivemount.cpp archivemount.1.in |
| 20 |
./archivemount -f "${tmpd}tar" "${tmpd}m" & |
| 21 |
sleep 0.1 |
| 22 |
for f in archivemount.cpp archivemount.1.in; do |
| 23 |
cmp "$f" "${tmpd}m/$f" || exit |
| 24 |
done |
| 25 |
umount "${tmpd}m" |
| 26 |
wait $! || exit |