3 # make a distribution tarball for larsoft_data, uboone_data, etc.
8 Usage: $(basename ${0}) [-h]
9 $(basename ${0}) <options> <product_topdir> <product_name> <product_version>
17 product_topdir Top directory for relocatable-UPS products area.
18 product_name Product name, e.g., larsoft_data
19 product_version Product version, e.g., v0_03_01
22 The tarball will be made in the directory you are in when the script is called.
23 $(basename ${0}) is suitable for use with larsoft_data, not other products.
28 ########################################################################
31 while getopts :fh OPT; do
42 shift `expr $OPTIND - 1`
49 working_dir=$(/bin/pwd)
50 dotver=`echo ${product_version} | sed -e 's/_/./g' | sed -e 's/^v//'`
52 if [ -z ${product_topdir} ]
58 if [ -z ${product_name} ]
63 if [ -z ${product_version} ]
69 [[ -n "$working_dir" ]] && \
70 [[ -d "${working_dir}" ]] && \
71 [[ -w "${working_dir}" ]] || \
72 { echo "ERROR: Could not write to specified working directory \"${working_dir}\"." 1>&2; exit 1; }
74 [[ -d ${product_topdir}/${product_name}/${product_version} ]] || \
75 { echo "ERROR: ${product_topdir}/${product_name}/${product_version} is not a directory." 1>&2; exit 1; }
76 [[ -d ${product_topdir}/${product_name}/${product_version}.version ]] || \
77 { echo "ERROR: ${product_topdir}/${product_name}/${product_version}.version is not a directory." 1>&2; exit 1; }
81 tar cjf ${working_dir}/${product_name}-${dotver}-noarch.tar.bz2 \
82 ${product_name}/${product_version}.version \
83 ${product_name}/${product_version}
85 ls -l ${product_name}-${dotver}-noarch.tar.bz2 || exit 1