ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject ambari git commit: AMBARI-9117 Ambari Upgrade leaves empty package directory after services were moved to common services (jluniya)
Date Wed, 14 Jan 2015 19:08:15 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 477899fb4 -> 0d2a6cbf2


AMBARI-9117 Ambari Upgrade leaves empty package directory after services were moved to common
services (jluniya)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0d2a6cbf
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0d2a6cbf
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0d2a6cbf

Branch: refs/heads/trunk
Commit: 0d2a6cbf2b3020ea020380cecd52801f5d6b7287
Parents: 477899f
Author: Jayush Luniya <jluniya@hortonworks.com>
Authored: Wed Jan 14 11:08:06 2015 -0800
Committer: Jayush Luniya <jluniya@hortonworks.com>
Committed: Wed Jan 14 11:08:06 2015 -0800

----------------------------------------------------------------------
 ambari-agent/src/main/package/deb/control/preinst  | 16 ++++++++++++++++
 ambari-agent/src/main/package/rpm/preinstall.sh    | 16 ++++++++++++++++
 ambari-server/src/main/package/deb/control/preinst | 10 +++++++++-
 ambari-server/src/main/package/rpm/preinstall.sh   | 10 +++++++++-
 4 files changed, 50 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0d2a6cbf/ambari-agent/src/main/package/deb/control/preinst
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/package/deb/control/preinst b/ambari-agent/src/main/package/deb/control/preinst
index 017cf0a..b8611c2 100644
--- a/ambari-agent/src/main/package/deb/control/preinst
+++ b/ambari-agent/src/main/package/deb/control/preinst
@@ -14,6 +14,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License
 
+STACKS_FOLDER="/var/lib/ambari-agent/cache/stacks"
+STACKS_FOLDER_OLD=/var/lib/ambari-agent/cache/stacks_$(date '+%d_%m_%y_%H_%M').old
+
+COMMON_SERVICES_FOLDER="/var/lib/ambari-agent/cache/common-services"
+COMMON_SERVICES_FOLDER_OLD=/var/lib/ambari-agent/cache/common-services_$(date '+%d_%m_%y_%H_%M').old
+
 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
@@ -24,4 +30,14 @@ ORIG=/etc/ambari-agent/conf/ambari-agent.ini
 
 [ -f $ORIG ] && mv -f $ORIG $BAK
 
+if [ -d "$STACKS_FOLDER" ]
+then
+    mv -f "$STACKS_FOLDER" "$STACKS_FOLDER_OLD"
+fi
+
+if [ -d "$COMMON_SERVICES_FOLDER_OLD" ]
+then
+    mv -f "$COMMON_SERVICES_FOLDER" "$COMMON_SERVICES_FOLDER_OLD"
+fi
+
 exit 0

http://git-wip-us.apache.org/repos/asf/ambari/blob/0d2a6cbf/ambari-agent/src/main/package/rpm/preinstall.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/package/rpm/preinstall.sh b/ambari-agent/src/main/package/rpm/preinstall.sh
index 72b1f30..fc6719b 100644
--- a/ambari-agent/src/main/package/rpm/preinstall.sh
+++ b/ambari-agent/src/main/package/rpm/preinstall.sh
@@ -13,6 +13,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License
 
+STACKS_FOLDER="/var/lib/ambari-agent/cache/stacks"
+STACKS_FOLDER_OLD=/var/lib/ambari-agent/cache/stacks_$(date '+%d_%m_%y_%H_%M').old
+
+COMMON_SERVICES_FOLDER="/var/lib/ambari-agent/cache/common-services"
+COMMON_SERVICES_FOLDER_OLD=/var/lib/ambari-agent/cache/common-services_$(date '+%d_%m_%y_%H_%M').old
+
 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
@@ -23,4 +29,14 @@ ORIG=/etc/ambari-agent/conf/ambari-agent.ini
 
 [ -f $ORIG ] && mv -f $ORIG $BAK
 
+if [ -d "$STACKS_FOLDER" ]
+then
+    mv -f "$STACKS_FOLDER" "$STACKS_FOLDER_OLD"
+fi
+
+if [ -d "$COMMON_SERVICES_FOLDER_OLD" ]
+then
+    mv -f "$COMMON_SERVICES_FOLDER" "$COMMON_SERVICES_FOLDER_OLD"
+fi
+
 exit 0

http://git-wip-us.apache.org/repos/asf/ambari/blob/0d2a6cbf/ambari-server/src/main/package/deb/control/preinst
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/package/deb/control/preinst b/ambari-server/src/main/package/deb/control/preinst
index 171e817..142bcf7 100644
--- a/ambari-server/src/main/package/deb/control/preinst
+++ b/ambari-server/src/main/package/deb/control/preinst
@@ -17,6 +17,9 @@
 STACKS_FOLDER="/var/lib/ambari-server/resources/stacks"
 STACKS_FOLDER_OLD=/var/lib/ambari-server/resources/stacks_$(date '+%d_%m_%y_%H_%M').old
 
+COMMON_SERVICES_FOLDER="/var/lib/ambari-server/resources/common-services"
+COMMON_SERVICES_FOLDER_OLD=/var/lib/ambari-server/resources/common-services_$(date '+%d_%m_%y_%H_%M').old
+
 if [ -d "/etc/ambari-server/conf.save" ]
 then
     mv /etc/ambari-server/conf.save /etc/ambari-server/conf_$(date '+%d_%m_%y_%H_%M').save
@@ -24,7 +27,12 @@ fi
 
 if [ -d "$STACKS_FOLDER" ]
 then
-    cp -r "$STACKS_FOLDER" "$STACKS_FOLDER_OLD"
+    mv -f "$STACKS_FOLDER" "$STACKS_FOLDER_OLD"
+fi
+
+if [ -d "$COMMON_SERVICES_FOLDER_OLD" ]
+then
+    mv -f "$COMMON_SERVICES_FOLDER" "$COMMON_SERVICES_FOLDER_OLD"
 fi
 
 exit 0

http://git-wip-us.apache.org/repos/asf/ambari/blob/0d2a6cbf/ambari-server/src/main/package/rpm/preinstall.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/package/rpm/preinstall.sh b/ambari-server/src/main/package/rpm/preinstall.sh
index 35090d7..6db7481 100644
--- a/ambari-server/src/main/package/rpm/preinstall.sh
+++ b/ambari-server/src/main/package/rpm/preinstall.sh
@@ -16,6 +16,9 @@
 STACKS_FOLDER="/var/lib/ambari-server/resources/stacks"
 STACKS_FOLDER_OLD=/var/lib/ambari-server/resources/stacks_$(date '+%d_%m_%y_%H_%M').old
 
+COMMON_SERVICES_FOLDER="/var/lib/ambari-server/resources/common-services"
+COMMON_SERVICES_FOLDER_OLD=/var/lib/ambari-server/resources/common-services_$(date '+%d_%m_%y_%H_%M').old
+
 if [ -d "/etc/ambari-server/conf.save" ]
 then
     mv /etc/ambari-server/conf.save /etc/ambari-server/conf_$(date '+%d_%m_%y_%H_%M').save
@@ -23,7 +26,12 @@ fi
 
 if [ -d "$STACKS_FOLDER" ]
 then
-    cp -r "$STACKS_FOLDER" "$STACKS_FOLDER_OLD"
+    mv -f "$STACKS_FOLDER" "$STACKS_FOLDER_OLD"
+fi
+
+if [ -d "$COMMON_SERVICES_FOLDER_OLD" ]
+then
+    mv -f "$COMMON_SERVICES_FOLDER" "$COMMON_SERVICES_FOLDER_OLD"
 fi
 
 exit 0
\ No newline at end of file


Mime
View raw message