File: distscript.sh

package info (click to toggle)
pmix 6.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 12,364 kB
  • sloc: ansic: 134,173; sh: 4,271; python: 2,785; makefile: 2,286; xml: 1,611; perl: 1,341; lex: 138
file content (67 lines) | stat: -rwxr-xr-x 2,470 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
#
# 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-2019 Research Organization for Information Science
#                         and Technology (RIST).  All rights reserved.
# Copyright (c) 2015      Los Alamos National Security, LLC. All rights
#                         reserved.
# Copyright (c) 2017      Intel, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

srcdir=$1
builddir=$PWD
distdir=$builddir/$2
PMIX_REPO_REV=$3

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
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=$PMIX_REPO_REV
if test -e .git ; then
    repo_rev=$(config/pmix_get_version.sh VERSION --repo-rev)
fi

#
# 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)"

#
# Update pmix.spec:%{version} with the main version
#
PMIX_SPEC=contrib/pmix.spec
perl -pi -e 's/^Version:.*/Version: '$PMIX_REPO_REV'/' -- "${distdir}/$PMIX_SPEC"
touch -r "${srcdir}/$PMIX_VERSION" "${distdir}/$PMIX_VERSION"

echo "*** Updated $PMIX_SPEC file with repo rev: $PMIX_REPO_REV"
echo "*** (via dist-hook / config/distscript.sh)"