awips2/tools/buildManagement/updateCaveManifestFiles.sh
root 8e80217e59 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 3360eb6c5f
2012-01-06 08:55:05 -06:00

44 lines
1.5 KiB
Bash
Executable file

#!/bin/sh
# $1 == directory to run against
# $2 == TO number
# $3 == Build number
# Searches all subfolders in the the passed in directory for any MANIFEST.MF that is within a directory that starts with "com.raytheon"
# For each MANIFEST.MF found it replaces the version with the TO and Build number in the format
# Bundle-Version: 1.TO.Build.qualifier
#
# Example
# Bundle-Version: 1.10.4.qualifier
#
# Note: qualifier will be replaced in the build with the date.
function print_usage {
echo "usage: ./updateCaveManifestFiles.sh directory TO Build"
echo "example using TO10 Build 5: ./updateCaveManifestFiles.sh /home/user/workspace 10 5"
exit
}
readonly -f print_usage
declare -t print_usage
if [ "$1" = "" -o "$2" = "" -o "$3" = "" ]
then
print_usage
fi
echo "============================================================"
echo "Updating each MANIFEST.MF that is located in a subfolder that starts with com.raytheon with version 1.${2}.${3}"
echo "============================================================"
echo "***Be sure to Refresh, then check in all changes when the script is done***"
echo ""
echo "Looking for MANIFEST.MF files in all subdirectories of the directory: ${1}"
cd $1
# example find with exclusion
# export LIST=`find . -name "MANIFEST.MF" | grep 'com.raytheon' | grep -v './build.edex/opt'`
export LIST=`find . -name "MANIFEST.MF" | grep 'com.raytheon'`
for mf in $LIST
do
echo "Updating file: ${mf}"
perl -p -i -e "s!Bundle-Version: 1.[0-9]+.[0-9]+.qualifier!Bundle-Version: 1.${2}.${3}.qualifier!g" ${mf}
done