From 81dd57d347981c43b97a7540e4b9e6fb56386884 Mon Sep 17 00:00:00 2001 From: Bryan Kowal Date: Thu, 12 Jul 2012 12:58:40 -0500 Subject: [PATCH] Issue #802 - the baseline build (enhanced by WA8) will now correctly update the edex banner and cave about dialog. Improved how the edex banner is written. Former-commit-id: 1e5b71ee7be4f50dc29f6f1d87230b47b704f274 [formerly db6b535eb6cb61482c799b60fa0b24da4107aacd [formerly d70a752ea80b6e0ded2270da8d54525ae6fbf0da]] Former-commit-id: db6b535eb6cb61482c799b60fa0b24da4107aacd Former-commit-id: b4462536746eee21149edfec1d46373490de5f09 --- edexOsgi/build.edex/esb/conf/banner.txt | 11 +++-- .../Installer.version/component.spec | 43 +++++++++++++------ rpms/build/common/systemInfo.sh | 5 +++ rpms/build/i386/build.sh | 8 ++++ rpms/build/x86_64/build.sh | 8 ++++ 5 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 rpms/build/common/systemInfo.sh diff --git a/edexOsgi/build.edex/esb/conf/banner.txt b/edexOsgi/build.edex/esb/conf/banner.txt index 8fff9583e0..faf6930416 100644 --- a/edexOsgi/build.edex/esb/conf/banner.txt +++ b/edexOsgi/build.edex/esb/conf/banner.txt @@ -1,10 +1,9 @@ ************************************************** * AWIPS II EDEX ESB Platform * -* Version: SOTE 11.8 * +* Version: SOTE 11.X * * Raytheon Company * *------------------------------------------------* -* Build Date : MM-DD-YYYY * -* Build Time : HH:MM:SS.SSS ZZZ * -* Build System: BUILD.SYSTEMXXXXXXXXXXXXXXXXXXXXX* -************************************************** - +* DEVELOPMENT * +* * +* * +************************************************** \ No newline at end of file diff --git a/rpms/awips2.core/Installer.version/component.spec b/rpms/awips2.core/Installer.version/component.spec index 1d1b34219d..3510cd1ed6 100644 --- a/rpms/awips2.core/Installer.version/component.spec +++ b/rpms/awips2.core/Installer.version/component.spec @@ -51,6 +51,10 @@ mkdir -p ${RPM_BUILD_ROOT} %pre %post +# the length is actually 50; however, we account for +# the leading "* " and the trailing " *" +CONST_BANNER_LENGTH=47 + AWIPS_PRODUCT_JAR= EDEX_BANNER_TXT= @@ -76,6 +80,26 @@ function updateCAVEVersionLegacy() rm -f manifestUpdate } +function padEdexBannerLine() +{ + local _output="${1}" + local _bannerTxt="${2}" + + local outputLength=${#_output} + + if [ ${outputLength} -ge ${CONST_BANNER_LENGTH} ]; then + _output=${_output:0:46} + echo "* ${_output} *" >> ${_bannerTxt} + return 0 + fi + + let padLength=${CONST_BANNER_LENGTH}-${outputLength} + + printf "* ${_output} %${padLength}s\\n" \* >> ${_bannerTxt} + + return 0 +} + function updateCAVEVersion() { local BUILD_XML="/awips2/cave/build.xml" @@ -126,14 +150,13 @@ function updateCAVEVersion() echo "\\n\\" >> plugin.properties echo "Developed on the Raytheon Visualization Environment (viz)\\n\\" \ >> plugin.properties - echo "\\tBUILD VERSION: %{_component_version}\\n\\" \ + echo "\\tBUILD VERSION: %{_component_version}-%{_component_release}\\n\\" \ >> plugin.properties echo "\\tBUILD DATE: %{_component_build_date}\\n\\" \ >> plugin.properties echo "\\tBUILD TIME: %{_component_build_time}\\n\\" >> plugin.properties echo "\\tBUILD SYSTEM: %{_component_build_system}\\n\\" \ >> plugin.properties - echo "\\tBuilt from Tag: %{_svn_tag}\\n\\" >> plugin.properties # Update the jar file. /awips2/java/bin/jar uf ${AWIPS_PRODUCT_JAR} plugin.properties # Relocate the jar file. @@ -146,8 +169,6 @@ function updateCAVEVersion() function updateEDEXVersion() { - local MOVE_TO_COL="\\033[50G" - rm -f ${EDEX_BANNER_TXT} touch ${EDEX_BANNER_TXT} @@ -155,20 +176,14 @@ function updateEDEXVersion() > ${EDEX_BANNER_TXT} echo "* AWIPS II EDEX ESB Platform *" \ >> ${EDEX_BANNER_TXT} - echo -e "* Version: %{_component_version}${MOVE_TO_COL}*" \ - >> ${EDEX_BANNER_TXT} + padEdexBannerLine "Version: %{_component_version}-%{_component_release}" "${EDEX_BANNER_TXT}" echo "* Raytheon Company *" \ >> ${EDEX_BANNER_TXT} echo "*------------------------------------------------*" \ >> ${EDEX_BANNER_TXT} - echo -e "* Build Date : %{_component_build_date}${MOVE_TO_COL}*" \ - >> ${EDEX_BANNER_TXT} - echo -e "* Build Time : %{_component_build_time}${MOVE_TO_COL}*" \ - >> ${EDEX_BANNER_TXT} - echo -e "* Build System: %{_component_build_system}${MOVE_TO_COL}*" \ - >> ${EDEX_BANNER_TXT} - echo -e "* Built from Tag: %{_svn_tag}${MOVE_TO_COL}*" \ - >> ${EDEX_BANNER_TXT} + padEdexBannerLine "Build Date : %{_component_build_date}" "${EDEX_BANNER_TXT}" + padEdexBannerLine "Build Time : %{_component_build_time}" "${EDEX_BANNER_TXT}" + padEdexBannerLine "Build System: %{_component_build_system}" "${EDEX_BANNER_TXT}" echo "**************************************************" \ >> ${EDEX_BANNER_TXT} } diff --git a/rpms/build/common/systemInfo.sh b/rpms/build/common/systemInfo.sh new file mode 100644 index 0000000000..af94668931 --- /dev/null +++ b/rpms/build/common/systemInfo.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +export COMPONENT_BUILD_DATE=`date +"%m-%d-%Y"` +export COMPONENT_BUILD_TIME=`date +"%T %Z"` +export COMPONENT_BUILD_SYSTEM=`hostname` diff --git a/rpms/build/i386/build.sh b/rpms/build/i386/build.sh index 2ab4a7b1ca..76d7b52350 100644 --- a/rpms/build/i386/build.sh +++ b/rpms/build/i386/build.sh @@ -18,6 +18,9 @@ function buildRPM() --define '_build_root %(echo ${AWIPSII_BUILD_ROOT})' \ --define '_component_version %(echo ${AWIPSII_VERSION})' \ --define '_component_release %(echo ${AWIPSII_RELEASE})' \ + --define '_component_build_date %(echo ${COMPONENT_BUILD_DATE})' \ + --define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \ + --define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \ --buildroot ${AWIPSII_BUILD_ROOT} \ ${RPM_SPECIFICATION}/component.spec if [ $? -ne 0 ]; then @@ -62,6 +65,11 @@ if [ $? -ne 0 ]; then echo "ERROR: Unable to source the common functions." exit 1 fi +source ${common_dir}/systemInfo.sh +if [ $? -ne 0 ]; then + echo "ERROR: Unable to retrieve the system information." + exit 1 +fi # prepare the build environment. source ${dir}/buildEnvironment.sh diff --git a/rpms/build/x86_64/build.sh b/rpms/build/x86_64/build.sh index adb14aff0a..2e32dc6c8f 100644 --- a/rpms/build/x86_64/build.sh +++ b/rpms/build/x86_64/build.sh @@ -18,6 +18,9 @@ function buildRPM() --define '_build_root %(echo ${AWIPSII_BUILD_ROOT})' \ --define '_component_version %(echo ${AWIPSII_VERSION})' \ --define '_component_release %(echo ${AWIPSII_RELEASE})' \ + --define '_component_build_date %(echo ${COMPONENT_BUILD_DATE})' \ + --define '_component_build_time %(echo ${COMPONENT_BUILD_TIME})' \ + --define '_component_build_system %(echo ${COMPONENT_BUILD_SYSTEM})' \ --buildroot ${AWIPSII_BUILD_ROOT} \ ${RPM_SPECIFICATION}/component.spec if [ $? -ne 0 ]; then @@ -62,6 +65,11 @@ if [ $? -ne 0 ]; then echo "ERROR: Unable to source the common functions." exit 1 fi +source ${common_dir}/systemInfo.sh +if [ $? -ne 0 ]; then + echo "ERROR: Unable to retrieve the system information." + exit 1 +fi # prepare the build environment. source ${dir}/buildEnvironment.sh