From 4ff763fd5931f366e596b0c7172c24fb457fccb8 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 28 Feb 2016 10:20:50 +0000 Subject: [PATCH] Remove metadata bootstrap scripts. Since everything's running okay now, they're not needed. --- site-tools/backdate-maintainers.php | 82 -------------------------- site-tools/create-module-metadata.php | 83 --------------------------- 2 files changed, 165 deletions(-) delete mode 100755 site-tools/backdate-maintainers.php delete mode 100755 site-tools/create-module-metadata.php diff --git a/site-tools/backdate-maintainers.php b/site-tools/backdate-maintainers.php deleted file mode 100755 index 73ffb7dd..00000000 --- a/site-tools/backdate-maintainers.php +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env php -get_for_version($tag, null, - 'BoostLibraries::filter_all'); - - $libs_index = array(); - foreach ($library_details as $index => $details) { - $libs_index[$details['key']] = $index; - } - - foreach(BoostMaintainers::read_from_text( - git_file($location, $tag, 'libs/maintainers.txt'))->maintainers - as $key => $lib_maintainers) - { - if (isset($libs_index[$key])) { - $index = $libs_index[$key]; - $library_details[$index]['maintainers'] = - $lib_maintainers; - } - else { - $unknown_libs[$key][] = $tag; - } - } - - $update = array_map(function($lib) { - return new BoostLibrary($lib); - }, $library_details); - - $libraries->update($tag, $update); - } - } - - file_put_contents(dirname(__FILE__) . '/../doc/libraries.xml', - $libraries->to_xml()); - - $names = array_keys($unknown_libs); - sort($names); - echo "Unable to find libraries:\n"; - foreach ($names as $lib) { - echo "{$lib} from: ".implode(', ', $unknown_libs[$lib])."\n"; - } -} - -function git_file($location, $ref, $path) { - foreach(BoostSuperProject::run_process( - "git -C {$location} ls-tree {$ref} {$path}") as $entry) - { - if (!preg_match("@^100644 blob ([a-zA-Z0-9]+)\t(.*)$@", - $entry, $matches)) { assert(false); } - return BoostSuperProject::run_process( - "git -C {$location} show {$matches[1]}"); - } - return false; -} - -main(); diff --git a/site-tools/create-module-metadata.php b/site-tools/create-module-metadata.php deleted file mode 100755 index 36a7e133..00000000 --- a/site-tools/create-module-metadata.php +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env php -get_for_version(BoostVersion::develop()); - $super_project = new BoostSuperProject($boost_root); - $git_submodules = $super_project->get_modules(); - - // Split the libraries up into modules. - - $libraries_by_module = array(); - - 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 = $git_submodules[$module]['path']; - - if ($doc_url == $module_base) { - $doc_url = ''; - } - else if (strpos($doc_url, "$module_base/") === 0) { - $doc_url = substr($doc_url, strlen("$module_base/")); - } - else { - $doc_url = "/$doc_url"; - } - - if (!$doc_url) { - unset($library['documentation']); - } - else { - $library['documentation'] = $doc_url; - } - } - - $libraries_by_module[$module][] = $library; - } - - // Write the module metadata - - foreach ($libraries_by_module as $module => $libraries) { - $module_libraries = BoostLibraries::from_array($libraries); - $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 '$module' doesn't exist at '$module_dir'\n"; - continue; - } - - if (!is_dir($meta_dir)) { - mkdir($meta_dir); - } - - file_put_contents($meta_file, $module_libraries->to_json( - array('boost-version', 'update-version', 'module'))."\n"); - } -} - - -main();