Skip to content

Commit

Permalink
distscript: port back to sh (from csh)
Browse files Browse the repository at this point in the history
Also remove the LS_COLORS workaround for the csh bug.
  • Loading branch information
jsquyres committed Apr 7, 2014
1 parent ce7c83e commit 143e272
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
6 changes: 3 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ endif

#
# "make distcheck" requires that tarballs are able to be able to "make
# dist", so we have to include config/distscript.csh.
# dist", so we have to include config/distscript.sh.
#
EXTRA_DIST = \
README VERSION COPYING AUTHORS \
config/hwloc_get_version.sh \
config/distscript.csh
config/distscript.sh

# Only install entire visual studio subdirectory if we're building in standalone mode
if HWLOC_BUILD_STANDALONE
Expand All @@ -48,7 +48,7 @@ endif

if HWLOC_BUILD_STANDALONE
dist-hook:
env LS_COLORS= csh "$(top_srcdir)/config/distscript.csh" "$(top_srcdir)" "$(distdir)" "$(HWLOC_VERSION)"
sh "$(top_srcdir)/config/distscript.sh" "$(top_srcdir)" "$(distdir)" "$(HWLOC_VERSION)"
endif HWLOC_BUILD_STANDALONE

#
Expand Down
64 changes: 34 additions & 30 deletions config/distscript.csh → config/distscript.sh
Original file line number Diff line number Diff line change
@@ -1,82 +1,87 @@
#! /bin/csh -f
#!/bin/sh -f
#
# 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,
# 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 © 2010-2014 Inria. All rights reserved.
# Copyright © 2009-2013 Cisco Systems, Inc. All rights reserved.
# Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
#
# Additional copyrights may follow
#
#
# $HEADER$
#

set builddir="`pwd`"
builddir="`pwd`"

set srcdir="$1"
srcdir=$1
cd "$srcdir"
set srcdir=`pwd`
srcdir=`pwd`
cd "$builddir"

set distdir="$builddir/$2"
set HWLOC_VERSION="$3"
distdir="$builddir/$2"
HWLOC_VERSION=$3

if ("$distdir" == "") then
if test "$distdir" = ""; then
echo "Must supply relative distdir as argv[2] -- aborting"
exit 1
elif ("$HWLOC_VERSION" == "") then
elif test "$HWLOC_VERSION" = ""; then
echo "Must supply version as argv[1] -- aborting"
exit 1
endif
fi

#========================================================================

set start=`date`
start=`date`
cat <<EOF
Creating hwloc distribution
In directory: `pwd`
Srcdir: $srcdir
Builddir: $builddir
Version: $HWLOC_VERSION
Started: $start
EOF

umask 022

if (! -d "$distdir") then
if test ! -d "$distdir"; then
echo "*** ERROR: dist dir does not exist"
echo "*** ERROR: $distdir"
exit 1
endif
fi

if (! -d $srcdir/doc/doxygen-doc) then
if test ! -d $srcdir/doc/doxygen-doc; then
echo "*** The srcdir does not already have a doxygen-doc tree built."
echo "*** hwloc's config/distscript.csh requires the docs to be built"
echo "*** in the srcdir before executing 'make dist'."
exit 1
endif
fi

# Trivial helper function
doit() {
echo $*
$*
}

echo "*** Copying doxygen-doc tree to dist..."
echo "*** Directory: srcdir: $srcdir, distdir: $distdir, pwd: `pwd`"
chmod -R a=rwx $distdir/doc/doxygen-doc/
echo rm -rf $distdir/doc/doxygen-doc/
rm -rf $distdir/doc/doxygen-doc/
echo cp -rpf $srcdir/doc/doxygen-doc/ $distdir/doc
cp -rpf $srcdir/doc/doxygen-doc/ $distdir/doc
doit mkdir -p $distdir/doc/doxygen-doc
doit chmod -R a=rwx $distdir/doc/doxygen-doc
doit rm -rf $distdir/doc/doxygen-doc
doit cp -rpf $srcdir/doc/doxygen-doc/ $distdir/doc

echo "*** Copying new README"
ls -lf $distdir/README
cp -pf $srcdir/README $distdir
doit cp -pf $srcdir/README $distdir

#########################################################
# VERY IMPORTANT: Now go into the new distribution tree #
Expand All @@ -91,17 +96,16 @@ echo "*** Now in distdir: $distdir"
#

echo "*** Removing latex source from dist tree"
rm -rf doc/doxygen-doc/latex
doit rm -rf doc/doxygen-doc/latex

#
# All done
#

cat <<EOF
*** hwloc version $HWLOC_VERSION distribution created
Started: $start
Ended: `date`
EOF
EOF

0 comments on commit 143e272

Please sign in to comment.