aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-12-19 15:23:09 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-12-19 15:23:09 +0100
commiteac19fb5f63b012cd88a5970bcb392c598021a41 (patch)
tree4b262a2c18c850f3e9b62d474841c155ec7cb7de
parente3e34add7f725457b2a6e4809bbfdd6fa576203d (diff)
downloadforums-eac19fb5f63b012cd88a5970bcb392c598021a41.tar
forums-eac19fb5f63b012cd88a5970bcb392c598021a41.tar.gz
forums-eac19fb5f63b012cd88a5970bcb392c598021a41.tar.bz2
forums-eac19fb5f63b012cd88a5970bcb392c598021a41.tar.xz
forums-eac19fb5f63b012cd88a5970bcb392c598021a41.zip
[ticket/12030] Include config directory completly in update packages
When one of the config files was updated, we need to include all config files because they are referenced relative from the files themselves. PHPBB3-12030
-rwxr-xr-xbuild/package.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/build/package.php b/build/package.php
index d05448dfb4..d80a09cc59 100755
--- a/build/package.php
+++ b/build/package.php
@@ -174,6 +174,21 @@ if (sizeof($package->old_packages))
$package->run_command('cp ' . $source_filename . ' ' . $dest_filename);
}
+ /**
+ * When we create the update packages, we try to make them as small as possible.
+ * However sometimes we need to include additional files, that are not included
+ * in the diff, in order to able to correctly include the relative referenced
+ * files from the same or subsequent directories.
+ */
+ $copy_relative_directories = array(
+ 'config/' => array(
+ 'copied' => false,
+ 'copy' => array(
+ 'config/*.yml' => 'config',
+ ),
+ ),
+ );
+
// Then fill the 'new' directory
foreach ($file_contents['all'] as $file)
{
@@ -205,6 +220,38 @@ 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($file, $reference) === 0 && !$data['copied'])
+ {
+ foreach ($data['copy'] as $source_dir_files => $destination_dir)
+ {
+ // Create Directories along the way?
+ $directories = explode('/', $directory);
+
+ chdir($dest_filename_dir . '/install/update/new');
+ foreach ($destination_dir 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