2015-04-27 16:48:43 +03:00
|
|
|
#!/bin/sh
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
2014-10-02 14:09:13 +04:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2008-10-28 20:22:29 +03:00
|
|
|
# University of Stuttgart. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2015-02-09 19:31:50 +03:00
|
|
|
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
|
2015-01-15 12:57:05 +03:00
|
|
|
# Copyright (c) 2015 Research Organization for Information Science
|
|
|
|
# and Technology (RIST). All rights reserved.
|
2015-04-23 18:41:18 +03:00
|
|
|
# Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
# reserved.
|
2008-10-28 20:22:29 +03:00
|
|
|
# $COPYRIGHT$
|
2014-10-02 14:09:13 +04:00
|
|
|
#
|
2008-10-28 20:22:29 +03:00
|
|
|
# Additional copyrights may follow
|
2014-10-02 14:09:13 +04:00
|
|
|
#
|
2008-10-28 20:22:29 +03:00
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
2015-04-23 22:27:31 +03:00
|
|
|
srcdir=$1
|
2015-04-23 18:41:18 +03:00
|
|
|
builddir=$PWD
|
2015-04-23 22:27:31 +03:00
|
|
|
distdir=$builddir/$2
|
2015-04-27 16:48:43 +03:00
|
|
|
OMPI_REPO_REV=$3
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-04-23 18:41:18 +03:00
|
|
|
if test x"$2" = x ; then
|
2015-04-27 16:48:43 +03:00
|
|
|
echo "*** ERROR: Must supply relative distdir as argv[2] -- aborting"
|
2008-10-28 20:22:29 +03:00
|
|
|
exit 1
|
2015-04-27 16:48:43 +03:00
|
|
|
elif test ! -d "$distdir" ; then
|
|
|
|
echo "*** ERROR: dist dir does not exist"
|
|
|
|
echo "*** ERROR: $distdir"
|
2008-10-28 20:22:29 +03:00
|
|
|
exit 1
|
2015-04-23 18:41:18 +03:00
|
|
|
fi
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-04-27 16:48:43 +03:00
|
|
|
# We can catch some hard (but possible) to do mistakes by looking at
|
2014-10-02 18:31:47 +04:00
|
|
|
# our repo's revision, but only if we are in the source tree.
|
2008-10-28 20:22:29 +03:00
|
|
|
# Otherwise, use what configure told us, at the cost of allowing one
|
2015-04-27 16:48:43 +03:00
|
|
|
# or two corner cases in (but otherwise VPATH builds won't work).
|
2015-04-23 18:41:18 +03:00
|
|
|
repo_rev=$OMPI_REPO_REV
|
|
|
|
if test -d .git ; then
|
|
|
|
repo_rev=$(config/opal_get_version.sh VERSION --repo-rev)
|
|
|
|
fi
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
#
|
2014-10-02 18:31:47 +04:00
|
|
|
# Update VERSION:repo_rev with the best value we have.
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
2015-04-27 16:48:43 +03:00
|
|
|
perl -pi -e 's/^repo_rev=.*/repo_rev='$repo_rev'/' -- "${distdir}/VERSION"
|
2014-10-02 18:31:47 +04:00
|
|
|
# need to reset the timestamp to not annoy AM dependencies
|
|
|
|
touch -r "${srcdir}/VERSION" "${distdir}/VERSION"
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2015-04-27 16:48:43 +03:00
|
|
|
echo "*** Updated VERSION file with repo rev: $repo_rev"
|
|
|
|
echo "*** (via dist-hook / config/distscript.sh)"
|