diff --git a/common/code/boost_libraries.php b/common/code/boost_libraries.php index f64406d9..720f8492 100644 --- a/common/code/boost_libraries.php +++ b/common/code/boost_libraries.php @@ -151,9 +151,7 @@ class boost_libraries $import = json_decode($json, true); if (!$import) { - // TODO: Proper error handling. - echo "Error decoding json: $json\n"; - exit(0); + throw new library_decode_exception("Error decoding json.", $json); } if ($json[0] == '{') { @@ -687,5 +685,17 @@ class boost_libraries } class boost_libraries_exception extends RuntimeException {} +class library_decode_exception extends boost_libraries_exception { + private $content = ''; + + function __construct($message, $content) { + parent::__construct($message); + $this->content = $content; + } + + public function content() { + return $this->content; + } +} ?> diff --git a/common/code/boost_version.php b/common/code/boost_version.php index c0be5ec1..2ba9948b 100644 --- a/common/code/boost_version.php +++ b/common/code/boost_version.php @@ -182,6 +182,12 @@ class BoostVersion { ($this->is_beta() ? '_beta'. $this->beta : ''); } + /** Return the git tag/branch for the version */ + function git_ref() { + return $this->version['stage'] ? $this->stage_name() : + 'boost-'.implode('.', $this->version_numbers()); + } + /** Return the version numbers from the verion array */ private function version_numbers() { $numbers = $this->version; diff --git a/doc/libraries.xml b/doc/libraries.xml index 3ec69c3f..e2ae096d 100644 --- a/doc/libraries.xml +++ b/doc/libraries.xml @@ -252,6 +252,33 @@ Domain System + + chrono + chrono + 1.47.0 + master + Chrono + Howard Hinnant + Beman Dawes + Vicente J. Botet Escriba + Vicente J. Botet Escriba <vicente.botet -at- wanadoo.fr> + Useful time utilities. C++11. + libs/chrono/ + proposal + Domain + System + + + chrono/stopwatch + chrono + master + Chrono.Stopwatch + Vicente J. Botet Escriba + Vicente J. Botet Escriba <vicente.botet -at- wanadoo.fr> + Useful stopclocks and stopwatches utilities. + libs/chrono/stopwatches/ + Domain + circular_buffer circular_buffer @@ -332,7 +359,7 @@ conversion conversion 1.20.0 - develop + master Conversion Dave Abrahams Kevlin Henney @@ -751,7 +778,7 @@ lexical_cast lexical_cast 1.20.0 - develop + master Lexical Cast Kevlin Henney Antony Polukhin <antoshkka -at- gmail.com> @@ -760,6 +787,19 @@ Miscellaneous String + + lexical_cast + lexical_cast + 1.20.0 + develop + Lexical Cast + Kevlin Henney + Antony Polukhin <antoshkka -at- gmail.com> + General literal text conversions, such as an int represented a string, or vice-versa. + libs/lexical_cast/lexical_cast.htm + Miscellaneous + String + local_function local_function @@ -1009,7 +1049,7 @@ numeric/conversion - numeric/conversion + numeric_conversion 1.32.0 Numeric Conversion Fernando Cacciola @@ -1020,7 +1060,7 @@ numeric/interval - numeric/interval + interval 1.30.0 Interval Guillaume Melquiond @@ -1032,7 +1072,7 @@ numeric/odeint - numeric/odeint + odeint 1.53.0 Odeint Karsten Ahnert @@ -1043,7 +1083,7 @@ numeric/ublas - numeric/ublas + ublas 1.29.0 uBLAS Joerg Walter @@ -1238,6 +1278,21 @@ libs/ratio/ Math + + ratio + ratio + 1.47.0 + develop + Ratio + Howard Hinnant + Beman Dawes + Vicente J. Botet Escriba + Vicente J. Botet Escriba <vicente.botet -at- wanadoo.fr> + Compile time rational arithmetic. C++11. + libs/ratio/ + proposal + Math + rational rational @@ -1409,6 +1464,22 @@ Concurrent System + + thread + thread + 1.25.0 + master + Thread + Anthony Williams + Vicente J. Botet Escriba + Vicente J. Botet Escriba <vicente.botet -at- wanadoo.fr> + Niall Douglas <niall -at- nedprod.com> + Portable C++ multi-threading. C++11, C++14. + libs/thread/ + proposal + Concurrent + System + throw_exception throw_exception diff --git a/generated/libraries.txt b/generated/libraries.txt index 46f70c99..aa8e5dcd 100644 Binary files a/generated/libraries.txt and b/generated/libraries.txt differ diff --git a/site-tools/create-module-metadata.php b/site-tools/create-module-metadata.php index 8ee1124d..dc9375a8 100644 --- a/site-tools/create-module-metadata.php +++ b/site-tools/create-module-metadata.php @@ -1,6 +1,7 @@ get_for_version(BoostVersion::develop()); + $library_details = + boost_libraries::from_xml_file(__DIR__ . '/../doc/libraries.xml') + ->get_for_version(BoostVersion::develop()); + $git_submodules = (new BoostSuperProject($boost_root))->get_modules(); + // Get the library data, so that it can be updated with maintainers. // In case you're wondering why the result from get_for_version doesn't @@ -64,9 +68,14 @@ function main() { foreach ($library_details as $library) { $module = $library['module']; + if (!isset($git_submodules[$module])) { + echo "Unknown module: {$module}\n"; + continue; + } + if (isset($library['documentation'])) { $doc_url = $library['documentation']; - $module_base = "libs/$module"; + $module_base = $git_submodules[$module]['path']; if ($doc_url == $module_base) { $doc_url = ''; @@ -93,12 +102,12 @@ function main() { foreach ($libraries_by_module as $module => $libraries) { $module_libraries = boost_libraries::from_array($libraries); - $module_dir = "$boost_root/libs/$module"; + $module_dir = "{$boost_root}/{$git_submodules[$module]['path']}"; $meta_dir = "$module_dir/meta"; $meta_file = "$module_dir/meta/libraries.json"; if (!is_dir($module_dir)) { - echo "Module doesn't exist: $module\n"; + echo "Module '$module' doesn't exist at '$module_dir'\n"; continue; } diff --git a/site-tools/update-doc-list.php b/site-tools/update-doc-list.php index 9668f296..5b0a0b94 100644 --- a/site-tools/update-doc-list.php +++ b/site-tools/update-doc-list.php @@ -17,22 +17,25 @@ function main() { exit(1); } - // TODO: Support releases. - if ($version && !in_array($version, ['master', 'develop', 'latest'])) { - echo "Invalid version: $version\n"; - exit(1); + if ($version) { + // BoostVersion dies if version is invalid. + $version = BoostVersion::from($version); } $libs = boost_libraries::from_xml_file(dirname(__FILE__) . '/../doc/libraries.xml'); if ($location) { - $location = realpath($location); + $real_location = realpath($location); - if (is_file($location)) + if ($real_location && !is_dir($real_location)) { - update_from_file($libs, $location, $version); + echo "Not a directory: {$location}\n"; + exit(1); } - else if (get_bool_from_array(run_process( + + $location = $real_location; + + if (get_bool_from_array(run_process( "cd '${location}' && git rev-parse --is-bare-repository"))) { if ($version) { @@ -68,13 +71,13 @@ function main() { * * @param \boost_libraries $libs The libraries to update. * @param string $location The location of the super project in the mirror. - * @param string $branch The branch to update from. + * @param BoostVersion|string $version The version to update from. * @throws RuntimeException */ -function update_from_git($libs, $location, $branch) { +function update_from_git($libs, $location, $version) { + $branch = BoostVersion::from($version)->git_ref(); echo "Updating from {$branch}\n"; - $git_command = "cd '${location}' && git"; $super_project = new BoostSuperProject($location, $branch); $modules = $super_project->get_modules(); @@ -104,12 +107,17 @@ function update_from_git($libs, $location, $branch) { foreach(run_process("{$module_command} ls-tree {$module['hash']} " ."meta/libraries.xml meta/libraries.json") as $entry) { - $entry = trim($entry); - if (preg_match("@^100644 blob ([a-zA-Z0-9]+)\t(.*)$@", $entry, $matches)) { - $hash = $matches[1]; - $filename = $matches[2]; - $text = implode("\n", (run_process("{$module_command} show {$hash}"))); - $libs->update(load_from_text($text, $filename, $branch), $name); + try { + $entry = trim($entry); + if (preg_match("@^100644 blob ([a-zA-Z0-9]+)\t(.*)$@", $entry, $matches)) { + $hash = $matches[1]; + $filename = $matches[2]; + $text = implode("\n", (run_process("{$module_command} show {$hash}"))); + $libs->update(load_from_text($text, $filename, $branch), $name); + } + } + catch (library_decode_exception $e) { + echo "Error decoding metadata for module {$name}:\n{$e->content()}\n"; } } } @@ -130,16 +138,16 @@ function update_from_local_copy($libs, $location, $branch = 'latest') { foreach ( glob("{$location}/{$module_details['path']}/meta/libraries.*") as $path) { - $libs->update(load_from_file($path, $branch), $name); + try { + $libs->update(load_from_file($path, $branch), $name); + } + catch (library_decode_exception $e) { + echo "Error decoding metadata for module {$name}:\n{$e->content()}\n"; + } } } } -function update_from_file($libs, $location, $version) { - echo "Updated from local file\n"; - $libs->update(load_from_file($location, $version)); -} - function load_from_file($path, $branch) { return load_from_text(file_get_contents($path), $path, $branch); }