From 6bb9ff707a660985cabbf907bc3cc211a2ce6847 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 4 Jul 2016 22:45:49 +0100 Subject: [PATCH] Use same function for reading from release/local checkout. Was read_metadata_from_release, but renamed to read_metadata_from_filesystem. This is possible since it no longer depends on git modules at all. --- site-tools/update-doc-list.php | 35 +++------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/site-tools/update-doc-list.php b/site-tools/update-doc-list.php index 6fe4f25a..93ef27ce 100755 --- a/site-tools/update-doc-list.php +++ b/site-tools/update-doc-list.php @@ -69,7 +69,7 @@ function main() { exit(1); } - $updates[(string) $version] = read_metadata_from_release($location, $version); + $updates[(string) $version] = read_metadata_from_filesystem($location, $version); } else if (get_bool_from_array(BoostSuperProject::run_process( "cd '${location}' && git rev-parse --is-bare-repository"))) @@ -90,7 +90,7 @@ function main() { exit(1); } - $updates[(string) $version] = read_metadata_from_local_clone($location, $version); + $updates[(string) $version] = read_metadata_from_filesystem($location, $version); } } @@ -172,42 +172,13 @@ function read_metadata_from_git($location, $version) { return $updated_libs; } -/** - * - * @param string $location The location of the super project in the mirror. - * @param string $branch The branch to update from. - * @throws RuntimeException - */ -function read_metadata_from_local_clone($location, $branch = 'latest') { - global $quiet; - if (!$quiet) { echo "Updating from local checkout/{$branch}\n"; } - - $super_project = new BoostSuperProject($location); - $updated_libs = array(); - foreach ($super_project->get_modules() as $name => $module_details) { - foreach ( - glob("{$location}/{$module_details['path']}/meta/libraries.*") - as $path) { - try { - $updated_libs = array_merge($updated_libs, - load_from_file($path, $module_details['path'])); - } - catch (library_decode_exception $e) { - echo "Error decoding metadata for module {$name}:\n{$e->content()}\n"; - } - } - } - - return $updated_libs; -} - /** * * @param string $location The location of the super project in the mirror. * @param BoostVersion $version The version of the release. * @throws RuntimeException */ -function read_metadata_from_release($location, $version) { +function read_metadata_from_filesystem($location, $version) { // We don't have a list for modules, so have to work it out from the // existing library data.