From 7138f2a20ff8f4f35b050fb6c94c4b33dff630df Mon Sep 17 00:00:00 2001 From: Bryan Kowal Date: Sat, 5 Jan 2013 10:40:10 -0600 Subject: [PATCH] Issue #1373 - prevent file naming conflicts Change-Id: Ibf3996983a0df3eee39fd5bc7d65bf43044c0e02 Former-commit-id: 94fe1c8f59f02a1cb34aee4face2077fa8346e12 [formerly 9079c2dd3fd847064da8a713d06bfe3772f33dbd] [formerly 94fe1c8f59f02a1cb34aee4face2077fa8346e12 [formerly 9079c2dd3fd847064da8a713d06bfe3772f33dbd] [formerly 2c9e5d68fa765815155a38995a68004f77e9d9b1 [formerly b7c11d1a5d55908a9e60e29b68fa01bf924c1429]]] Former-commit-id: 2c9e5d68fa765815155a38995a68004f77e9d9b1 Former-commit-id: 5aed64be97c40e3ca51f88279832d6025b4820c6 [formerly 6580901b03039803d9ccf038a203d413c5377ec6] Former-commit-id: ad30a7fb6afbf084914f6d33b4e690416b4a0b88 --- .../datadelivery.patch0 | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 b/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 index 13100f764f..74c0cf27c8 100644 --- a/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 +++ b/rpms/awips2.edex/Installer.edex-datadelivery/datadelivery.patch0 @@ -1,6 +1,6 @@ diff -crB a/component.spec b/component.spec -*** a/component.spec 2013-01-04 11:35:41.000000000 -0600 ---- b/component.spec 2013-01-04 11:35:57.000000000 -0600 +*** a/component.spec 2013-01-05 09:43:38.000000000 -0600 +--- b/component.spec 2013-01-05 09:49:43.000000000 -0600 *************** *** 1,13 **** # @@ -48,7 +48,7 @@ diff -crB a/component.spec b/component.spec requires: awips2-edex-base requires: awips2-python *************** -*** 40,57 **** +*** 40,58 **** rm -rf %{_build_root} fi mkdir -p %{_build_root} @@ -67,7 +67,8 @@ diff -crB a/component.spec b/component.spec %post %preun %postun ---- 40,80 ---- + +--- 40,88 ---- rm -rf %{_build_root} fi mkdir -p %{_build_root} @@ -94,21 +95,29 @@ diff -crB a/component.spec b/component.spec + 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 + %pre -+ # since, we will be overriding the services that are started -+ # we will begin by removing any existing edexServiceList scripts + %post ++ # replace the service list script with the datadelivery service list script + if [ -f /etc/init.d/edexServiceList ]; then + rm -f /etc/init.d/edexServiceList + if [ $? -ne 0 ]; then -+ # fail the install + exit 1 + fi + fi ++ mv /etc/init.d/edexServiceList-datadelivery /etc/init.d/edexServiceList ++ if [ $? -ne 0 ]; then ++ exit 1 ++ fi + - %post %preun %postun + *************** *** 63,66 **** %defattr(644,awips,fxalpha,755) @@ -116,11 +125,10 @@ diff -crB a/component.spec b/component.spec %dir /awips2/edex ! /awips2/edex/* \ No newline at end of file ---- 86,91 ---- +--- 93,98 ---- %defattr(644,awips,fxalpha,755) %dir /awips2 %dir /awips2/edex ! /awips2/edex/* ! ! %attr(744,root,root) /etc/init.d/* -\ No newline at end of file