Install SeisComP and scanloc ARM64 nightly packages

This commit is contained in:
Enrico Ellguth
2025-10-29 12:34:04 +00:00
parent 2ff097f9d1
commit 165b829fb7
606 changed files with 24438 additions and 16358 deletions

View File

@ -21,6 +21,7 @@
#ifndef SEISCOMP_SYSTEM_APPLICATION_H
#define SEISCOMP_SYSTEM_APPLICATION_H
#include <seiscomp/core/exceptions.h>
#include <seiscomp/core/interruptible.h>
#include <seiscomp/config/config.h>
@ -48,6 +49,25 @@ class Application;
namespace Detail {
template <typename T>
bool convertString(T &value, const std::string &str) {
using namespace Seiscomp::Core;
return fromString(value, str);
}
template <typename T>
bool convertString(Core::Optional<T> &value, const std::string &str) {
using namespace Seiscomp::Core;
T tmp;
if ( !fromString(tmp, str) ) {
return false;
}
value = tmp;
return true;
}
template <typename T>
T getConfig(const Application *app, const std::string &symbol, bool asPath);
@ -785,7 +805,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
template <typename T>
struct IsNativelySupported {
enum {
value = Generic::Detail::IsClassType<T>::value ?
value = Generic::Detail::IsClassType<T>::value ?
(
std::is_same<std::string,T>::value ?
1
@ -875,7 +895,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
hasOption = proc._external.constCli->hasOption(visitedItem.cliAbsoluteSymbol);
if ( hasOption )
return fromString(visitedItem.value, proc._proxyValueStore[&visitedItem.value]);
return Detail::convertString(visitedItem.value, proc._proxyValueStore[&visitedItem.value]);
else
return true;
}
@ -936,7 +956,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
Detail::join(prefix, visitedItem.configFileRelativeSymbol),
visitedItem.flags & OptionBinding<T>::InterpretAsPath
);
return fromString(visitedItem.value, tmp);
return Detail::convertString(visitedItem.value, tmp);
}
catch ( ... ) {}
@ -962,7 +982,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
);
visitedItem.value.resize(tmp.size());
for ( size_t i = 0; i < tmp.size(); ++i ) {
if ( !fromString(visitedItem.value[i], tmp[i]) )
if ( !Detail::convertString(visitedItem.value[i], tmp[i]) )
return false;
}
}
@ -988,7 +1008,11 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
visitedItem.flags & OptionBinding<T>::InterpretAsPath
);
}
catch ( ... ) {}
catch ( Config::OptionNotFoundException &e ) {}
catch ( ... ) {
// All other exceptions are not OK.
return false;
}
}
return true;
}
@ -1000,6 +1024,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
template <typename T>
struct PrintHelper<T,0> {
static void process(std::ostream &os, const T &value, bool) {
using namespace Seiscomp::Core;
os << toString(value);
}
};
@ -1051,10 +1076,11 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
template <typename T>
struct PrintHelper<std::vector<T>,1> {
static void process(std::ostream &os, const std::vector<T> &value) {
using namespace Seiscomp::Core;
if ( value.empty() )
os << "[]";
else
os << Core::toString(value);
os << toString(value);
}
};
@ -1179,9 +1205,6 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
static bool _handleCrash;
static bool _handleTermination;
int _argc;
char **_argv;
std::string _name;
Arguments _arguments;
@ -1204,7 +1227,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
BaseSettings();
std::string alternativeConfigFile;
bool enableDaemon;
bool enableDaemon{true};
std::string crashHandler;
std::string lockfile;
std::string plugins;
@ -1219,7 +1242,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
bool syslog{false};
#endif
bool context{false};
int component{-1};
OPT(bool) component;
bool toStdout{false};
bool UTC{false};
std::string alternativeLogFile;
@ -1258,7 +1281,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
& cfg(UTC, "utc")
& cfg(file, "file")
& cli(
& cliSwitch(
quiet,
"Verbose", "quiet,q",
"Quiet mode: no logging output"
@ -1325,7 +1348,7 @@ class SC_SYSTEM_CORE_API Application : public Core::InterruptibleObject {
}
} logging;
virtual void accept(SettingsLinker &linker);
virtual void accept(SettingsLinker &linker) override;
} _baseSettings;
};

View File

@ -48,31 +48,31 @@ class SC_SYSTEM_CORE_API CommandLine {
// Public interface
// ----------------------------------------------------------------------
public:
void addGroup(const char*);
bool addGroup(const char*);
void addOption(const char* group, const char* option,
const char* description);
bool addOption(const char *group, const char *option,
const char *description);
template <typename T>
void addOption(const char* group, const char* option,
const char* description, T* storage,
bool addOption(const char *group, const char *option,
const char *description, T *storage,
bool storageAsDefault = true);
template <typename T>
void addOption(const char* group, const char* option,
const char* description, std::vector<T>* storage);
bool addOption(const char *group, const char *option,
const char *description, std::vector<T> *storage);
template <typename T, typename DT>
void addOption(const char* group, const char* option,
const char* description, T* storage,
const DT& defaultValue);
bool addOption(const char *group, const char *option,
const char *description, T *storage,
const DT &defaultValue);
template <typename T>
void addCustomOption(const char* group, const char* option,
const char* description, T* customValidator);
bool addCustomOption(const char *group, const char *option,
const char *description, T *customValidator);
bool parse(int argc, char** argv);
bool parse(int argc, char** argv, std::function<bool(const std::string &)> unknownArgumentFilter);
bool parse(const std::vector<std::string> &args);
bool parse(const std::vector<std::string> &args, std::function<bool(const std::string &)> unknownArgumentFilter);
void printOptions() const;
@ -81,10 +81,10 @@ class SC_SYSTEM_CORE_API CommandLine {
* This does not apply to mapped parameters from the
* configuration file.
*/
bool hasOption(const std::string& option) const;
bool hasOption(const std::string &option) const;
template <typename T>
T option(const std::string& option) const;
T option(const std::string &option) const;
template <typename T, int LEN>
T option(const char (&option)[LEN]) const;
@ -101,8 +101,8 @@ class SC_SYSTEM_CORE_API CommandLine {
typedef boost::program_options::options_description options_description;
typedef boost::program_options::variables_map variables_map;
options_description* findGroup(const char* group,
const char* option = nullptr) const;
options_description* findGroup(const char *group,
const char *option = nullptr) const;
// ----------------------------------------------------------------------

View File

@ -19,16 +19,22 @@
template <typename T>
void CommandLine::addOption(const char* group, const char* option,
const char* description, T* storage,
bool CommandLine::addOption(const char *group, const char *option,
const char *description, T *storage,
bool storageAsDefault) {
options_description* o = findGroup(group);
if ( o ) {
if ( storageAsDefault && storage )
(options_description_easy_init(o))(option, boost::program_options::value<T>(storage)->default_value(*storage), description);
else
(options_description_easy_init(o))(option, boost::program_options::value<T>(storage), description);
auto g = findGroup(group);
if ( !g ) {
return false;
}
if ( storageAsDefault && storage ) {
(options_description_easy_init(g))(option, boost::program_options::value<T>(storage)->default_value(*storage), description);
}
else {
(options_description_easy_init(g))(option, boost::program_options::value<T>(storage), description);
}
return true;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -37,18 +43,17 @@ void CommandLine::addOption(const char* group, const char* option,
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
void CommandLine::addOption(const char* group, const char* option,
const char* description,
std::vector<T>* storage) {
options_description* o = findGroup(group);
if ( o )
// NOTE: Because of a bug in boost 1.33.1 the option multitoken() eats up
// all arguments until the end of the commandline. So multitoken works
// only for switches at the end of the commandline. To make it work
// multitoken is disabled. So one has to give the option multiple times.
// e.g.: 'test -i foo -i bar -j' instead of 'test -i foo bar -j'
//(options_description_easy_init(o))(option, boost::program_options::value<std::vector<T> >(&storage)->multitoken(), description);
(options_description_easy_init(o))(option, boost::program_options::value<std::vector<T> >(storage), description);
bool CommandLine::addOption(const char *group, const char *option,
const char *description,
std::vector<T> *storage) {
auto g = findGroup(group);
if ( !g ) {
return false;
}
(options_description_easy_init(g))(option, boost::program_options::value<std::vector<T> >(storage), description);
return true;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -57,12 +62,17 @@ void CommandLine::addOption(const char* group, const char* option,
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T, typename DT>
void CommandLine::addOption(const char* group, const char* option,
const char* description, T* storage,
const DT& defaultValue) {
options_description* o = findGroup(group);
if ( o )
(options_description_easy_init(o))(option, boost::program_options::value<T>(storage)->default_value(defaultValue), description);
bool CommandLine::addOption(const char * group, const char *option,
const char * description, T *storage,
const DT &defaultValue) {
auto g = findGroup(group);
if ( !g ) {
return false;
}
(options_description_easy_init(g))(option, boost::program_options::value<T>(storage)->default_value(defaultValue), description);
return true;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -71,13 +81,18 @@ void CommandLine::addOption(const char* group, const char* option,
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
template <typename T>
void CommandLine::addCustomOption(const char* group,
bool CommandLine::addCustomOption(const char* group,
const char* option,
const char* description,
T* customValidator) {
options_description* o = findGroup(group);
if ( o )
(options_description_easy_init(o))(option, customValidator, description);
auto g = findGroup(group);
if ( !g ) {
return false;
}
(options_description_easy_init(g))(option, customValidator, description);
return true;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

View File

@ -92,14 +92,17 @@ struct SC_SYSTEM_CORE_API ConfigDelegate : Config::Logger {
DEFINE_SMARTPOINTER(SymbolMapItem);
struct SC_SYSTEM_CORE_API SymbolMapItem : public Core::BaseObject {
SymbolMapItem() : known(false) {}
SymbolMapItem(const Config::Symbol &s) : symbol(s), known(false) {}
class SC_SYSTEM_CORE_API SymbolMapItem : public Core::BaseObject {
public:
SymbolMapItem() : known(false) {}
SymbolMapItem(const Config::Symbol &s) : symbol(s), known(false) {}
Config::Symbol symbol;
bool known;
public:
Config::Symbol symbol;
bool known;
};
class ModelVisitor;
DEFINE_SMARTPOINTER(Group);
@ -189,7 +192,7 @@ class SC_SYSTEM_CORE_API Parameter : public Core::BaseObject {
// ------------------------------------------------------------------
public:
Parameter *copy(bool backImport = false);
Parameter *clone() const;
Parameter *clone() const override;
void dump(std::ostream &os) const;
@ -202,12 +205,13 @@ class SC_SYSTEM_CORE_API Parameter : public Core::BaseObject {
// Attributes
// ------------------------------------------------------------------
public:
Core::BaseObject *parent;
const Parameter *super;
SchemaParameter *definition;
SymbolMapItemPtr symbols[Environment::CS_QUANTITY];
Config::Symbol symbol;
std::string variableName;
Core::BaseObject *parent;
const Parameter *super;
SchemaParameter *definition;
mutable SymbolMapItemPtr initial[Environment::CS_QUANTITY];
SymbolMapItemPtr symbols[Environment::CS_QUANTITY];
Config::Symbol symbol;
std::string variableName;
};
@ -229,7 +233,7 @@ class SC_SYSTEM_CORE_API Structure : public Container {
// ------------------------------------------------------------------
public:
Structure *copy(bool backImport = false);
Structure *clone() const;
Structure *clone() const override;
Structure *instantiate(const char *name) const;
void dump(std::ostream &os) const;
@ -263,7 +267,7 @@ class SC_SYSTEM_CORE_API Group : public Container {
// ------------------------------------------------------------------
public:
Group *copy(bool backImport = false);
Group *clone() const;
Group *clone() const override;
void dump(std::ostream &os) const;
@ -293,7 +297,7 @@ class SC_SYSTEM_CORE_API Section : public Container {
// ------------------------------------------------------------------
public:
Section *copy(bool backImport = false);
Section *clone() const;
Section *clone() const override;
void dump(std::ostream &os) const;
@ -321,7 +325,7 @@ class SC_SYSTEM_CORE_API Binding : public Core::BaseObject {
// ------------------------------------------------------------------
public:
Binding(const std::string &n) : parent(nullptr), definition(nullptr), name(n) {}
Binding *clone() const;
Binding *clone() const override;
void dump(std::ostream &os) const;
@ -365,7 +369,7 @@ class SC_SYSTEM_CORE_API BindingCategory : public Core::BaseObject {
public:
// Returns a binding (template) with given name
Binding *binding(const std::string &name) const;
BindingCategory *clone() const;
BindingCategory *clone() const override;
void dump(std::ostream &os) const;
@ -431,7 +435,7 @@ class SC_SYSTEM_CORE_API ModuleBinding : public Binding {
// Public interface
// ------------------------------------------------------------------
public:
ModuleBinding *clone() const;
ModuleBinding *clone() const override;
void add(BindingCategory *);
BindingCategory *category(const std::string &name) const;
@ -441,13 +445,13 @@ class SC_SYSTEM_CORE_API ModuleBinding : public Binding {
void dump(std::ostream &os) const;
//! Returns a container at path @path@.
Container *findContainer(const std::string &path) const;
Container *findContainer(const std::string &path) const override;
//! Returns a parameters in the tree where the fully expanded name
//! matches fullName.
Parameter *findParameter(const std::string &fullName) const;
Parameter *findParameter(const std::string &fullName) const override;
void accept(ModelVisitor *) const;
void accept(ModelVisitor *) const override;
// ------------------------------------------------------------------

View File

@ -51,26 +51,29 @@ class SC_SYSTEM_CORE_API SchemaParameter : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------
public:
std::string name;
std::string type;
std::string unit;
std::string defaultValue;
std::string description;
OPT(bool) readOnly;
std::string name;
std::string type;
std::string unit;
std::string range;
std::vector<std::string> values;
std::vector<std::string> options;
std::string defaultValue;
std::string description;
OPT(bool) readOnly;
};
DEFINE_SMARTPOINTER(SchemaGroup);
DEFINE_SMARTPOINTER(SchemaStructure);
DEFINE_SMARTPOINTER(SchemaStructExtent);
DEFINE_SMARTPOINTER(SchemaParameters);
class SC_SYSTEM_CORE_API SchemaParameters : public Core::BaseObject {
DECLARE_SC_CLASS(SchemaParameter);
@ -107,7 +110,7 @@ class SC_SYSTEM_CORE_API SchemaParameters : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -117,8 +120,20 @@ class SC_SYSTEM_CORE_API SchemaParameters : public Core::BaseObject {
std::vector<SchemaParameterPtr> _parameters;
std::vector<SchemaGroupPtr> _groups;
std::vector<SchemaStructurePtr> _structs;
public:
std::vector<SchemaStructExtentPtr> structExtents;
};
struct SchemaStructExtent : SchemaParameters {
DECLARE_SC_CLASS(SchemaStructExtent);
void serialize(Archive& ar) override;
std::string type;
std::string matchName;
};
class SC_SYSTEM_CORE_API SchemaGroup : public SchemaParameters {
DECLARE_SC_CLASS(SchemaGroup);
@ -134,7 +149,7 @@ class SC_SYSTEM_CORE_API SchemaGroup : public SchemaParameters {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -160,7 +175,7 @@ class SC_SYSTEM_CORE_API SchemaStructure : public SchemaParameters {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -190,7 +205,7 @@ class SC_SYSTEM_CORE_API SchemaSetupInputOption : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -217,7 +232,7 @@ class SC_SYSTEM_CORE_API SchemaSetupInput : public SchemaParameter {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -245,7 +260,7 @@ class SC_SYSTEM_CORE_API SchemaSetupGroup : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -273,7 +288,7 @@ class SC_SYSTEM_CORE_API SchemaSetup : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -305,7 +320,7 @@ class SC_SYSTEM_CORE_API SchemaModule : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -324,25 +339,6 @@ class SC_SYSTEM_CORE_API SchemaModule : public Core::BaseObject {
};
DEFINE_SMARTPOINTER(SchemaStructExtent);
DEFINE_SMARTPOINTER(SchemaPluginParameters);
struct SchemaPluginParameters : SchemaParameters {
DECLARE_SC_CLASS(SchemaPluginParameters);
void serialize(Archive& ar);
std::vector<SchemaStructExtentPtr> structExtents;
};
struct SchemaStructExtent : SchemaPluginParameters {
DECLARE_SC_CLASS(SchemaStructExtent);
void serialize(Archive& ar);
std::string type;
std::string matchName;
};
DEFINE_SMARTPOINTER(SchemaPlugin);
class SC_SYSTEM_CORE_API SchemaPlugin : public Core::BaseObject {
DECLARE_SC_CLASS(SchemaPlugin);
@ -358,7 +354,7 @@ class SC_SYSTEM_CORE_API SchemaPlugin : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
@ -368,7 +364,7 @@ class SC_SYSTEM_CORE_API SchemaPlugin : public Core::BaseObject {
std::string name;
std::vector<std::string> extends;
std::string description;
SchemaPluginParametersPtr parameters;
SchemaParametersPtr parameters;
SchemaSetupPtr setup;
};
@ -388,18 +384,18 @@ class SC_SYSTEM_CORE_API SchemaBinding : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------
public:
std::string name;
std::string module;
std::string category;
std::string description;
SchemaParametersPtr parameters;
std::string name;
std::string module;
std::string category;
std::string description;
SchemaParametersPtr parameters;
};
@ -462,7 +458,7 @@ class SC_SYSTEM_CORE_API SchemaDefinitions : public Core::BaseObject {
// Serialization
// ------------------------------------------------------------------
public:
void serialize(Archive& ar);
void serialize(Archive& ar) override;
// ------------------------------------------------------------------

View File

@ -504,7 +504,11 @@ class ConfigOptionLinker {
try {
visitedItem.value = Generic::Detail::getConfig<T>(proc._external.cfg, prefix + visitedItem.configFileRelativeSymbol, visitedItem.flags & ConfigOptionBinding< std::vector<T> >::InterpretAsPath);
}
catch ( ... ) {}
catch ( Config::OptionNotFoundException &e ) {}
catch ( ... ) {
// All other exceptions are not OK.
return false;
}
}
return true;
}