You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by gu...@apache.org on 2022/06/21 04:48:31 UTC

[bigtop] branch master updated: BIGTOP-3705: Refine the Ambari RPM spec to fix warning after rpm uninstallation (#914)

This is an automated email from the ASF dual-hosted git repository.

guyuqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new de9ee89a BIGTOP-3705: Refine the Ambari RPM spec to fix warning after rpm uninstallation (#914)
de9ee89a is described below

commit de9ee89a2e5afbf9f305e76b9ca034cfb67b0f07
Author: Yuqi Gu <yu...@arm.com>
AuthorDate: Tue Jun 21 12:48:27 2022 +0800

    BIGTOP-3705: Refine the Ambari RPM spec to fix warning after rpm uninstallation (#914)
    
    Duplicated deleting operation ('%files' and '%preun%') in Ambari RPM spec
    makes some warning issues when uninstalling Ambari rpm.
    And '%config' in spec would create 'xxx.rpmsave' which was no longer needed.
    
    Change-Id: Ic0f8a469ce69641e0482a3c7fcc259bd56f33c40
    Signed-off-by: Yuqi Gu <yu...@arm.com>
---
 bigtop-packages/src/rpm/ambari/SPECS/ambari.spec | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/bigtop-packages/src/rpm/ambari/SPECS/ambari.spec b/bigtop-packages/src/rpm/ambari/SPECS/ambari.spec
index fda3ae92..a9238cdb 100644
--- a/bigtop-packages/src/rpm/ambari/SPECS/ambari.spec
+++ b/bigtop-packages/src/rpm/ambari/SPECS/ambari.spec
@@ -199,7 +199,11 @@ if [ "$1" -eq 0 ]; then  # Action is uninstall
         rm /usr/sbin/ambari-server
     fi
 
-    mv /etc/ambari-server/conf /etc/ambari-server/conf.save
+    if [ -d "/etc/ambari-server/conf" ]; then
+        # Save conf files here instead of '%config'(auto generating xxx.rpmsave)
+        # '/etc/ambari-server/conf' would be auto-removed in '%files'
+        cp -rp /etc/ambari-server/conf /etc/ambari-server/conf.save
+    fi
 
     if [ -f "/var/lib/ambari-server/install-helper.sh" ]; then
       /var/lib/ambari-server/install-helper.sh remove
@@ -391,7 +395,10 @@ if [ "$1" -eq 0 ]; then  # Action is uninstall
     if [ -d "/etc/ambari-agent/conf.save" ]; then
         mv /etc/ambari-agent/conf.save /etc/ambari-agent/conf_$(date '+%d_%m_%y_%H_%M').save
     fi
-    mv /etc/ambari-agent/conf /etc/ambari-agent/conf.save
+
+    if [ -d "/etc/ambari-agent/conf" ]; then
+        cp -rp /etc/ambari-agent/conf /etc/ambari-agent/conf.save
+    fi
 
     if [ -f "/var/lib/ambari-agent/install-helper.sh" ]; then
       /var/lib/ambari-agent/install-helper.sh remove
@@ -453,7 +460,7 @@ exit 0
 %attr(755,root,root) %{initd_dir}/ambari-server
 /var/lib/ambari-server
 %attr(755,root,root) /var/lib/ambari-server/ambari-python-wrap
-%config  /etc/ambari-server/conf
+/etc/ambari-server/conf
 %config %attr(700,root,root) /var/lib/ambari-server//ambari-env.sh
 %attr(700,root,root) /var/lib/ambari-server//ambari-sudo.sh
 %attr(700,root,root) /var/lib/ambari-server//install-helper.sh
@@ -481,6 +488,7 @@ exit 0
 %attr(755,root,root) /usr/lib/ambari-agent/lib/ambari_jinja2
 %attr(755,root,root) /usr/lib/ambari-agent/lib/ambari_simplejson
 %attr(755,root,root) /usr/lib/ambari-agent/lib/examples
+/etc/ambari-agent/conf
 %attr(755,root,root) /etc/ambari-agent/conf/ambari-agent.ini
 %attr(755,root,root) /etc/ambari-agent/conf/logging.conf.sample
 %attr(755,root,root) /var/lib/ambari-agent/bin/ambari-agent