Source
DUPLICATES=`perl -ne 's/#.*//; next if /^\s*$/; if ($uniq{$_}++) { print $_; }' MANIFEST`
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
# Check that all the files in MANIFEST exist and (if this is a
# GIT checkout) that all the GIT-managed files appear in the
# MANIFEST.
#
verbose=yes
MANIFEST=/tmp/HD_MANIFEST.$$
AUTOGEN=./autogen.sh
AUTOGEN_LOG=/tmp/autogen.log.$$
# Main
test "$verbose" && echo " Checking MANIFEST..." 1>&2
# clean up $MANIFEST file when exits
trap "rm -f $MANIFEST" 0
# Only split lines on newline, not whitespace
set -f
IFS='
'
# First make sure i am in the directory in which there is an MANIFEST file
# and then do the checking from there. Will try the following,
# current directory, parent directory, the directory this command resides.
if [ -f MANIFEST ]; then
continue
elif [ -f ../MANIFEST ]; then
cd ..
else
commanddir=`dirname $0`
if [ -d "$commanddir" -a -f $commanddir/MANIFEST ]; then
cd $commanddir
continue
else
echo MANIFEST file not found. Abort.
exit 1
fi
fi