diff options
author | Tristan Darricau <tristan.darricau@ensimag.grenoble-inp.fr> | 2014-05-05 16:19:09 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-05-05 16:38:21 +0200 |
commit | 81ac5e7a0085fb972af8aaf13f0da337f3971c6f (patch) | |
tree | ae1160c92ee10d71fbfc957224857417fed51c22 | |
parent | c5f5520013102ccdbec051701e12e96068423f0b (diff) | |
download | forums-81ac5e7a0085fb972af8aaf13f0da337f3971c6f.tar forums-81ac5e7a0085fb972af8aaf13f0da337f3971c6f.tar.gz forums-81ac5e7a0085fb972af8aaf13f0da337f3971c6f.tar.bz2 forums-81ac5e7a0085fb972af8aaf13f0da337f3971c6f.tar.xz forums-81ac5e7a0085fb972af8aaf13f0da337f3971c6f.zip |
[ticket/12325] Add files located in deleted dirs
PHPBB3-12325
-rw-r--r-- | build/build_helper.php | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/build/build_helper.php b/build/build_helper.php index 756176a135..4300803872 100644 --- a/build/build_helper.php +++ b/build/build_helper.php @@ -328,8 +328,9 @@ class build_package } $line = str_replace('Only in ' . $package_name, '', $line); + $line = ltrim($line, '/'); - if (substr(0, 1, $line) == '/') + if (substr($line, 0, 1) == ':') { $replace = ''; } @@ -339,11 +340,36 @@ class build_package } $line = str_replace(': ', $replace, $line); - $line = ltrim($line, '/'); - $result[] = $line; + if (is_dir("{$this->locations['old_versions']}{$package_name}/{$line}")) + { + $this->add_files_recursive($result, "{$this->locations['old_versions']}{$package_name}/{$line}", $line); + } + else + { + $result[] = $line; + } } return $result; } + + function add_files_recursive(array &$result, $directory_absolute, $directory) + { + $files = scandir($directory_absolute); + foreach ($files as $file) + { + if (is_dir($directory_absolute . '/' . $file)) + { + if ($file != '.' && $file != '..') + { + $this->add_files_recursive($result, $directory_absolute . '/' . $file, $directory . '/' . $file); + } + } + else + { + $result[] = $directory . '/' . $file; + } + } + } } |