Commit c3d1d63e authored by Aaron Wells's avatar Aaron Wells

Fixing a few problems in the PHP version

parent 2072de0b
...@@ -171,35 +171,36 @@ if ($OLDVERSION >= 2015091700) { ...@@ -171,35 +171,36 @@ if ($OLDVERSION >= 2015091700) {
} }
# Package up the release # Package up the release
$PACKAGEDIR = $BUILDDIR . '/mahara-' . $VERSION; $PACKAGEDIR = 'mahara-' . $VERSION;
echo "Package directory: $PACKAGEDIR\n"; echo "Package directory: $BUILDDIR/$PACKAGEDIR\n";
passthru("cp -r $BUILDDIR/mahara $PACKAGEDIR"); passthru("cp -r $BUILDDIR/mahara $BUILDDIR/$PACKAGEDIR");
chdir("$PACKAGEDIR"); chdir("$BUILDDIR/$PACKAGEDIR");
# Delete everything that shouldn't be included # Delete everything that shouldn't be included
if (getcwd() != "$PACKAGEDIR" || $PACKAGEDIR == '') { if (getcwd() != "$BUILDDIR/$PACKAGEDIR" || $PACKAGEDIR == '') {
echo "Couldn't cd into the right directory"; echo "Couldn't cd into the right directory";
exit(1); exit(1);
} }
passthru('find . -type d -name ".git" -execdir rm -Rf {} \; 2> /dev/null'); passthru('find . -type d -name ".git" -execdir rm -Rf {} \; 2> /dev/null');
passthru('find . -type f -name ".gitignore" -execdir rm -Rf {} \; 2> /dev/null');
passthru('find . -type d -name "node_modules" -execdir rm -Rf {} \; 2> /dev/null'); passthru('find . -type d -name "node_modules" -execdir rm -Rf {} \; 2> /dev/null');
passthru('find . -type f -name "gulpfile.js" -execdir rm -Rf {} \; 2> /dev/null'); passthru('find . -type f -name "gulpfile.js" -execdir rm -Rf {} \; 2> /dev/null');
passthru('find htdocs/theme -type d -name "sass" -execdir rm -Rf {} \; 2> /dev/null'); passthru('find htdocs/theme -type d -name "sass" -execdir rm -Rf {} \; 2> /dev/null');
passthru("rm -Rf test"); passthru("rm -Rf test");
passthru("rm -Rf .gitattributes"); passthru("rm -Rf .gitattributes");
passthru("rm -Rf .gitignore");
passthru("rm -Rf Makefile"); passthru("rm -Rf Makefile");
passthru("rm -Rf phpunit.xml"); passthru("rm -Rf phpunit.xml");
passthru("rm -Rf external"); passthru("rm -Rf external");
passthru("rm -Rf package.json"); passthru("rm -Rf package.json");
passthru("rm -Rf ChangeLog.back");
# Get the location for all phpunit directories # Get the location for all phpunit directories
$phpunitdirs = explode("\n", `find . -type d -name 'phpunit' -path '*/tests/phpunit'`); $phpunitdirs = explode("\n", `find . -type d -name 'phpunit' -path '*/tests/phpunit' 2> /dev/null`);
foreach ($phpunitdirs as $dir) { foreach ($phpunitdirs as $dir) {
$parentdir = dirname($dir); $parentdir = dirname($dir);
# Determine whether the parent directory contains anything other than # Determine whether the parent directory contains anything other than
# phpunit. If not, remove the whole parent directory. # phpunit. If not, remove the whole parent directory.
$siblings = explode("\n", `find "$parentdir" -maxdepth 1 -mindepth 1`); $siblings = explode("\n", `find "$parentdir" -maxdepth 1 -mindepth 1 2> /dev/null`);
if (count($siblings) == 1) { if (count($siblings) == 1) {
passthru("rm -Rf $parentdir"); passthru("rm -Rf $parentdir");
} }
...@@ -215,7 +216,7 @@ passthru("tar c $PACKAGEDIR | gzip -9 > ${CURRENTDIR}/mahara-${RELEASE}.tar.gz") ...@@ -215,7 +216,7 @@ passthru("tar c $PACKAGEDIR | gzip -9 > ${CURRENTDIR}/mahara-${RELEASE}.tar.gz")
echo "Creating mahara-${RELEASE}.tar.bz2\n"; echo "Creating mahara-${RELEASE}.tar.bz2\n";
passthru("tar c $PACKAGEDIR | bzip2 -9 > ${CURRENTDIR}/mahara-${RELEASE}.tar.bz2"); passthru("tar c $PACKAGEDIR | bzip2 -9 > ${CURRENTDIR}/mahara-${RELEASE}.tar.bz2");
echo "Creating mahara-${RELEASE}.zip\n"; echo "Creating mahara-${RELEASE}.zip\n";
passthru("zip ${CURRENTDIR}/mahara-${RELEASE}.zip $PACKAGEDIR"); passthru("zip -rq ${CURRENTDIR}/mahara-${RELEASE}.zip $PACKAGEDIR");
# Save git changelog # Save git changelog
...@@ -232,12 +233,13 @@ else { ...@@ -232,12 +233,13 @@ 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-releasnotes.m4.tmp'; $TMP_M4_FILE = '/tmp/mahara-releasenotes.m4.tmp';
$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
STRING; STRING;
file_put_contents($TMP_M4_FILE, $m4script); file_put_contents($TMP_M4_FILE, $m4script);
if ($releasecandidate) { if ($releasecandidate) {
......
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