From f3d04530748b0fbdd3cda277b2c56c5149ce5ccb Mon Sep 17 00:00:00 2001 From: Huub Van Dam Date: Sat, 30 Oct 2010 07:27:37 +0000 Subject: [PATCH] HvD: A few scripts to automatically add $Id: $ constructs to files. For simplicity they append this construct to a file, rather than prepending it. Although this is not so fancy it satisfies the needs of the util "make version" command which simply depends on this construct be extractable from the file. --- contrib/add_Id | 24 ++++++++++++++++++++++++ contrib/add_Id_C | 5 +++++ contrib/add_Id_Fortran | 5 +++++ 3 files changed, 34 insertions(+) create mode 100755 contrib/add_Id create mode 100755 contrib/add_Id_C create mode 100755 contrib/add_Id_Fortran diff --git a/contrib/add_Id b/contrib/add_Id new file mode 100755 index 0000000000..d0502affdd --- /dev/null +++ b/contrib/add_Id @@ -0,0 +1,24 @@ +#!/bin/bash +# +# add_Id +# ------ +# +# This script looks for source code files that do not have a $Id: $ construct in them. +# When such a file is found it will add the particular construct at the end of the file. +# +export ADD_ID_FORTRAN=${NWCHEM_TOP}/contrib/add_Id_Fortran +export ADD_ID_C=${NWCHEM_TOP}/contrib/add_Id_C +# +echo -n "Adding \$Id: \$ to Fortran header files... " +find . -name "*.fh" ! -exec grep Id: {} \; -exec $ADD_ID_FORTRAN {} \; 2>&1 > /dev/null +echo "Done" +echo -n "Adding \$Id: \$ to Fortran source files... " +find . -name "*.f" ! -exec grep Id: {} \; -exec $ADD_ID_FORTRAN {} \; 2>&1 > /dev/null +find . -name "*.F" ! -exec grep Id: {} \; -exec $ADD_ID_FORTRAN {} \; 2>&1 > /dev/null +echo "Done" +echo -n "Adding \$Id: \$ to C header files... " +find . -name "*.h" ! -exec grep Id: {} \; -exec $ADD_ID_C {} \; 2>&1 > /dev/null +echo "Done" +echo -n "Adding \$Id: \$ to C source files... " +find . -name "*.c" ! -exec grep Id: {} \; -exec $ADD_ID_C {} \; 2>&1 > /dev/null +echo "Done" diff --git a/contrib/add_Id_C b/contrib/add_Id_C new file mode 100755 index 0000000000..b85668eb76 --- /dev/null +++ b/contrib/add_Id_C @@ -0,0 +1,5 @@ +#!/bin/bash +# +# Add the $Id: $ construct to a C file. For simplicity it is simply appended. +# +echo "/* \$Id: \$ */" >> $1 diff --git a/contrib/add_Id_Fortran b/contrib/add_Id_Fortran new file mode 100755 index 0000000000..b7719ca1d6 --- /dev/null +++ b/contrib/add_Id_Fortran @@ -0,0 +1,5 @@ +#!/bin/bash +# +# Add the $Id: $ construct to a Fortran file. For simplicity it is simply appended. +# +echo "c \$Id: \$" >> $1