Commit 86ddda82 authored by anarcat's avatar anarcat

some comments in the postinst to clarify what it does

parent 335ca74f
......@@ -28,8 +28,8 @@ VARLIB="/var/aegir"
case "$1" in
# fetch the version number from the makefile. the line we're looking for looks like this
# projects[hostmaster][download][url] = ""
# fetch the version number from provision. the line we're looking for looks like this
# version=6.x-1.9
# this obviously doesn't work for git releases
VERSION=`sed -n '/^version/{s/^.*= *//;p}' /usr/share/drush/commands/provision/`
......@@ -45,12 +45,15 @@ case "$1" in
su -s /bin/sh aegir -c 'drush --pipe @hostmaster status | egrep "site_uri|drupal_root"' >> $TEMPFILE || true
if grep -q 'site_uri' $TEMPFILE; then
# upgrade
echo "Aegir frontend (@hostmaster) site detected in $drupal_root"
# make those paths canonical to make sure we can compare correctly
NEW_PLATFORM=`readlink -f "$VARLIB/hostmaster-$VERSION"`
drupal_root=`readlink -f $drupal_root`
# we upgrade only if the target platform doesn't exit *OR*
# if it's not the current platform
if [ -d "$NEW_PLATFORM" ] && [ "$drupal_root" = "$NEW_PLATFORM" ]; then
echo "it seems to be the same version as the one we're trying to install, not upgrading"
......@@ -63,6 +66,7 @@ case "$1" in
echo "upgrade finished, old platform $platform left in $drupal_root"
# fresh install
db_get "aegir/site"
if [ ! -z "$RET" ]; then
......@@ -78,6 +82,7 @@ case "$1" in
# forget the DB password in debconf storage
db_reset aegir/db_password || true
db_fset aegir/db_password "seen" "true" || true
......@@ -87,7 +92,7 @@ case "$1" in
exit 1
echo "installing the Aegir frontend (Drupal with the hostmaster profile), please wait..."
# pass data through JSON
# pass data through JSON for extra security
su aegir -c "cd $VARLIB && drush hostmaster-install $FLAGS --backend $site_uri | drush backend-parse" <<EOF
{ "yes": 1,
"version": "$VERSION",
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment