From 37efa90085f6c34db6d5947f3320c3d519ee3653 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Wed, 7 Jun 2023 08:08:33 -0700 Subject: Remove unused cruft from bin dir (#3071) --- bin/chkconfigure | 82 ---------------------------- bin/dependencies | 50 ------------------ bin/deploy | 57 -------------------- bin/distdep | 26 --------- bin/errors | 138 ------------------------------------------------ bin/format_source | 4 +- bin/format_source_patch | 34 ------------ bin/gcov_script | 50 ------------------ bin/mkdirs | 32 ----------- bin/newer | 42 --------------- bin/yodconfigure | 75 -------------------------- config/conclude.am | 4 +- config/examples.am | 4 +- 13 files changed, 5 insertions(+), 593 deletions(-) delete mode 100755 bin/chkconfigure delete mode 100755 bin/dependencies delete mode 100755 bin/deploy delete mode 100755 bin/distdep delete mode 100755 bin/errors delete mode 100755 bin/format_source_patch delete mode 100755 bin/gcov_script delete mode 100755 bin/mkdirs delete mode 100755 bin/newer delete mode 100755 bin/yodconfigure diff --git a/bin/chkconfigure b/bin/chkconfigure deleted file mode 100755 index db4010c..0000000 --- a/bin/chkconfigure +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -## -## Copyright by The HDF Group. -## 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://www.hdfgroup.org/licenses. -## If you do not have access to either file, you may request a copy from -## help@hdfgroup.org. -## -# Check that all the configure files are properly generated. -# -# Programmer: Albert Cheng -# Created Date: 2004/12/07 - -# -# Configure: should be generated by autoconf version 2.69. -# autoconf: should be of version 2.69. - -# variable initialization -nerrors=0 -AUTOCONFVERSION=2.69 -AUTOCONFVERSIONLEAD='Generated by GNU Autoconf' -CONFIGUREFILES="configure" - - -# Function definitions -# -# PRINTMSG -# Print a one line message left justified in a field of 70 characters -# without newline. More output for this line later. -# -PRINTMSG() { - SPACES=" " - echo "$* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# print result passed. -PASSED() { - echo " PASSED" -} - -# print result failed. -FAILED() { - echo "*FAILED*" -} - - -# Main body - -# Check configure files -# The autoconf version should be among the first 5 lines. -echo "Check autoconf version. Should be version $AUTOCONFVERSION" -for xf in $CONFIGUREFILES; do - PRINTMSG $xf - if [ ! -f $xf ]; then - FAILED - echo File not found - nerrors=`expr $nerrors + 1` - continue - fi - autoconf_version=`head -5 $xf | grep "$AUTOCONFVERSIONLEAD"` - echo $autoconf_version | grep "$AUTOCONFVERSIONLEAD $AUTOCONFVERSION" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - PASSED - else - FAILED - echo "Expected: $AUTOCONFVERSIONLEAD $AUTOCONFVERSION" - echo "Got: $autoconf_version" - nerrors=`expr $nerrors + 1` - fi -done - - -# Summary -echo $0 found $nerrors errors -if [ $nerrors != 0 ]; then - exit 1 -fi -exit 0 diff --git a/bin/dependencies b/bin/dependencies deleted file mode 100755 index b2f2395..0000000 --- a/bin/dependencies +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env perl -# -# Copyright by The HDF Group. -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -use warnings; - -my $depend_file; -my $new_depend_file; -my $srcdir; -my $top_srcdir; -my $top_builddir; - -while ($_ = shift @ARGV) { - if (/^--top_srcdir=([^ \t\n]*)/) { - $top_srcdir = $1; - $top_srcdir =~ s/\+/\\\+/g; - $top_srcdir =~ s/\./\\\./g; - } elsif (/^--top_builddir=([^ \t\n]*)/) { - $top_builddir = $1; - $top_builddir =~ s/\+/\\\+/g; - $top_builddir =~ s/\./\\\./g; - } else { - $depend_file = $_; - $new_depend_file = "$_.new"; - last; - } -} - -open(DEPEND, "<$depend_file") || die "cannot open file $depend_file: $!\n"; -open(NEW, ">$new_depend_file") || die "cannot open file $new_depend_file: $!\n"; - -while () { - s/\.o(\b)/\.lo$1/g; - s/ $top_srcdir/ \$\(top_srcdir\)/g; - s/ $top_builddir/ \$\(top_builddir\)/g; - print NEW $_; -} - -close(DEPEND); -close(NEW); - -`mv $new_depend_file $depend_file`; diff --git a/bin/deploy b/bin/deploy deleted file mode 100755 index 818fa07..0000000 --- a/bin/deploy +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# -# Copyright by The HDF Group. -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# Deploy the HDF5 binary. -# -# Programmer: Albert Cheng -# Created Date: 2004/12/15 -# -# Modifications - -# Function definitions -# -# Print Usage page -USAGE() -{ -cat << EOF -Usage: $0 - Install the binary to directory - -Examples: - - $ bin/deploy /usr/local/hdf5 - .... - -EOF - -} - - -# Variables - -if [ $# != 1 ]; then - USAGE - exit 1 -fi - -installdir=$1 -# create installdir if it does not exist yet. -if [ -d $installdir ] || mkdir $installdir ; then - ${MAKE:-gmake} install prefix=$installdir && \ - ( cd $installdir/bin; ./h5redeploy -force) - exit $? -else - echo $installdir is not a valid directory - USAGE - exit 1 -fi - diff --git a/bin/distdep b/bin/distdep deleted file mode 100755 index fcda217..0000000 --- a/bin/distdep +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -#! -*-perl-*- -eval 'exec perl -p -x -S $0 ${1+"$@"}' - if 0; -# -# Copyright by The HDF Group. -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -# Usage: $0 [<].depend - -# Takes dependency info and generates on stdout dependencies suitable for -# distribution by removing all the system include files from the list and -# removing all but the base name of other include files (since the Makefiles -# contain the logic for searching). - -($h,$_)=/\s*\\/?$h.$`:("",$h.$_); -s|( +/\S*)*( *)|$2?" \\\n ":""|eg; -#s|(([-\w\.]+)/)+([-\w\.]+)|\3|g; diff --git a/bin/errors b/bin/errors deleted file mode 100755 index 9473636..0000000 --- a/bin/errors +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env perl -require 5.003; -use warnings; -use Text::Tabs; - -# NOTE: THE FORMAT OF HRETURN_ERROR AND HGOTO_ERROR MACROS HAS -# CHANGED. THIS SCRIPT NO LONGER WORKS! --rpm - -# Copyright by The HDF Group. -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# Robb Matzke -# 30 Aug 1997 -# -# Purpose: This script will read standard input which should be a -# function prologue followed by a C function and will emit -# on standard output the same source code with the function -# prologue containing documentation for the various errors -# that occur in the function. -# -# Errors are raised by calling HGOTO_ERROR() or -# HRETURN_ERROR(). The reason for the error message is a -# comment which appears immediately after the error macro -# call and is contained entirely on one line: -# -# HRETURN_ERROR (...); /*entry not found*/ -# -# If such a comment doesn't exist, then the previous comment -# is used, subject to the constraint that raising an error -# clears the previous comment. -# -# /* Entry not found */ -# HGOTO_ERROR (...); -# -# Emacs users can use this script interactively with the -# c-mark-function and shell-command-on-region functions which -# are normally bound to M-C-h and M-|. - - -# Split STDIN into the prolog and the function body. Preserve leading -# white space. -$_ = join "", ; -my ($head, $prolog, $body) = (/^(\s*)(\/\*(.*?)\*\/)?(.*)/s)[0,2,3]; -$prolog = "" unless $prolog; - -# Find each error and the comment that goes with it. -for ($_=$body,$comment=""; /\/\*|H(RETURN|GOTO)_ERROR/s;) { - $_ = $&.$'; - - if (/^H(RETURN|GOTO)_ERROR\s*\(\s*H5E_(\w+)\s*,\s*H5E_(\w+)\s*,/s) { - ($major, $minor, $_) = ($2, $3, $'); - $comment=$1 if /^.*?\)\s*;\s*\/\*\s*(.*?)\s*\*\//; - $comment =~ s/^\s*\*+\s*/ /mg; # leading asterisks. - $comment =~ s/^\s+//s; # leading white space. - $comment =~ s/\s+$//s; # trailing white space. - $comment =~ s/(\w)$/$1./s; # punctuation. - $comment ||= "***NO COMMENT***"; - $errors{"$major\000$minor\000\u$comment"} = 1; - $comment = ""; - - } else { - ($comment) = /^\/\*\s*(.*?)\s*\*\//s; - $_ = $'; - } -} - - -# Format an error so it isn't too wide. -sub fmt_error ($) { - local ($_) = @_; - - my ($prefix,$space,$err) = /^((.*?)([A-Z_0-9]+\s+[A-Z_0-9]+\s+))/; - $_ = $'; - tr/\n / /s; - my $w = 70 - length expand $prefix; - s/(.{$w}\S+)\s+(\S)/$1."\n".$space.' 'x(length $err).$2/eg; - return $prefix . $_."\n"; -} - - - -# Sort the errors by major, then minor, then comment. Duplicate -# triplets have already been removed. -sub by_triplet { - my ($a_maj, $a_min, $a_com) = split /\000/, $a; - my ($b_maj, $b_min, $b_com) = split /\000/, $b; - $a_maj cmp $b_maj || $a_min cmp $b_min || $a_com cmp $b_com; -} -@errors = map {sprintf "%-9s %-13s %s\n", split /\000/} - sort by_triplet keys %errors; - - - -# Add the list of errors to the prologue depending on the type of -# prolog. -if (($front, $back) = $prolog=~/^(.*?Errors:\s*?(?=\n)).*?\n\s*\*\s*\n(.*)/s) { - #| * Errors: |# - #| * __list_of_error_messages__ (zero or more lines) |# - #| * |# - print $head, "/*", $front, "\n"; - map {print fmt_error " *\t\t".$_} @errors; - print " *\n", $back, "*/", $body; - -} elsif (($front,$back) = $prolog =~ - /(.*?\n\s*ERRORS:?\s*?(?=\n)).*?\n\s*\n(.*)/s) { - #| ERRORS |# - #| __list_of_error_messages__ (zero or more lines) |# - #| |# - print $head, "/*", $front, "\n"; - map {print fmt_error " ".$_} @errors; - print "\n", $back, "*/", $body; - -} elsif ($prolog eq "") { - # No prolog present. - print $head; - print " \n/*", "-"x73, "\n * Function:\t\n *\n * Purpose:\t\n *\n"; - print " * Errors:\n"; - map {print fmt_error " *\t\t".$_} @errors; - print " *\n * Return:\tSuccess:\t\n *\n *\t\tFailure:\t\n *\n"; - print " * Programmer:\t\n *\n * Modifications:\n *\n *", '-'x73, "\n"; - print " */\n", $body; - -} else { - # Prolog format not recognized. - print $head, "/*", $prolog, "*/\n\n"; - print "/*\n * Errors returned by this function...\n"; - map {print fmt_error " *\t".$_} @errors; - print " */\n", $body; -} - - diff --git a/bin/format_source b/bin/format_source index 227d22a..fb0264c 100755 --- a/bin/format_source +++ b/bin/format_source @@ -5,8 +5,6 @@ # # Note that any files or directories that are excluded here should also be # added to the 'exclude' list in .github/workflows/clang-format-check.yml -# -# (Remember to update both bin/format_source and bin/format_source_patch) find . \( -type d -path ./config -prune -and -not -path ./config \) \ -or \( \( \! \( \ @@ -21,6 +19,6 @@ find . \( -type d -path ./config -prune -and -not -path ./config \) \ -or -name H5overflow.h \ \) \) \ -and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp -or -iname *.java \) \) \ - | xargs clang-format -style=file -i -fallback-style=none + | xargs -P0 -n1 clang-format -style=file -i -fallback-style=none exit 0 diff --git a/bin/format_source_patch b/bin/format_source_patch deleted file mode 100755 index 2e01455..0000000 --- a/bin/format_source_patch +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# Recursively format all C & C++ sources and header files, except those in the -# 'config' directory and generated files, such as H5LTanalyze.c, etc. -# -# Note that any files or directories that are excluded here should also be -# added to the 'exclude' list in .github/workflows/clang-format-check.yml -# -# (Remember to update both bin/format_source and bin/format_source_patch) - -find . \( -type d -path ./config -prune -and -not -path ./config \) \ - -or \( \( \! \( \ - -name H5LTanalyze.c \ - -or -name H5LTparse.c \ - -or -name H5LTparse.h \ - -or -name H5Epubgen.h \ - -or -name H5Einit.h \ - -or -name H5Eterm.h \ - -or -name H5Edefin.h \ - -or -name H5version.h \ - -or -name H5overflow.h \ - \) \) \ - -and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp -or -iname *.java \) \) \ - | xargs clang-format -style=file -i -fallback-style=none - -git diff > clang_format.patch - -# Delete if 0 size -if [ ! -s clang_format.patch ] -then - rm clang_format.patch -fi - -exit 0 diff --git a/bin/gcov_script b/bin/gcov_script deleted file mode 100755 index 06b2ad1..0000000 --- a/bin/gcov_script +++ /dev/null @@ -1,50 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. - -# A script to generate coverage files for HDF5 using gcov. -# Configures, builds, and runs tests in-place; the output files will be placed -# in a directory called gcov_logs. -# Must be invoked from the root hdf5 directory. -# This script has been tested on kagiso. - -CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs" -export CFLAGS -LDFLAGS="$LDFLAGS -lgcov" -export LDFLAGS -CC=gcc -export CC -./configure -make -make check -mkdir gcov_logs -cd src -for j in *.h *.c - do - ln -s ../$j .libs/$j - done -cd .libs -for j in *.gcda - do - gcov -b $j >> gcov.log 2>&1 - done -for j in *.gcov - do - mv $j ../../gcov_logs - done -mv gcov.log ../../gcov_logs -for j in *.c *.h - do - rm $j - done -cd ../.. - - diff --git a/bin/mkdirs b/bin/mkdirs deleted file mode 100755 index 4e66eb5..0000000 --- a/bin/mkdirs +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# This is a small program which will create directories n-levels deep. -# You just call it with something like: -# -# mkdirs /tmp/foo/bar/baz -# -# and it will create all the directories from /tmp down to baz which -# don't exist. -# -chmodprog="${CHMODPROG-chmod}" -mkdirprog="${MKDIRPROG-mkdir}" - -make_dir () { - if test ! -d $1; then - make_dir `echo $1 | sed -e 's#/[^/]*$##'` - $mkdirprog $1 - $chmodprog 755 $1 - fi -} - -make_dir `echo $1 | sed -e 's#/$##'` diff --git a/bin/newer b/bin/newer deleted file mode 100755 index c36df03..0000000 --- a/bin/newer +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# Copyright by The HDF Group. -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# Compare the modification time of file argument 1 against other file arguments. -# Return true (0) if argument 1 is newer than all others, otherwise return -# false (1). If any of the argument is not a file, return false (1). -# -# Programmer: Albert Cheng -# Created Date: 2005/07/06 -# Modification: -# Albert Cheng 2005/8/30 -# Changed from two arguments to multiple arguments. - -if test $# -lt 2; then - exit 1 -fi -if test ! -f $1; then - exit 1 -fi -f1=$1 -shift - -for f in $*; do - if test ! -f $f; then - exit 1 - fi - if test X = X`find $f1 -newer $f -print`; then - exit 1 - fi -done - -# passed all tests. Must be a file newer than all others. -exit 0 diff --git a/bin/yodconfigure b/bin/yodconfigure deleted file mode 100755 index 76f45a8..0000000 --- a/bin/yodconfigure +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh -# -# Copyright by The HDF Group. -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# Fix configure file so that it can launch configure testing executable -# via the proper launching command, e.g., yod. (Thus the name yodconfigure -# is used.) -# -# Author: Albert Cheng - -if [ "$1" = -f ]; then - FORCEMODE=yes - echo turn FORCEMODE to $FORCEMODE - shift -fi - -if [ $# -ne 1 ]; then - echo "Usage: $0 [-f] " - echo " -f apply the change even if it has been applied already." - exit 1 -fi -confile=$1 - -if [ ! -w $confile ]; then - echo "$0: $confile is not writable" - exit 1 -fi - -ACTRY_NAME="ACTRY()" -if grep ^"$ACTRY_NAME"$ $confile >/dev/null 2>&1 && [ "$FORCEMODE" != yes ]; then - echo "$0: $confile is already yodconfigure ready. Use -f to force yodconfigure again." - exit 1 -fi - -# Insert the ACTRY function after the 1st line which is the #!/bin/sh. -# Change all "eval $ac_try" commands to call ACTRY. -# auto-configure have changed the ac_try syntax from 'eval $ac_try' to -# 'eval "$ac_try"'. Thus requiring two very similar global-substitute. -# The single quotes around EOF tell shell NOT to expand or do substitution in -# the body of ed input. -# -ed - $confile <<'EOF' -1a -# ===inserted by yodconfigure ==== -# ACTRY will figure out when it is approprirate to run the command by the -# $RUNSERIAL launcher (e.g., yod -sz 1) and when to just run it as is. -# So far, ./a.out and ./conftest are names of real executable that should -# be run by $RUNSERIAL. -# -# (uncomment the echo line if you want to see what is going on.) -ACTRY() -{ -#echo ACTRY: args are: $* > /dev/tty -if [ "$1" = ./a.out -o "$1" = ./conftest ]; then -# echo $RUNSERIAL $* > /dev/tty - $RUNSERIAL $* -else - $* -fi -} -# === end of ACTRY inserted by yodconfigure ==== -. -g/eval $ac_try/s/eval/eval ACTRY/ -g/eval "$ac_try"/s/eval/eval ACTRY/ -w -q -EOF diff --git a/config/conclude.am b/config/conclude.am index a74c83a..bda1a19 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -121,7 +121,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: tname=$(@:.chkexe_=)$(EXEEXT);\ log=$(@:.chkexe_=.chklog); \ echo "============================"; \ - if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \ + if [ $(@:.chkexe_=.chkexe) -nt $${tname} ]; then \ echo "No need to test $${tname} again."; \ else \ if test -n "$(REALTIMEOUTPUT)"; then \ @@ -209,7 +209,7 @@ $(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_: chkname=`basename $(@:.chkexe_=.chkexe)`;\ log=`basename $(@:.chkexe_=.chklog)`; \ echo "============================"; \ - if $(top_srcdir)/bin/newer $${chkname} $$cmd $(SCRIPT_DEPEND); then \ + if [ $${chkname} -nt $$cmd ] && [ $${chkname} -nt $(SCRIPT_DEPEND) ]; then \ echo "No need to test $${tname} again."; \ else \ echo "============================" > $${log}; \ diff --git a/config/examples.am b/config/examples.am index 06d8d4e..09a9a24 100644 --- a/config/examples.am +++ b/config/examples.am @@ -50,9 +50,9 @@ CLEANFILES=$(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA) # How to create EXAMPLEDIR if it doesn't already exist $(EXAMPLEDIR): - -$(top_srcdir)/bin/mkdirs $@ + mkdir -p -m 755 $@ $(EXAMPLETOPDIR): - -$(top_srcdir)/bin/mkdirs $@ + mkdir -p -m 755 $@ # Install and uninstall rules. We install the source files, not the # example programs themselves. -- cgit v0.12