File: TR_starch_extract_and_remove.sh

package info (click to toggle)
cctools 7.1.2-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 43,744 kB
  • sloc: ansic: 187,336; cpp: 20,196; python: 18,633; sh: 11,159; xml: 3,688; perl: 2,817; makefile: 1,105
file content (30 lines) | stat: -rwxr-xr-x 501 bytes parent folder | download | duplicates (3)
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
27
28
29
30
#!/bin/sh

. ../../dttools/test/test_runner_common.sh

sfxfile=extract_and_remove.sfx
tarfile=starch.tar.gz

prepare()
{
	cd ..; tar czvf $tarfile src; cd -; mv ../$tarfile .
	exit 0
}

run()
{
	../src/starch -v -x tar -x rm -c 'tar_test() { for f in $@; do if ! tar xvf $f; then exit 1; fi ; done; rm $@; }; tar_test' $sfxfile
	exec ./$sfxfile $tarfile
}

clean()
{
	rm -rf src
	rm -f $sfxfile $tarfile
	rm -rf $(basename $tarfile .tar.gz)
	exit 0
}

dispatch "$@"

# vim: set noexpandtab tabstop=4: