summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Beaupré2011-03-31 18:57:49 (GMT)
committerAntoine Beaupré2011-03-31 18:57:49 (GMT)
commit5c0e77d685306d3a55bf61dbe53ec8c09ecbca64 (patch)
tree521fe89214eb617b767281a875b3fec26d9fd7fd
parentcc598189ea04a2f56a317a01bfb6a00f2d02422e (diff)
cleanup empty platforms on upgradedebian/1.0.rc3-4
-rw-r--r--debian/aegir-hostmaster.postinst8
1 files changed, 8 insertions, 0 deletions
diff --git a/debian/aegir-hostmaster.postinst b/debian/aegir-hostmaster.postinst
index 5959092..38ede10 100644
--- a/debian/aegir-hostmaster.postinst
+++ b/debian/aegir-hostmaster.postinst
@@ -53,6 +53,14 @@ case "$1" in
echo "upgrading the frontend from $drupal_root to $NEW_PLATFORM"
cd "$drupal_root"
su -s /bin/sh aegir -c "drush hostmaster-migrate $FLAGS '$site_uri' '$NEW_PLATFORM'"
+ cd $HOME
+ sites=`ls "$drupal_root/sites" | egrep -v '^all|default$'`
+ if [ -z "$sites" ]; then
+ echo "backing up old platform to $HOME/backups/$drupal_root.tgz"
+ tar -c -z -f "$HOME/backups/$drupal_root.tgz" "$drupal_root"
+ echo "removing old platform from $HOME/$drupal_root"
+ rm -rf "$HOME/$drupal_root"
+ fi
fi
else
db_get "aegir/site"