Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put all build packages in one directory #20745

Merged
merged 1 commit into from
Jun 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions build/build.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
/**
* Script used to build Joomla distribution archive packages
* Builds upgrade packages in tmp/packagesx.x folder (for example, 'build/tmp/packages2.5')
* Builds full packages in tmp/packages_fullx.x.x folder (for example, 'build/tmp/packages_full2.5.1')
* Builds packages in tmp/packages folder (for example, 'build/tmp/packages')
*
* Note: the new package must be tagged in your git repository BEFORE doing this
* It uses the git tag for the new version, not trunk.
Expand Down Expand Up @@ -109,7 +108,7 @@ function usage($command)
chdir($tmp);
system('mkdir diffdocs');
system('mkdir diffconvert');
system('mkdir packages' . $version);
system('mkdir packages');

echo "Create list of changed files from git repository for version $fullVersion.\n";

Expand Down Expand Up @@ -285,22 +284,22 @@ function usage($command)
if (!$excludeBzip2)
{
$packageName = 'Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.bz2';
system('tar --create --bzip2 --no-recursion --directory ' . $time . ' --file packages' . $version . '/' . $packageName . ' --files-from diffconvert/' . $version . '.' . $num . '> /dev/null');
system('tar --create --bzip2 --no-recursion --directory ' . $time . ' --file packages/' . $packageName . ' --files-from diffconvert/' . $version . '.' . $num . '> /dev/null');
$checksums[$packageName] = array();
}

if (!$excludeGzip)
{
$packageName = 'Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.gz';
system('tar --create --gzip --no-recursion --directory ' . $time . ' --file packages' . $version . '/' . $packageName . ' --files-from diffconvert/' . $version . '.' . $num . '> /dev/null');
system('tar --create --gzip --no-recursion --directory ' . $time . ' --file packages/' . $packageName . ' --files-from diffconvert/' . $version . '.' . $num . '> /dev/null');
$checksums[$packageName] = array();
}

if (!$excludeZip)
{
$packageName = 'Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.zip';
chdir($time);
system('zip ../packages' . $version . '/' . $packageName . ' -@ < ../diffconvert/' . $version . '.' . $num . '> /dev/null');
system('zip ../packages/' . $packageName . ' -@ < ../diffconvert/' . $version . '.' . $num . '> /dev/null');
chdir('..');
$checksums[$packageName] = array();
}
Expand All @@ -314,8 +313,6 @@ function usage($command)
system('rm -rf ' . $time . '/' . $removeFile);
}

// Recreate empty directories before creating new archives.
system('mkdir packages_full' . $fullVersion);
echo "Build full package files.\n";
chdir($time);

Expand All @@ -326,21 +323,21 @@ function usage($command)
if (!$excludeBzip2)
{
$packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.bz2';
system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null');
system('tar --create --bzip2 --file ../packages/' . $packageName . ' * > /dev/null');
$checksums[$packageName] = array();
}

if (!$excludeGzip)
{
$packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.gz';
system('tar --create --gzip --file ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null');
system('tar --create --gzip --file ../packages/' . $packageName . ' * > /dev/null');
$checksums[$packageName] = array();
}

if (!$excludeZip)
{
$packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.zip';
system('zip -r ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null');
system('zip -r ../packages/' . $packageName . ' * > /dev/null');
$checksums[$packageName] = array();
}

Expand All @@ -360,21 +357,21 @@ function usage($command)
if (!$excludeBzip2)
{
$packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.bz2';
system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null');
system('tar --create --bzip2 --file ../packages/' . $packageName . ' * > /dev/null');
$checksums[$packageName] = array();
}

if (!$excludeGzip)
{
$packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.gz';
system('tar --create --gzip --file ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null');
system('tar --create --gzip --file ../packages/' . $packageName . ' * > /dev/null');
$checksums[$packageName] = array();
}

if (!$excludeZip)
{
$packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.zip';
system('zip -r ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null');
system('zip -r ../packages/' . $packageName . ' * > /dev/null');
$checksums[$packageName] = array();
}

Expand All @@ -386,13 +383,9 @@ function usage($command)

foreach (array('md5', 'sha1') as $hash)
{
if (file_exists('packages' . $version . '/' . $packageName))
if (file_exists('packages/' . $packageName))
{
$checksums[$packageName][$hash] = hash_file($hash, 'packages' . $version . '/' . $packageName);
}
elseif (file_exists('packages_full' . $fullVersion . '/' . $packageName))
{
$checksums[$packageName][$hash] = hash_file($hash, 'packages_full' . $fullVersion . '/' . $packageName);
$checksums[$packageName][$hash] = hash_file($hash, 'packages/' . $packageName);
}
else
{
Expand Down