]> git.cameronkatri.com Git - apple_cmds.git/blob - create_tarballs.sh
Improve create_tarballs.sh
[apple_cmds.git] / create_tarballs.sh
1 #!/bin/sh
2 if command -v bsdtar &>/dev/null; then
3 TAR="bsdtar"
4 elif ! tar --version | grep "GNU" &>/dev/null; then
5 TAR="tar"
6 else
7 echo "Install BSD tar"
8 exit 1
9 fi
10
11 num=0
12 for i in adv_cmds basic_cmds bootstrap_cmds \
13 developer_cmds diskdev_cmds doc_cmds \
14 file_cmds mail_cmds misc_cmds network_cmds \
15 patch_cmds remote_cmds shell_cmds \
16 system_cmds text_cmds; do
17 EXTRA_PATHS=""
18 TARFLAGS="caf"
19 case "$i" in
20 network_cmds) TARFLAGS="-s '|^|network_cmds/|' -caf" EXTRA_PATHS="lib/libpcap";;
21 remote_cmds) TARFLAGS="-s '|^|remote_cmds/|' -caf" EXTRA_PATHS="lib/libtelnet";;
22 esac
23 num=$((num+1))
24 printf "(%i) %s\n" "$num" "$i"
25 ${TAR} ${TARFLAGS} $i.tar.zst $i ${EXTRA_PATHS}
26 done