Although the installer URL can be taken from OsinfoTree, there are situations where OsinfoTree doesn't have a URL or even the management apps should prefer the URL set by their users instead of fallbacking to the one get from OsinfoTree. Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx> --- osinfo/libosinfo.syms | 6 ++++++ osinfo/osinfo_install_config.c | 28 ++++++++++++++++++++++++++++ osinfo/osinfo_install_config.h | 6 ++++++ 3 files changed, 40 insertions(+) diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms index 5c200e3..aa8e6d7 100644 --- a/osinfo/libosinfo.syms +++ b/osinfo/libosinfo.syms @@ -568,6 +568,12 @@ LIBOSINFO_1.4.0 { osinfo_media_get_install_script_list; } LIBOSINFO_1.3.0; +LIBOSINFO_1.5.0 { + global: + osinfo_install_config_get_installation_url; + osinfo_install_config_set_installation_url; +} LIBOSINFO_1.4.0; + /* Symbols in next release... LIBOSINFO_0.0.2 { diff --git a/osinfo/osinfo_install_config.c b/osinfo/osinfo_install_config.c index abe37bd..af4b47e 100644 --- a/osinfo/osinfo_install_config.c +++ b/osinfo/osinfo_install_config.c @@ -688,6 +688,34 @@ gboolean osinfo_install_config_get_driver_signing(OsinfoInstallConfig *config) TRUE); } +/** + * osinfo_install_config_set_installation_url: + * @config: the install config + * @url: the URL used to perform the installation + * + * When performing a tree based installation the script will need the installation + * URL to be set, whenever the installation is performed from a non canonical place. + */ +void osinfo_install_config_set_installation_url(OsinfoInstallConfig *config, + const gchar *url) +{ + osinfo_entity_set_param(OSINFO_ENTITY(config), + OSINFO_INSTALL_CONFIG_PROP_INSTALLATION_URL, + url); +} + +/** + * osinfo_install_config_get_installation_url: + * @config + * + * Returns the URL the script will use to perform the installation. + */ +const gchar *osinfo_install_config_get_installation_url(OsinfoInstallConfig *config) +{ + return osinfo_entity_get_param_value(OSINFO_ENTITY(config), + OSINFO_INSTALL_CONFIG_PROP_INSTALLATION_URL); +} + /* * Local variables: * indent-tabs-mode: nil diff --git a/osinfo/osinfo_install_config.h b/osinfo/osinfo_install_config.h index f9db88b..c219c3a 100644 --- a/osinfo/osinfo_install_config.h +++ b/osinfo/osinfo_install_config.h @@ -69,6 +69,8 @@ #define OSINFO_INSTALL_CONFIG_PROP_DRIVER_SIGNING "driver-signing" +#define OSINFO_INSTALL_CONFIG_PROP_INSTALLATION_URL "installation-url" + typedef struct _OsinfoInstallConfig OsinfoInstallConfig; typedef struct _OsinfoInstallConfigClass OsinfoInstallConfigClass; typedef struct _OsinfoInstallConfigPrivate OsinfoInstallConfigPrivate; @@ -199,6 +201,10 @@ void osinfo_install_config_set_driver_signing(OsinfoInstallConfig *config, gboolean signing); gboolean osinfo_install_config_get_driver_signing(OsinfoInstallConfig *config); +void osinfo_install_config_set_installation_url(OsinfoInstallConfig *config, + const gchar *url); +const gchar *osinfo_install_config_get_installation_url(OsinfoInstallConfig *config); + #endif /* __OSINFO_INSTALL_CONFIG_H__ */ /* * Local variables: -- 2.20.1 _______________________________________________ Libosinfo mailing list Libosinfo@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libosinfo