diff options
Diffstat (limited to 'build/package.php')
-rwxr-xr-x | build/package.php | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/build/package.php b/build/package.php index 22ea4e52af..89f9d9a1ee 100755 --- a/build/package.php +++ b/build/package.php @@ -121,6 +121,7 @@ if (sizeof($package->old_packages)) $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $dest_filename_dir); $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $dest_filename_dir); + $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $dest_filename_dir); $package->run_command('mkdir ' . $dest_filename_dir . '/install/update'); $package->run_command('mkdir ' . $dest_filename_dir . '/install/update/old'); @@ -173,6 +174,27 @@ if (sizeof($package->old_packages)) $package->run_command('cp ' . $source_filename . ' ' . $dest_filename); } + /** + * We try to keep the update packages as small as possible while creating them. + * However, we sometimes need to include additional files that are not included + * in the diff in order to be able to correctly include the relatively + * referenced files from the same or subsequent directories. + */ + $copy_relative_directories = array( + 'adm/style/admin.css' => array( + 'copied' => false, + 'copy' => array( + 'adm/images/*' => 'adm/images', + ), + ), + 'config/' => array( + 'copied' => false, + 'copy' => array( + 'config/*.yml' => 'config', + ), + ), + ); + // Then fill the 'new' directory foreach ($file_contents['all'] as $file) { @@ -184,6 +206,8 @@ if (sizeof($package->old_packages)) continue; } + $filename = $file; + // Create Directories along the way? $file = explode('/', $file); // Remove filename portion @@ -204,6 +228,37 @@ if (sizeof($package->old_packages)) } $package->run_command('cp ' . $source_filename . ' ' . $dest_filename); + + foreach ($copy_relative_directories as $reference => $data) + { + // Copy all relative referenced files if needed + if (strpos($filename, $reference) === 0 && !$data['copied']) + { + foreach ($data['copy'] as $source_dir_files => $destination_dir) + { + // Create directories along the way? + $directories = explode('/', $destination_dir); + + chdir($dest_filename_dir . '/install/update/new'); + foreach ($directories as $dir) + { + $dir = trim($dir); + if ($dir) + { + if (!file_exists('./' . $dir)) + { + $package->run_command('mkdir ' . $dir); + } + chdir('./' . $dir); + } + } + $source_dir_files = $package->locations['old_versions'] . $package->get('simple_name') . '/' . $source_dir_files; + $destination_dir = $dest_filename_dir . '/install/update/new/' . $destination_dir; + $package->run_command('cp ' . $source_dir_files . ' ' . $destination_dir); + } + $copy_relative_directories[$reference]['copied'] = true; + } + } } // Build index.php file for holding the file structure @@ -256,6 +311,7 @@ $update_info = array( // Copy the install files to their respective locations $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('patch_directory')); $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('patch_directory')); + $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $package->get('patch_directory')); // Remove some files chdir($package->get('patch_directory') . '/install'); @@ -372,14 +428,22 @@ chdir($package->get('dest_dir') . '/install'); // $package->run_command('rm -v database_update.php'); $package->run_command('rm -v install_update.php'); +chdir($package->get('dest_dir')); +$package->run_command('mv -v styles/subsilver2 ../subsilver2'); +$package->run_command('cp -p docs/COPYING ../subsilver2/license.txt'); + chdir($package->locations['package_dir']); foreach ($compress_programs as $extension => $compress_command) { $package->begin_status('Packaging phpBB for ' . $extension); $package->run_command('rm -v ./release_files/' . $package->get('release_filename') . ".{$extension}"); + $package->run_command('rm -v ./release_files/subsilver2_' . $package->get('new_version_number') . ".{$extension}"); // Build Package $package->run_command("$compress_command ./release_files/" . $package->get('release_filename') . '.' . $extension . ' ' . $package->get('package_name')); + + // Build subSilver2 Package + $package->run_command("$compress_command ./release_files/subsilver2_" . $package->get('new_version_number') . '.' . $extension . ' subsilver2'); } // Microsoft Web PI packaging |