From 290192e2d6d96fc778fa958998a81411af6220b8 Mon Sep 17 00:00:00 2001 From: Greg Armendariz Date: Tue, 3 Feb 2015 10:12:54 -0600 Subject: [PATCH] Omaha #4065 - Update EDEX RPM install to modify date stamp Change-Id: I425408d1d038194207469f187be74f8c88f5d3c0 Former-commit-id: fbadd1deb1241078ecc1c636db2aad1becddf38a [formerly 8c38289cf7754c21be0243d0cc6da15b0770bc12 [formerly 83243af002e8ddfd15f899ff1ab3e511cf5a0af4]] Former-commit-id: 8c38289cf7754c21be0243d0cc6da15b0770bc12 Former-commit-id: 19d79f71d34a681e275910d6e9f1c24737588f9a --- .../Installer.common-base/component.spec | 25 +++++- .../Installer.edex-component/component.spec | 21 +++++ .../datadelivery.patch0 | 81 +++++++++++-------- .../Installer.edex-shapefiles/component.spec | 20 +++++ .../awips2.edex/Installer.edex/component.spec | 21 +++++ 5 files changed, 134 insertions(+), 34 deletions(-) diff --git a/rpms/awips2.core/Installer.common-base/component.spec b/rpms/awips2.core/Installer.common-base/component.spec index 659bbe7295..14336d822e 100644 --- a/rpms/awips2.core/Installer.common-base/component.spec +++ b/rpms/awips2.core/Installer.common-base/component.spec @@ -81,6 +81,14 @@ if [ $? -ne 0 ]; then exit 1 fi + +#create a list of all files packaged for /awips2/edex/data/utility +UTILITY=/awips2/edex/data/utility +if [ -d %{_build_root}/$UTILITY ]; then + cd %{_build_root}/$UTILITY + find . -type f > %{_build_root}/awips2/edex/util_filelist.%{name}.txt +fi + %pre %post # EDEX installed? @@ -88,13 +96,26 @@ fi # when the plugins are for EDEX, we just leave # them on the filesystem; no action required. rpm -q awips2-edex > /dev/null 2>&1 -if [ $? -ne 0 ]; then +retVal=$? +if [ $retVal -ne 0 ]; then # hide the edex plugins pushd . > /dev/null 2>&1 cd /awips2 rm -rf .edex mv edex .edex popd > /dev/null 2>&1 +else if [ $retVal -eq 0 ]; then + #change date stamp of utility files + UTILITY=/awips2/edex/data/utility + UTIL_FILENAME=/awips2/edex/util_filelist.%{name}.txt + if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then + while read fileName + do + touch "$UTILITY/$fileName" + done < $UTIL_FILENAME + rm -f $UTIL_FILENAME + fi + fi fi # CAVE installed? @@ -114,6 +135,8 @@ else popd > /dev/null 2>&1 fi + + %preun if [ -d /awips2/.cave ]; then rm -rf /awips2/.cave diff --git a/rpms/awips2.edex/Installer.edex-component/component.spec b/rpms/awips2.edex/Installer.edex-component/component.spec index b55ef9eb12..ddeec40f4e 100644 --- a/rpms/awips2.edex/Installer.edex-component/component.spec +++ b/rpms/awips2.edex/Installer.edex-component/component.spec @@ -50,12 +50,33 @@ fi unzip %{_baseline_workspace}/build.edex/edex/dist/%{_component_name}.zip \ -d %{_build_root} + if [ $? -ne 0 ]; then exit 1 fi +#create a list of all files packaged for /awips2/edex/data/utility +UTILITY=/awips2/edex/data/utility +if [ -d %{_build_root}/$UTILITY ]; then + cd %{_build_root}/$UTILITY + find . -type f > %{_build_root}/awips2/edex/util_filelist.%{name}.txt +fi + %pre %post + + +#change date stamp of utility files +UTILITY=/awips2/edex/data/utility +UTIL_FILENAME=/awips2/edex/util_filelist.%{name}.txt +if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then + while read fileName + do + touch "$UTILITY/$fileName" + done < $UTIL_FILENAME + rm -f $UTIL_FILENAME +fi + %preun %postun diff --git a/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 b/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 index d5602388dd..cf08ccc00e 100644 --- a/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 +++ b/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 @@ -1,6 +1,5 @@ -diff -crB a/component.spec b/component.spec -*** a/component.spec 2013-09-03 10:51:59.952913214 -0500 ---- b/component.spec 2013-09-03 11:10:40.703226553 -0500 +*** Installer.edex-component/component.spec 2015-02-02 15:31:30.696998251 -0600 +--- Installer.edex-datadelivery/component.spec 2015-02-02 15:35:06.923609297 -0600 *************** *** 6,13 **** %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') @@ -38,24 +37,21 @@ diff -crB a/component.spec b/component.spec requires: awips2-edex-base requires: awips2-python *************** -*** 47,62 **** +*** 47,59 **** if [ $? -ne 0 ]; then exit 1 fi ! unzip %{_baseline_workspace}/build.edex/edex/dist/%{_component_name}.zip \ -d %{_build_root} + if [ $? -ne 0 ]; then exit 1 fi - %pre - %post - %preun - %postun - - %clean ---- 47,104 ---- + #create a list of all files packaged for /awips2/edex/data/utility + UTILITY=/awips2/edex/data/utility +--- 47,77 ---- if [ $? -ne 0 ]; then exit 1 fi @@ -67,38 +63,58 @@ diff -crB a/component.spec b/component.spec ! unzip %{_baseline_workspace}/build.edex/edex/dist/edex-datadelivery.zip \ -d %{_build_root} - if [ $? -ne 0 ]; then - exit 1 - fi ++ if [ $? -ne 0 ]; then ++ exit 1 ++ fi + # include the init.d script + INSTALLER_RPM="%{_baseline_workspace}/rpms" + EDEX_DATADELIVERY="${INSTALLER_RPM}/awips2.edex/Installer.edex-datadelivery" + cp -v ${EDEX_DATADELIVERY}/scripts/init.d/* \ + %{_build_root}/etc/init.d -+ if [ $? -ne 0 ]; then -+ exit 1 -+ fi + if [ $? -ne 0 ]; then + exit 1 + fi + # rename the script to prevent naming conflicts during installation + pushd . > /dev/null 2>&1 + cd %{_build_root}/etc/init.d + mv edexServiceList edexServiceList-datadelivery + popd > /dev/null 2>&1 -+ + + #create a list of all files packaged for /awips2/edex/data/utility + UTILITY=/awips2/edex/data/utility +*************** +*** 64,70 **** + %pre %post -+ # replace the service list script with the datadelivery service list script -+ if [ -f /etc/init.d/edexServiceList ]; then -+ mv /etc/init.d/edexServiceList /etc/init.d/edexServiceList.orig -+ if [ $? -ne 0 ]; then -+ exit 1 -+ fi -+ fi -+ mv /etc/init.d/edexServiceList-datadelivery /etc/init.d/edexServiceList -+ if [ $? -ne 0 ]; then -+ exit 1 -+ fi -+ +! + + #change date stamp of utility files + UTILITY=/awips2/edex/data/utility +--- 82,98 ---- + + %pre + %post +! # replace the service list script with the datadelivery service list script +! if [ -f /etc/init.d/edexServiceList ]; then +! mv /etc/init.d/edexServiceList /etc/init.d/edexServiceList.orig +! if [ $? -ne 0 ]; then +! exit 1 +! fi +! fi +! mv /etc/init.d/edexServiceList-datadelivery /etc/init.d/edexServiceList +! if [ $? -ne 0 ]; then +! exit 1 +! fi + + #change date stamp of utility files + UTILITY=/awips2/edex/data/utility +*************** +*** 78,83 **** +--- 106,122 ---- + fi + %preun + if [ "${1}" = "1" ]; then + exit 0 @@ -115,11 +131,10 @@ diff -crB a/component.spec b/component.spec %clean *************** -*** 67,69 **** ---- 109,113 ---- +*** 88,90 **** +--- 127,131 ---- %dir /awips2 %dir /awips2/edex /awips2/edex/* + + %attr(744,root,root) /etc/init.d/* -\ No newline at end of file diff --git a/rpms/awips2.edex/Installer.edex-shapefiles/component.spec b/rpms/awips2.edex/Installer.edex-shapefiles/component.spec index f11dbd8b4d..f3a34c1aeb 100644 --- a/rpms/awips2.edex/Installer.edex-shapefiles/component.spec +++ b/rpms/awips2.edex/Installer.edex-shapefiles/component.spec @@ -76,10 +76,30 @@ if [ $? -ne 0 ]; then exit 1 fi + +#create a list of all files packaged for /awips2/edex/data/utility +UTILITY=/awips2/edex/data/utility +if [ -d %{_build_root}/$UTILITY ]; then + cd %{_build_root}/$UTILITY + find . -type f > %{_build_root}/awips2/edex/util_filelist.%{name}.txt +fi + %pre %post + +#change date stamp of utility files +UTILITY=/awips2/edex/data/utility +UTIL_FILENAME=/awips2/edex/util_filelist.%{name}.txt +if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then + while read fileName + do + touch "$UTILITY/$fileName" + done < $UTIL_FILENAME + rm -f $UTIL_FILENAME +fi + %preun %postun diff --git a/rpms/awips2.edex/Installer.edex/component.spec b/rpms/awips2.edex/Installer.edex/component.spec index f9a973d417..338f2222b3 100644 --- a/rpms/awips2.edex/Installer.edex/component.spec +++ b/rpms/awips2.edex/Installer.edex/component.spec @@ -108,6 +108,15 @@ if [ $? -ne 0 ]; then exit 1 fi + +#create a list of all files packaged for /awips2/edex/data/utility +UTILITY=/awips2/edex/data/utility +if [ -d %{_build_root}/$UTILITY ]; then + cd %{_build_root}/$UTILITY + find . -type f > %{_build_root}/awips2/edex/etc/util_filelist.%{name}.txt +fi + + %pre %post @@ -146,6 +155,18 @@ if [ -d /awips2/.edex ]; then rm -rf /awips2/.edex fi +#change date stamp of utility files +UTILITY=/awips2/edex/data/utility +UTIL_FILENAME=/awips2/edex/etc/util_filelist.%{name}.txt +if [ -d $UTILITY ] && [ -f $UTIL_FILENAME ]; then + while read fileName + do + touch "$UTILITY/$fileName" + done < $UTIL_FILENAME + rm -f $UTIL_FILENAME +fi + + %preun if [ "${1}" = "1" ]; then exit 0