Jeff Squyres 60127b1caa distscript: hugely simplify
Based on initial suggestions from Paul Hargrove
simplify the distscript.sh; it really only has to do one thing:
substitute the repo_rev in VERSION.
2015-04-27 06:50:40 -07:00

57 lines
2.0 KiB
Executable File

# 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.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2015 Los Alamos National Security, LLC. All rights
# reserved.
# Additional copyrights may follow
if test x"$2" = x ; then
echo "*** ERROR: Must supply relative distdir as argv[2] -- aborting"
exit 1
elif test ! -d "$distdir" ; then
echo "*** ERROR: dist dir does not exist"
echo "*** ERROR: $distdir"
exit 1
# We can catch some hard (but possible) to do mistakes by looking at
# our repo's revision, but only if we are in the source tree.
# Otherwise, use what configure told us, at the cost of allowing one
# or two corner cases in (but otherwise VPATH builds won't work).
if test -d .git ; then
repo_rev=$(config/opal_get_version.sh VERSION --repo-rev)
# Update VERSION:repo_rev with the best value we have.
perl -pi -e 's/^repo_rev=.*/repo_rev='$repo_rev'/' -- "${distdir}/VERSION"
# need to reset the timestamp to not annoy AM dependencies
touch -r "${srcdir}/VERSION" "${distdir}/VERSION"
echo "*** Updated VERSION file with repo rev: $repo_rev"
echo "*** (via dist-hook / config/distscript.sh)"