#! /bin/bash

inc_list=dta/tools/release-files.lst
exc_list=dta/tools/release-exclude.lst

sec_inc=dta/tools/secure-release.lst
sec_exc=dta/tools/secure-exclude.lst

if [ ! -d dta/tools ] ; then
	echo "Executing from incorrect directory."
	exit 1
fi

if [ ! -e ${inc_list} ] ; then
	echo "${inc_list} not found."
	exit 1
fi

if [ ! -e ${exc_list} ] ; then
	echo "${exc_list} not found."
	exit 1
fi

if [ -z "$1" ] ; then 
	echo "Missing archive file name. For example, rel97572_0_1_x.tar.gz"
	exit 1
fi

tar -czf $1 -T ${inc_list} -X ${exc_list}

tar -czf secure-$1  -T ${sec_inc} -X ${sec_exc}