aboutsummaryrefslogtreecommitdiffstats
path: root/create_tarballs.sh
blob: 89e15883908b9b342b6ce295e25cf1e6dc10a025 (plain) (blame)
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
31
32
#!/bin/sh
if command -v bsdtar >/dev/null 2>&1; then
	TAR="bsdtar"
elif ! tar --version | grep "GNU" >/dev/null 2>&1; then
	TAR="tar"
else
	echo "Install BSD tar"
	exit 1
fi

num=0
for i in adv_cmds basic_cmds bootstrap_cmds \
		developer_cmds diskdev_cmds doc_cmds \
		file_cmds mail_cmds misc_cmds network_cmds \
		patch_cmds remote_cmds shell_cmds \
		system_cmds text_cmds; do
	EXTRA_PATHS=""
	REGEX=""
	case "$i" in
		network_cmds) REGEX="|^|network_cmds/|" EXTRA_PATHS="lib/libpcap";;
		remote_cmds) REGEX="|^|remote_cmds/|" EXTRA_PATHS="lib/libtelnet";;
	esac
	num=$((num+1))
	printf "(%i) %s\n" "$num" "$i"
	cp setup.sh $i/setup.sh
	if [ "${REGEX}" == "" ]; then
		${TAR} -caf $i.tar.zst $i ${EXTRA_PATHS}
	else
		${TAR} -s ${REGEX} -caf $i.tar.zst $i ${EXTRA_PATHS}
	fi
	rm $i/setup.sh
done