Skip to content

Commit e6cdd08

Browse files
committed
fix up some UPS things so that install works
1 parent 79b1043 commit e6cdd08

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

ups/make_dune_plot_style_ups_product.sh

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ usage() {
2222
# setup
2323
# -----------------------------------------------------------------------------
2424

25-
if [ ${#@} != 1 ]; then
25+
if [ ${#@} -lt 1 ] || [ ${#@} -gt 2 ]; then
2626
usage
2727
fi
2828

@@ -67,23 +67,17 @@ echo "-------------------------------------------"
6767
ups active
6868
echo "-------------------------------------------"
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
8275
preorg_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
8579
if 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}/
110104
rm -rf ${preorg_dir}
111105

112106
proddir=${path}/${reponame}
113-
dest=${proddir}/${version}/NULL
107+
dest=${proddir}/${version}
114108

115109
echo "$reponame will be created in $dest"
116110

@@ -156,22 +150,18 @@ echo "Updating table file"
156150
sed -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

172161
retval=$?
173162
test $retval -ne 0 && echo "Error! 'ups declare' returned non-zero - BAILING" && exit 1
174163

175164
rm -rf ${tmpdir}
176165

166+
echo
177167
echo "Done"

0 commit comments

Comments
 (0)