All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
makeDataTar.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 # make a distribution tarball for larsoft_data, uboone_data, etc.
4 
6 {
7  cat 1>&2 <<EOF
8 Usage: $(basename ${0}) [-h]
9  $(basename ${0}) <options> <product_topdir> <product_name> <product_version>
10 
11 Options:
12 
13  -h This help.
14 
15 Arguments:
16 
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
20 
21 Notes:
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.
24 
25 EOF
26 }
27 
28 ########################################################################
29 # Main body.
30 
31 while getopts :fh OPT; do
32  case ${OPT} in
33  h)
34  usage
35  exit 1
36  ;;
37  *)
38  usage
39  exit 1
40  esac
41 done
42 shift `expr $OPTIND - 1`
43 OPTIND=1
44 
45 product_topdir=${1}
46 product_name=${2}
47 product_version=${3}
48 
49 working_dir=$(/bin/pwd)
50 dotver=`echo ${product_version} | sed -e 's/_/./g' | sed -e 's/^v//'`
51 
52 if [ -z ${product_topdir} ]
53 then
54  usage
55  exit 1
56 fi
57 
58 if [ -z ${product_name} ]
59 then
60  usage
61  exit 1
62 fi
63 if [ -z ${product_version} ]
64 then
65  usage
66  exit 1
67 fi
68 
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; }
73 
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; }
78 
79 set -x
80 cd ${product_topdir}
81 tar cjf ${working_dir}/${product_name}-${dotver}-noarch.tar.bz2 \
82  ${product_name}/${product_version}.version \
83  ${product_name}/${product_version}
84 cd ${working_dir}
85 ls -l ${product_name}-${dotver}-noarch.tar.bz2 || exit 1
86 set +x
87 
88 exit 0
process_name opflash particleana ie ie ie z
*usage exit esac done shift expr $OPTIND OPTIND
process_name opflash particleana ie x
esac done echo Signal files are
Definition: TrainMVA.sh:25
#define the
then echo Invalid dCache scratch not copying back else ifdh ls
Definition: run_job.sh:111
shift
Definition: fcl_checks.sh:26
usage
Definition: doGit.sh:21
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
while getopts
while getopts h
then shift fi
do cd
do case in h help echo Usage
Definition: file_to_url.sh:42
then dohelp exit fi tar
Definition: make_tarball.sh:51
then echo Work directory not specified exit fi echo Work directory
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker options
do i e
then echo fcl name