Commit 8734e0f5 authored by anarcat's avatar anarcat Committed by anarcat

store the aegir version in a single place: the .info file

we still need to update it in the INSTALL.txt and UPGRADE.txt unfortunately
parent d41e1c51
......@@ -7,7 +7,8 @@
function drush_provision_hostmaster_install_validate($site = NULL) {
// set defaults for this whole script
// those are settings that are not prompted to the user but still overridable
$version = drush_set_default('version', drush_get_option('version', 'HEAD'));
drush_set_default('version', provision_version());
$version = drush_get_option('version');
$aegir_root = drush_set_default('aegir_root', drush_server_home());
drush_set_default('root', $aegir_root . '/' . 'hostmaster-' . $version);
drush_set_default('r', drush_get_option('root'));
......
......@@ -26,11 +26,10 @@
# 2. downloads provision in $AEGIR_HOME/.drush
# 3. delegate the rest of the install to hostmaster-install
########################################################################
# basic variables, change before release
AEGIR_VERSION="HEAD"
DRUSH_VERSION=6.x-3.3
# when adding a variable here, add it to the display below
# guess the aegir version based on the info file
AEGIR_VERSION=`sed -n '/^version/{s/^.*= //;p}' provision.info`
DRUSH_VERSION=6.x-3.3
########################################################################
# functions
......
......@@ -298,6 +298,13 @@ function provision_backend_invoke($target, $command, $arguments = array(), $opti
return drush_backend_invoke_args('@' . ltrim($target, '@') . ' ' . $command, $arguments, $options + array('root' => null, 'uri' => null), $mode);
}
/**
* parse the .ini file to get the aegir version
*/
function provision_version() {
$ini = parse_ini_file(dirname(__FILE__) . '/provision.info');
return $ini['version'];
}
/**
* A base class for the service and file handling classes that implements
......
......@@ -83,9 +83,9 @@ sed -i'.tmp' -e'/^projects\[hostmaster\]\[download\]\[type\]/s/=.*$/ = "get"/' \
echo changing INSTALL.txt to point to tagged install.sh
sed -i'.tmp' -e"/http:\/\/git.aegirproject.org\/?p=provision.git;a=blob_plain;f=install.sh.txt;hb=HEAD/s/HEAD/provision-$version/" docs/INSTALL.txt && git add docs/INSTALL.txt && rm docs/INSTALL.txt.tmp
echo changing INSTALL.txt to point hostmaster-install --version to tag
sed -i'.tmp' -e"s/--version=HEAD/--version=$version/" docs/INSTALL.txt
git add docs/INSTALL.txt && rm docs/INSTALL.txt.tmp
echo changing hostmaster-install version
sed -i'.tmp' -e"s/version =.*$/version = $version/" provision.info
git add provision.info && rm provision.info.tmp
echo changing UPGRADE.txt to point to tagged upgrade.sh
sed -i'.tmp' -e"/http:\/\/git.aegirproject.org\/?p=provision.git;a=blob_plain;f=upgrade.sh.txt;hb=HEAD/s/HEAD/provision-$version/" docs/UPGRADE.txt && git add docs/UPGRADE.txt && rm docs/UPGRADE.txt.tmp
......@@ -98,12 +98,6 @@ if ! [ -z "$old_version" ]; then
fi
git add docs/UPGRADE.txt && rm docs/UPGRADE.txt.tmp
echo changing install.sh.txt version
sed -i'.tmp' -e"s/AEGIR_VERSION=.*$/AEGIR_VERSION=\"$version\"/" install.sh.txt && git add install.sh.txt && rm install.sh.txt.tmp
echo changing upgrade.sh.txt version
sed -i'.tmp' -e"s/AEGIR_VERSION=.*$/AEGIR_VERSION=\"$version\"/" upgrade.sh.txt && git add upgrade.sh.txt && rm upgrade.sh.txt.tmp
echo resulting changes to be committed:
git diff --cached | cat
......
......@@ -11,7 +11,7 @@
########################################################################
# basic variables, change before running
AEGIR_VERSION=HEAD
AEGIR_VERSION=`sed -n '/^version/{s/^.*= //;p}' provision.info`
AEGIR_DOMAIN=aegir.example.com
AEGIR_DIR=/var/aegir
......
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