@@ -22,7 +22,7 @@ usage() {
2222# setup
2323# -----------------------------------------------------------------------------
2424
25- if [ ${#@ } != 1 ]; then
25+ if [ ${#@ } -lt 1 ] || [ ${ #@ } -gt 2 ]; then
2626 usage
2727fi
2828
@@ -67,23 +67,17 @@ echo "-------------------------------------------"
6767ups active
6868echo " -------------------------------------------"
6969
70- # check if the first argument is a valid path
71- if [ -d " ${tmpdir} " ]; then
72- echo " ${tmpdir} already exists! Cannot do clean checkout!"
73- echo " Aborting"
74- exit 1
75- fi
7670
7771# pull the latest version of the git repo and put it in the product directory
7872# -----------------------------------------------------------------------------
7973
8074# clone to temp directory
81- git clone -b
${version} [email protected] :DUNE/
${reponame} .git
${tmpdir} /
${reponame} -preorg
8275preorg_dir=" ${tmpdir} /${reponame} -preorg"
76+ git clone -b
${version} [email protected] :DUNE/
${reponame} .git
${preorg_dir} 8377
8478# the exported CMake package files need to be autogenerated by running CMake
8579if which cmake > /dev/null 2>&1 ; then
86- builddir=" $( mktemp --directory --tmpdir ${tmpdir} cmake-build.XXXXXXXXXX) "
80+ builddir=" $( mktemp --directory ${tmpdir} / cmake-build.XXXXXXXXXX) "
8781
8882 echo " Running CMake to generate CMake package files."
8983 echo " Build directory: $builddir "
@@ -110,7 +104,7 @@ mv ${preorg_dir}/share/ ${tmpdir}/${reponame}/
110104rm -rf ${preorg_dir}
111105
112106proddir=${path} /${reponame}
113- dest=${proddir} /${version} /NULL
107+ dest=${proddir} /${version}
114108
115109echo " $reponame will be created in $dest "
116110
@@ -156,22 +150,18 @@ echo "Updating table file"
156150sed -i -e " s:XXVERSIONXX:${version} :" \
157151 ${ups_table}
158152
159- echo " Declaring product ${reponame} with version ${version} to UPS."
153+ echo
154+ echo " Declaring product ${reponame} with version ${version} to UPS:"
160155
161156# declare to ups
162- ups declare -f NULL -z ${path} -c \
163- -r ${path} /${reponame} /${version} / \
164- -m ${reponame} .table \
165- ${reponame} ${version}
166-
167- # I am sure there's a nicer way to do this but for now...
168- mv ${path} /${reponame} /${version} .version ${path} /${reponame} /NULL
169- mkdir ${path} /${reponame} /${version} .version/
170- mv ${path} /${reponame} /NULL ${path} /${reponame} /${version} .version/
157+ cmd=" ups declare -f NULL -z ${path} -c -r ${path} /${reponame} /${version} -m ${path} /${reponame} /${version} /ups/${reponame} .table ${reponame} ${version} "
158+ echo " $cmd "
159+ eval $cmd
171160
172161retval=$?
173162test $retval -ne 0 && echo " Error! 'ups declare' returned non-zero - BAILING" && exit 1
174163
175164rm -rf ${tmpdir}
176165
166+ echo
177167echo " Done"
0 commit comments