File: test

package info (click to toggle)
archivemount 1b-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 232 kB
  • sloc: cpp: 1,873; makefile: 41; sh: 21
file content (26 lines) | stat: -rwxr-xr-x 612 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
#!/bin/sh
# SPDX-License-Identifier: 0BSD

trap 'umount "${tmpd}m" 2>/dev/null; rm -rf "$tmpd"' EXIT INT
tmpd="$(mktemp -d)/"


ar r "${tmpd}ar" archivemount.cpp archivemount.1.in 2>/dev/null
mkdir "${tmpd}m"
./archivemount -f "${tmpd}ar" "${tmpd}m" &
sleep 0.1
for f in archivemount.cpp archivemount.1.in; do
	cmp "$f" "${tmpd}m/$f" || exit
done
umount "${tmpd}m"
wait $! || exit


tar -cf "${tmpd}tar" archivemount.cpp archivemount.1.in
./archivemount -f "${tmpd}tar" "${tmpd}m" &
sleep 0.1
for f in archivemount.cpp archivemount.1.in; do
	cmp "$f" "${tmpd}m/$f" || exit
done
umount "${tmpd}m"
wait $! || exit