rename.sh
Go to the documentation of this file.
1 #!/bin/sh
2 
3 # Script to change the AnalysisExample name to something else.
4 # Usage: ./rename.sh <new-name>
5 
6 newname=$1
7 
8 # Rename the files.
9 mv AnalysisExample_module.cc ${newname}_module.cc
10 mv AnalysisExample.fcl ${newname}.fcl
11 
12 # Search through all the files, replacing the text "AnalysisExample"
13 # with the new name.
14 sed -i -e "s/AnalysisExample/${newname}/g" ${newname}.fcl ${newname}_module.cc GNUmakefile
15 
16 # Because of the way SRT handles compilations, it's necessary to
17 # create a link in $SRT_PRIVATE_CONTEXT/include for any package
18 # that you do not check out with addpkg_svn.
19 
20 # Get the name of the directory we're in (just in case it's not ${newname}).
21 fullpath=`pwd`
22 dir=`basename ${fullpath}`
23 # Create the link
24 ln -sf ../${dir} ../include/${dir}