Commit 1e7baa90 authored by Aaron Wells's avatar Aaron Wells

Bug fixes to the new release script

parent f46580f6
...@@ -13,32 +13,37 @@ define('CLI', 1); ...@@ -13,32 +13,37 @@ define('CLI', 1);
# the changelog. # the changelog.
# #
$usage = <<<STRING
Usage is ${argv[0]} [version] [branch] [<changesetnumber>...]
e.g. ${argv[0]} 16.04.3 16.04_STABLE
e.g. ${argv[0]} 15.10.1 15.10_STABLE 5793 5795
STRING;
if (count($argv) < 3) { if (count($argv) < 3) {
echo "Usage is ${argv[0]} [version] [branch] [<changesetnumber>...]\n"; echo $usage;
echo "e.g. ${argv[0]} 16.04.3 16.04_STABLE\n";
echo "e.g. ${argv[0]} 15.10.1 15.10_STABLE 5793 5795\n";
exit(1); exit(1);
} }
# Check for git gpg lp-project-upload # Check for git gpg lp-project-upload
if (!@is_executable('/usr/bin/gpg')) { if (!@is_executable('/usr/bin/gpg')) {
echo "You need to install gpg: apt-get install gnupg"; echo "You need to install gpg: apt-get install gnupg\n";
exit(1); exit(1);
} }
if (!@is_executable('/usr/bin/git')) { if (!@is_executable('/usr/bin/git')) {
echo "You need to install git: apt-get install git-core"; echo "You need to install git: apt-get install git-core\n";
exit(1); exit(1);
} }
if (!@is_executable('/usr/bin/lp-project-upload')) { if (!@is_executable('/usr/bin/lp-project-upload')) {
echo "You need to install lp-project-upload: apt-get install ubuntu-dev-tools (maverick or earlier) or lptools"; echo "You need to install lp-project-upload: apt-get install ubuntu-dev-tools (maverick or earlier) or lptools\n";
exit(1); exit(1);
} }
if (!@is_executable('/usr/bin/m4')) { if (!@is_executable('/usr/bin/m4')) {
echo "You need to install m4: apt-get install m4"; echo "You need to install m4: apt-get install m4\n";
exit(1); exit(1);
} }
...@@ -46,7 +51,7 @@ $GIT_MAJOR = `git --version | cut -d' ' -f 3 | cut -d'.' -f 1`; ...@@ -46,7 +51,7 @@ $GIT_MAJOR = `git --version | cut -d' ' -f 3 | cut -d'.' -f 1`;
$GIT_MINOR = `git --version | cut -d' ' -f 3 | cut -d'.' -f 2`; $GIT_MINOR = `git --version | cut -d' ' -f 3 | cut -d'.' -f 2`;
if ($GIT_MAJOR < 1 || ($GIT_MAJOR == 1 && $GIT_MINOR < 6 )) { if ($GIT_MAJOR < 1 || ($GIT_MAJOR == 1 && $GIT_MINOR < 6 )) {
echo "Your version of git is too old. Install git 1.6."; echo "Your version of git is too old. Install git 1.6.\n";
exit(1); exit(1);
} }
...@@ -56,7 +61,8 @@ $VERSION=$argv[1]; ...@@ -56,7 +61,8 @@ $VERSION=$argv[1];
$result = preg_match('/([0-9]+\.[0-9]+)(\.|rc)([0-9]+)/i', $VERSION, $matches); $result = preg_match('/([0-9]+\.[0-9]+)(\.|rc)([0-9]+)/i', $VERSION, $matches);
if (!$result) { if (!$result) {
echo "Invalid version number. It must match the pattern \"15.04.1\" or \"15.04rc1\"."; echo "Invalid version number. It must match the pattern \"15.04.1\" or \"15.04rc1\".\n";
echo $usage;
exit(1); exit(1);
} }
$MAJOR = $matches[1]; $MAJOR = $matches[1];
...@@ -193,7 +199,7 @@ passthru("git tag -s ${RELEASETAG} -m \"$RELEASE release\""); ...@@ -193,7 +199,7 @@ passthru("git tag -s ${RELEASETAG} -m \"$RELEASE release\"");
# Build the css # Build the css
if ($OLDVERSION >= 2015091700) { if ($OLDVERSION >= 2015091700) {
echo "Building css...\n"; echo "Building css...\n";
echo `make css >> ../css.log 2>&1`; passthru("make css >> ../css.log 2>&1");
if (!file_exists('htdocs/theme/raw/style/style.css')) { if (!file_exists('htdocs/theme/raw/style/style.css')) {
echo "CSS files did not build correctly! Check $BUILDDIR/css.log for details."; echo "CSS files did not build correctly! Check $BUILDDIR/css.log for details.";
exit(1); exit(1);
...@@ -264,14 +270,17 @@ else { ...@@ -264,14 +270,17 @@ else {
# Prepare release notes # Prepare release notes
// TODO: Replace this with a simple find/replace, to remove the m4 dependency // TODO: Replace this with a simple find/replace, to remove the m4 dependency
$TMP_M4_FILE = '/tmp/mahara-releasenotes.m4.tmp'; $TMP_M4_FILE = '/tmp/mahara-releasenotes.m4.tmp';
passthru("sed 's/^/ * /g' ${CURRENTDIR}/changes.temp >> ${CURRENTDIR}/changes.noasterisks.temp");
$m4script = <<<STRING $m4script = <<<STRING
changecom changecom
define(\\`__RELEASE__',\\`${RELEASE}')dnl define(`__RELEASE__',`${RELEASE}')dnl
define(\\`__OLDRELEASE__',\\`${OLDRELEASE}')dnl define(`__OLDRELEASE__',`${OLDRELEASE}')dnl
define(\\`__MAJOR__',\\`${MAJOR}')dnl define(`__MAJOR__',`${MAJOR}')dnl
define(`__CHANGES__',`include(`${CURRENTDIR}/changes.noasterisks.temp')')dnl
STRING; STRING;
file_put_contents($TMP_M4_FILE, $m4script); file_put_contents($TMP_M4_FILE, $m4script);
if ($releasecandidate) { if ($releasecandidate) {
$TEMPLATE = 'releasenotes.rc.template'; $TEMPLATE = 'releasenotes.rc.template';
} }
......
...@@ -10,6 +10,3 @@ upgrade, we encourage you to make a copy of your website and test the ...@@ -10,6 +10,3 @@ upgrade, we encourage you to make a copy of your website and test the
upgrade on it first, to minimise the effect of any potential upgrade on it first, to minimise the effect of any potential
unforeseen problems. unforeseen problems.
Changes from __OLDRELEASE__:
__CHANGES__
\ No newline at end of file
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