1
1
Based on initial suggestions from Paul Hargrove
(http://www.open-mpi.org/community/lists/devel/2015/04/17354.php),
simplify the distscript.sh; it really only has to do one thing:
substitute the repo_rev in VERSION.
Этот коммит содержится в:
Jeff Squyres 2015-04-27 06:48:43 -07:00
родитель 3627c82774
Коммит 60127b1caa
2 изменённых файлов: 18 добавлений и 75 удалений

Просмотреть файл

@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2012-2015 Los Alamos National Security, Inc. All rights reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# $COPYRIGHT$
@ -25,7 +25,7 @@ EXTRA_DIST = README INSTALL VERSION Doxyfile LICENSE autogen.pl README.JAVA.txt
include examples/Makefile.include
dist-hook:
env LS_COLORS= sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(OMPI_VERSION)" "$(OMPI_REPO_REV)"
env LS_COLORS= sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(OMPI_REPO_REV)"
# Check for common symbols. Use a "-hook" to increase the odds that a
# developer will see it at the end of their installation process.

Просмотреть файл

@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
@ -25,89 +25,32 @@
srcdir=$1
builddir=$PWD
distdir=$builddir/$2
OMPI_VERSION=$3
OMPI_REPO_REV=$4
OMPI_REPO_REV=$3
if test x"$2" = x ; then
echo "Must supply relative distdir as argv[2] -- aborting"
echo "*** ERROR: Must supply relative distdir as argv[2] -- aborting"
exit 1
elif test x$OMPI_VERSION = x ; then
echo "Must supply version as argv[1] -- aborting"
exit 1
fi
# 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)
repo_rev=$OMPI_REPO_REV
if test -d .git ; then
repo_rev=$(config/opal_get_version.sh VERSION --repo-rev)
fi
start=$(date)
cat <<EOF
Creating Open MPI distribution
In directory: `pwd`
Version: $OMPI_VERSION
Started: $start
EOF
umask 022
# Some shell startup files alias cp, mv, and rm to have "-i"
# (interactive). Unalias here, just so that we don't use that option.
unalias cp &> /dev/null
unalias rm &> /dev/null
unalias mv &> /dev/null
if test ! -d "$distdir" ; then
elif test ! -d "$distdir" ; then
echo "*** ERROR: dist dir does not exist"
echo "*** ERROR: $distdir"
exit 1
fi
# 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).
repo_rev=$OMPI_REPO_REV
if test -d .git ; then
repo_rev=$(config/opal_get_version.sh VERSION --repo-rev)
fi
#
# Update VERSION:repo_rev with the best value we have.
#
sed -e 's/^repo_rev=.*/repo_rev='$repo_rev'/' "${distdir}/VERSION" > "${distdir}/version.new"
cp -f "${distdir}/version.new" "${distdir}/VERSION"
rm -f "${distdir}/version.new"
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 number"
#########################################################
# VERY IMPORTANT: Now go into the new distribution tree #
#########################################################
cd "$distdir"
echo "*** Now in distdir: $distdir"
#
# Put the release version number in the README and INSTALL files
#
files="README INSTALL"
echo "*** Updating version number in $files..."
for file in $(echo $files) ; do
echo " - Setting $file"
if test -f $file ; then
sed -e "s/OMPI_VERSION/$OMPI_VERSION/g" $file > bar
mv -f bar $file
fi
done
#
# All done
#
cat <<EOF
*** Open MPI version $OMPI_VERSION distribution created
Started: $start
Ended: `date`
EOF
echo "*** Updated VERSION file with repo rev: $repo_rev"
echo "*** (via dist-hook / config/distscript.sh)"