Replace the upgradefluxfile builtin with a seperate upgrade-flux-file tool.

This allows us to remove all the SQL stuff from the main program, and restores
the ability to upgrade from version 2 SQL files.
This commit is contained in:
David Given
2022-02-04 21:27:24 +01:00
parent 091ef6d972
commit 89688394f8
23 changed files with 334 additions and 479 deletions

View File

@@ -53,10 +53,8 @@ std::unique_ptr<FluxSource> FluxSource::createFl2FluxSource(const Fl2FluxSourceP
char buffer[16];
std::ifstream(config.filename(), std::ios::in | std::ios::binary).read(buffer, 16);
if (strncmp(buffer, "SQLite format 3", 16) == 0)
{
std::cerr << "Warning: reading a deprecated flux file format; please upgrade it\n";
return FluxSource::createSqliteFluxSource(config.filename());
}
Error() << "this flux file is too old; please use the upgrade-flux-file to upgrade it";
return std::unique_ptr<FluxSource>(new Fl2FluxSource(config));
}