2
0
mirror of https://github.com/boostorg/website.git synced 2026-01-29 20:12:14 +00:00
Files
website/site-tools/load-release.data.php
Daniel James ace57b73a7 Distinguish between boost/bjam releases
I was thinking about resolving this by removing the release data for
bjam, but instead support different release names. Even though this is
currently just for one special case, might be useful in the future.
2016-11-14 22:53:35 +00:00

54 lines
1.4 KiB
PHP
Executable File

#!/usr/bin/env php
<?php
define ('LOAD_RELEASE_DATA_USAGE', "
Usage: {} path
Loads the release data from the file specified by 'path'.
File format is:
Download page URL
Output of sha256sum
For example:
https://sourceforge.net/projects/boost/files/boost/1.62.0/
b91c2cda8bee73ea613130e19e72c9589e9ef0357c4c5cc5f7523de82cce11f7 boost_1_62_0.7z
36c96b0f6155c98404091d8ceb48319a28279ca0333fba1ad8611eb90afb2ca0 boost_1_62_0.tar.bz2
440a59f8bc4023dbe6285c9998b0f7fa288468b889746b1ef00e8b36c559dce1 boost_1_62_0.tar.gz
084b2e0638bbe0975a9e43e21bc9ceae33ef11377aecab3268a57cf41e405d4e boost_1_62_0.zip
");
require_once(__DIR__.'/../common/code/bootstrap.php');
function main() {
$options = BoostSiteTools\CommandLineOptions::parse(
LOAD_RELEASE_DATA_USAGE);
if (count ($options->positional) != 1) {
echo $options->usage_message();
exit(1);
}
$path = realpath($options->positional[0]);
if (!$path) {
echo "Unable to find release file: {$options->positional[0]}\n";
exit(1);
}
$release_details = file_get_contents($path);
if (!$release_details) {
echo "Error reading release file: {$options->positional[0]}\n";
exit(1);
}
$releases = new BoostReleases(__DIR__.'/../generated/state/release.txt');
$releases->loadReleaseInfo('boost', $release_details);
$releases->save();
}
main();