From 87d3c0ef04fe8110b6a306dd0e00819ab55ec716 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Fri, 3 Jun 2022 17:36:56 -0700 Subject: [PATCH 01/10] Ticktock IGN_FUEL_CACHE_PATH Signed-off-by: methylDragon --- src/ClientConfig.cc | 4 ++-- src/ClientConfig_TEST.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ClientConfig.cc b/src/ClientConfig.cc index 9fe5f3c3..4c327c1f 100644 --- a/src/ClientConfig.cc +++ b/src/ClientConfig.cc @@ -41,7 +41,7 @@ class gz::fuel_tools::ClientConfigPrivate std::string homePath; gz::common::env(IGN_HOMEDIR, homePath); this->cacheLocation = common::joinPaths( - homePath, ".ignition", "fuel"); + homePath, ".gz", "fuel"); this->servers.push_back(ServerConfig()); } @@ -428,7 +428,7 @@ bool ClientConfig::LoadConfig(const std::string &_file) std::string homePath; gz::common::env(IGN_HOMEDIR, homePath); std::string cacheLocation = gz::common::joinPaths( - homePath, ".ignition", "fuel"); + homePath, ".gz", "fuel"); // The user wants to overwrite the default cache path. if (!cacheLocationConfig.empty()) diff --git a/src/ClientConfig_TEST.cc b/src/ClientConfig_TEST.cc index 48fbfd4b..e7516a54 100644 --- a/src/ClientConfig_TEST.cc +++ b/src/ClientConfig_TEST.cc @@ -102,7 +102,7 @@ TEST(ClientConfig, CustomDefaultConfiguration) config.Servers().front().Url().Str()); std::string defaultCacheLocation = gz::common::joinPaths( - homePath(), ".ignition", "fuel"); + homePath(), ".gz", "fuel"); EXPECT_EQ(defaultCacheLocation, config.CacheLocation()); } From 85bfdbba02f791c4105ef342a7416d60bb6b5611 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 6 Jun 2022 18:43:54 -0700 Subject: [PATCH 02/10] Revert fuel cache path change Signed-off-by: methylDragon --- src/ClientConfig.cc | 4 ++-- src/ClientConfig_TEST.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ClientConfig.cc b/src/ClientConfig.cc index 4c327c1f..9fe5f3c3 100644 --- a/src/ClientConfig.cc +++ b/src/ClientConfig.cc @@ -41,7 +41,7 @@ class gz::fuel_tools::ClientConfigPrivate std::string homePath; gz::common::env(IGN_HOMEDIR, homePath); this->cacheLocation = common::joinPaths( - homePath, ".gz", "fuel"); + homePath, ".ignition", "fuel"); this->servers.push_back(ServerConfig()); } @@ -428,7 +428,7 @@ bool ClientConfig::LoadConfig(const std::string &_file) std::string homePath; gz::common::env(IGN_HOMEDIR, homePath); std::string cacheLocation = gz::common::joinPaths( - homePath, ".gz", "fuel"); + homePath, ".ignition", "fuel"); // The user wants to overwrite the default cache path. if (!cacheLocationConfig.empty()) diff --git a/src/ClientConfig_TEST.cc b/src/ClientConfig_TEST.cc index e7516a54..48fbfd4b 100644 --- a/src/ClientConfig_TEST.cc +++ b/src/ClientConfig_TEST.cc @@ -102,7 +102,7 @@ TEST(ClientConfig, CustomDefaultConfiguration) config.Servers().front().Url().Str()); std::string defaultCacheLocation = gz::common::joinPaths( - homePath(), ".gz", "fuel"); + homePath(), ".ignition", "fuel"); EXPECT_EQ(defaultCacheLocation, config.CacheLocation()); } From 02829f63f674e467ef475f7b54b912c122594dce Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 6 Jun 2022 14:55:53 -0700 Subject: [PATCH 03/10] Migrate macros Signed-off-by: methylDragon --- Migration.md | 4 ++++ include/gz/fuel_tools/Helpers.hh | 17 ++++++++--------- include/ignition/fuel_tools/Helpers.hh | 5 +++++ src/ClientConfig.cc | 4 ++-- src/FuelClient_TEST.cc | 2 +- src/ign_TEST.cc | 14 +++++++------- test/test_config.h.in | 6 +++--- 7 files changed, 30 insertions(+), 22 deletions(-) diff --git a/Migration.md b/Migration.md index c0425956..4c275a79 100644 --- a/Migration.md +++ b/Migration.md @@ -6,6 +6,10 @@ * **Replacement**: `gz` namespace * **Deprecation**: `ignition/...` headers * **Replacement**: `gz/...` headers +* The following `ign_` prefixed macros are deprecated and will be removed in future versions. + Use the `gz_` prefix instead. + * `ign_strcat`, `ign_strcpy`, `ign_sprintf`, `ign_strdup` + ## Gazebo Fuel Tools 5.X to 6.X diff --git a/include/gz/fuel_tools/Helpers.hh b/include/gz/fuel_tools/Helpers.hh index 5027a349..b04e91c0 100644 --- a/include/gz/fuel_tools/Helpers.hh +++ b/include/gz/fuel_tools/Helpers.hh @@ -24,15 +24,15 @@ // Use safer functions on Windows #ifdef _MSC_VER - #define ign_strcat strcat_s - #define ign_strcpy strcpy_s - #define ign_sprintf sprintf_s - #define ign_strdup _strdup + #define gz_strcat strcat_s + #define gz_strcpy strcpy_s + #define gz_sprintf sprintf_s + #define gz_strdup _strdup #else - #define ign_strcat std::strcat - #define ign_strcpy std::strcpy - #define ign_sprintf std::sprintf - #define ign_strdup strdup + #define gz_strcat std::strcat + #define gz_strcpy std::strcpy + #define gz_sprintf std::sprintf + #define gz_strdup strdup #endif namespace gz @@ -50,4 +50,3 @@ std::string uriToPath(const gz::common::URI &_uri); // IGNITION_FUEL_TOOLS_HELPERS_HH_ #endif - diff --git a/include/ignition/fuel_tools/Helpers.hh b/include/ignition/fuel_tools/Helpers.hh index 654835d9..990c4a60 100644 --- a/include/ignition/fuel_tools/Helpers.hh +++ b/include/ignition/fuel_tools/Helpers.hh @@ -17,3 +17,8 @@ #include #include + +#define ign_strcat gz_strcat +#define ign_strcpy gz_strcpy +#define ign_sprintf gz_sprintf +#define ign_strdup gz_strdup diff --git a/src/ClientConfig.cc b/src/ClientConfig.cc index 9fe5f3c3..06c75490 100644 --- a/src/ClientConfig.cc +++ b/src/ClientConfig.cc @@ -39,7 +39,7 @@ class gz::fuel_tools::ClientConfigPrivate public: ClientConfigPrivate() { std::string homePath; - gz::common::env(IGN_HOMEDIR, homePath); + gz::common::env(GZ_HOMEDIR, homePath); this->cacheLocation = common::joinPaths( homePath, ".ignition", "fuel"); @@ -426,7 +426,7 @@ bool ClientConfig::LoadConfig(const std::string &_file) // Default cache path. std::string homePath; - gz::common::env(IGN_HOMEDIR, homePath); + gz::common::env(GZ_HOMEDIR, homePath); std::string cacheLocation = gz::common::joinPaths( homePath, ".ignition", "fuel"); diff --git a/src/FuelClient_TEST.cc b/src/FuelClient_TEST.cc index 0354d0b4..47ffae96 100644 --- a/src/FuelClient_TEST.cc +++ b/src/FuelClient_TEST.cc @@ -598,7 +598,7 @@ TEST_F(FuelClientTest, DownloadModel) ///////////////////////////////////////////////// // Windows doesn't support colons in filenames // https://github.com/gazebosim/gz-fuel-tools/issues/106 -TEST_F(FuelClientTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(ModelDependencies)) +TEST_F(FuelClientTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(ModelDependencies)) { // Configure to use binary path as cache ASSERT_EQ(0, ChangeDirectory(PROJECT_BINARY_PATH)); diff --git a/src/ign_TEST.cc b/src/ign_TEST.cc index 7278c084..1b92f515 100644 --- a/src/ign_TEST.cc +++ b/src/ign_TEST.cc @@ -53,7 +53,7 @@ auto g_listCmd = "ign fuel list -v 4 --force-version " + g_version; ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 -TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Versions)) +TEST(CmdLine, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Versions)) { auto output = custom_exec_str("ign fuel --versions"); EXPECT_NE(output.find(g_version), std::string::npos) << output; @@ -61,7 +61,7 @@ TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Versions)) ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 -TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Help)) +TEST(CmdLine, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Help)) { auto output = custom_exec_str("ign fuel --force-version " + g_version + " --help"); @@ -76,7 +76,7 @@ TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Help)) ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 -TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ListFail)) +TEST(CmdLine, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ListFail)) { auto output = custom_exec_str(g_listCmd); EXPECT_NE(output.find("Missing resource type"), std::string::npos) << output; @@ -96,7 +96,7 @@ TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ListFail)) ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 TEST(CmdLine, - IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ModelListConfigServerUgly)) + GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ModelListConfigServerUgly)) { auto output = custom_exec_str(g_listCmd + " -t model --raw"); EXPECT_NE(output.find("https://fuel.ignitionrobotics.org/1.0/"), @@ -107,7 +107,7 @@ TEST(CmdLine, ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 TEST(CmdLine, - IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ModelListCustomServerPretty)) + GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ModelListCustomServerPretty)) { auto output = custom_exec_str( g_listCmd + " -t model -u https://staging-fuel.ignitionrobotics.org"); @@ -125,7 +125,7 @@ TEST(CmdLine, ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 -TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListConfigServerUgly)) +TEST(CmdLine, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListConfigServerUgly)) { auto output = custom_exec_str(g_listCmd + " -t world --raw -u https://staging-fuel.ignitionrobotics.org"); @@ -137,7 +137,7 @@ TEST(CmdLine, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListConfigServerUgly)) ///////////////////////////////////////////////// // https://github.com/gazebosim/gz-fuel-tools/issues/113 TEST(CmdLine, - IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListCustomServerPretty)) + GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WorldListCustomServerPretty)) { auto output = custom_exec_str( g_listCmd + " -t world -u https://staging-fuel.ignitionrobotics.org"); diff --git a/test/test_config.h.in b/test/test_config.h.in index 5865f0f9..705df317 100644 --- a/test/test_config.h.in +++ b/test/test_config.h.in @@ -119,9 +119,9 @@ namespace testing PROCESS_INFORMATION processInfo; char cmd[500]; - ign_strcpy(cmd, _command); - ign_strcat(cmd, " "); - ign_strcat(cmd, _partition); + gz_strcpy(cmd, _command); + gz_strcat(cmd, " "); + gz_strcat(cmd, _partition); if (!CreateProcess(NULL, const_cast(cmd), NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo)) From be49d81f4e3f4aace32bf441b8d86d24e10cc2c4 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 6 Jun 2022 16:14:13 -0700 Subject: [PATCH 04/10] Update migration guide to mention header-dependent macros Signed-off-by: methylDragon --- Migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Migration.md b/Migration.md index 4c275a79..d8581505 100644 --- a/Migration.md +++ b/Migration.md @@ -7,6 +7,7 @@ * **Deprecation**: `ignition/...` headers * **Replacement**: `gz/...` headers * The following `ign_` prefixed macros are deprecated and will be removed in future versions. + Additionally, they will only be available when including the corresponding `ignition/...` header. Use the `gz_` prefix instead. * `ign_strcat`, `ign_strcpy`, `ign_sprintf`, `ign_strdup` @@ -105,4 +106,3 @@ └── modelname ├── 1 └── 2 - From 830fe96b07a7655dfaa743f3ce340f6cc410831d Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 6 Jun 2022 17:20:02 -0700 Subject: [PATCH 05/10] Fold in some unrelated comment changes Signed-off-by: methylDragon --- include/gz/fuel_tools/ClientConfig.hh | 2 +- include/gz/fuel_tools/FuelClient.hh | 16 ++++++++-------- include/gz/fuel_tools/Interface.hh | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/gz/fuel_tools/ClientConfig.hh b/include/gz/fuel_tools/ClientConfig.hh index 3124345d..da7eb962 100644 --- a/include/gz/fuel_tools/ClientConfig.hh +++ b/include/gz/fuel_tools/ClientConfig.hh @@ -104,7 +104,7 @@ namespace gz private: std::unique_ptr dataPtr; }; - /// \brief High level interface to ignition fuel. + /// \brief High level interface to Gazebo Fuel. /// class GZ_FUEL_TOOLS_VISIBLE ClientConfig { diff --git a/include/gz/fuel_tools/FuelClient.hh b/include/gz/fuel_tools/FuelClient.hh index 2e571e85..ac46a3c1 100644 --- a/include/gz/fuel_tools/FuelClient.hh +++ b/include/gz/fuel_tools/FuelClient.hh @@ -48,7 +48,7 @@ namespace gz class ModelIdentifier; class ServerConfig; - /// \brief High level interface to ignition fuel + /// \brief High level interface to Gazebo Fuel class GZ_FUEL_TOOLS_VISIBLE FuelClient { /// \brief Default constructor. @@ -201,13 +201,13 @@ namespace gz public: Result DeleteUrl(const gz::common::URI &_uri, const std::vector &_headers); - /// \brief Download a model from ignition fuel. This will override an + /// \brief Download a model from Gazebo Fuel. This will override an /// existing local copy of the model. /// \param[in] _id The model identifier. /// \return Result of the download operation public: Result DownloadModel(const ModelIdentifier &_id); - /// \brief Download a model from ignition fuel. This will override an + /// \brief Download a model from Gazebo Fuel. This will override an /// existing local copy of the model. /// \param[in] _id The model identifier. /// \param[in] _headers Headers to set on the HTTP request. @@ -215,7 +215,7 @@ namespace gz public: Result DownloadModel(const ModelIdentifier &_id, const std::vector &_headers); - /// \brief Download a model from ignition fuel. This will override an + /// \brief Download a model from Gazebo Fuel. This will override an /// existing local copy of the model. /// \param[in] _id The model identifier. /// \param[in] _headers Headers to set on the HTTP request. @@ -254,7 +254,7 @@ namespace gz public: Result DownloadWorld(WorldIdentifier &_id, const std::vector &_headers); - /// \brief Download a model from ignition fuel. This will override an + /// \brief Download a model from Gazebo Fuel. This will override an /// existing local copy of the model. /// \param[in] _modelUrl The unique URL of the model to download. /// E.g.: https://fuel.ignitionrobotics.org/1.0/caguero/models/Beer @@ -263,7 +263,7 @@ namespace gz public: Result DownloadModel(const common::URI &_modelUrl, std::string &_path); - /// \brief Download a world from ignition fuel. This will override an + /// \brief Download a world from Gazebo Fuel. This will override an /// existing local copy of the world. /// \param[in] _worldUrl The unique URL of the world to download. /// E.g.: https://fuel.ignitionrobotics.org/1.0/OpenRobotics/worlds/Empty @@ -274,7 +274,7 @@ namespace gz using ModelResult = std::tuple; - /// \brief Download a list of models from ignition fuel. + /// \brief Download a list of models from Gazebo Fuel. /// \param[in] _ids The list of model ids to download. /// This will also find all recursive dependencies of the models /// \param[in] _jobs Number of parallel jobs to use to download models @@ -286,7 +286,7 @@ namespace gz const std::vector &_ids, size_t _jobs = 2); - /// \brief Download a list of mworlds from ignition fuel. + /// \brief Download a list of mworlds from Gazebo Fuel. /// \param[in] _ids The list of world ids to download. /// \param[in] _jobs Number of parallel jobs to use to download worlds. /// \return Result of the download operation. diff --git a/include/gz/fuel_tools/Interface.hh b/include/gz/fuel_tools/Interface.hh index c38e6eeb..25530135 100644 --- a/include/gz/fuel_tools/Interface.hh +++ b/include/gz/fuel_tools/Interface.hh @@ -24,7 +24,7 @@ namespace gz namespace fuel_tools { /// \brief Download the specified resource into the default configuration of - /// fuel tools. This will place the asset in ~/.ignition/fuel. + /// fuel tools. This will place the asset in ~/.gz/fuel. /// \param[in] _uri URI to the asset. /// \return Path to the downloaded asset. Empty on error. GZ_FUEL_TOOLS_VISIBLE std::string fetchResource( From 6cbcbd58a0d4f2e6f253136e0507c80ecbdddc52 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 6 Jun 2022 18:00:12 -0700 Subject: [PATCH 06/10] Fold in some unrelated comment changes Signed-off-by: methylDragon --- README.md | 2 +- conf/fuel.yaml.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e58bbf9..0d548038 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ sudo apt install ruby-ffi libzip-dev libcurl-dev libjsoncpp-dev * Think about how to detect when new versions of remote models have been uploaded. * Idea of a hash. -* Add ignition fuel command line utilities for: +* Add Gazebo Fuel command line utilities for: * detail * create * delete diff --git a/conf/fuel.yaml.in b/conf/fuel.yaml.in index f6709e2a..95028c82 100644 --- a/conf/fuel.yaml.in +++ b/conf/fuel.yaml.in @@ -1,4 +1,4 @@ ---- # Subcommands available inside ignition fuel +--- # Subcommands available inside Gazebo Fuel format: 1.0.0 library_name: @PROJECT_NAME_NO_VERSION@ library_version: @PROJECT_VERSION_FULL@ From 20f650f42f18c36b62fe62de08caa0ac07f1b47d Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 7 Jun 2022 12:05:17 -0700 Subject: [PATCH 07/10] Fix grammar Signed-off-by: methylDragon --- src/ClientConfig.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ClientConfig.cc b/src/ClientConfig.cc index 06c75490..043e32f4 100644 --- a/src/ClientConfig.cc +++ b/src/ClientConfig.cc @@ -208,7 +208,7 @@ ClientConfig::ClientConfig() : dataPtr(new ClientConfigPrivate) if (gz::common::env("IGN_FUEL_CACHE_PATH", gzFuelPath)) { gzwarn << "Using deprecated environment variable [IGN_FUEL_CACHE_PATH] " - << "set cache path. Please use [GZ_FUEL_CACHE_PATH] instead." + << "to set cache path. Please use [GZ_FUEL_CACHE_PATH] instead." << std::endl; } else @@ -446,7 +446,7 @@ bool ClientConfig::LoadConfig(const std::string &_file) else if (gz::common::env("IGN_FUEL_CACHE_PATH", gzFuelPath)) { gzwarn << "Using deprecated environment variable [IGN_FUEL_CACHE_PATH] " - << "set cache path. Please use [GZ_FUEL_CACHE_PATH] instead." + << "to set cache path. Please use [GZ_FUEL_CACHE_PATH] instead." << std::endl; gzwarn << "GZ_FUEL_CACHE_PATH is set to [" << gzFuelPath << "]. The " From c78c7a8473bde8537b0fa069876b0eb7f0e23329 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 7 Jun 2022 16:01:01 -0700 Subject: [PATCH 08/10] Tick-tock header functions Signed-off-by: methylDragon --- src/cmd/cmdfuel.rb.in | 14 ++++++++++---- src/ign.cc | 7 ++++++- src/ign.hh | 3 ++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/cmd/cmdfuel.rb.in b/src/cmd/cmdfuel.rb.in index cb268b9b..c334de42 100755 --- a/src/cmd/cmdfuel.rb.in +++ b/src/cmd/cmdfuel.rb.in @@ -361,12 +361,18 @@ class Cmd end # Read the library version. - Importer.extern 'char* ignitionVersion()' + Importer.extern 'char* gzVersion()' begin - plugin_version = Importer.ignitionVersion.to_s + plugin_version = Importer.gzVersion.to_s rescue DLError - puts "Library error: Problem running 'ignitionVersion()' from #{plugin}." - exit(-1) + Importer.extern 'char* ignitionVersion()' + begin + plugin_version = Importer.ignitionVersion.to_s + puts "ignitionVersion is deprecated. Use gzVersion instead." + rescue DLError + puts "Library error: Problem running 'gzVersion()' from #{plugin}." + exit(-1) + end end # Sanity check: Verify that the version of the yaml file matches the version diff --git a/src/ign.cc b/src/ign.cc index f18180ef..a6694eb8 100644 --- a/src/ign.cc +++ b/src/ign.cc @@ -285,11 +285,16 @@ extern "C" bool getOwnerWorlds( } ////////////////////////////////////////////////// -extern "C" GZ_FUEL_TOOLS_VISIBLE char *ignitionVersion() +extern "C" GZ_FUEL_TOOLS_VISIBLE char *gzVersion() { return strdup(GZ_FUEL_TOOLS_VERSION_FULL); } +extern "C" GZ_FUEL_TOOLS_VISIBLE char GZ_DEPRECATED(8) *ignitionVersion() +{ + return gzVersion(); +} + ////////////////////////////////////////////////// extern "C" GZ_FUEL_TOOLS_VISIBLE int listModels(const char *_url, const char *_owner, const char *_raw, const char *_configFile) diff --git a/src/ign.hh b/src/ign.hh index 27b5b678..9744c618 100644 --- a/src/ign.hh +++ b/src/ign.hh @@ -22,7 +22,8 @@ /// \brief External hook to read the library version. /// \return C-string representing the version. Ex.: 0.1.2 -extern "C" GZ_FUEL_TOOLS_VISIBLE char *ignitionVersion(); +extern "C" GZ_FUEL_TOOLS_VISIBLE char *gzVersion(); +extern "C" GZ_FUEL_TOOLS_VISIBLE char GZ_DEPRECATED(8) *ignitionVersion(); /// \brief Set verbosity level /// \param[in] _verbosity 0 to 4 From c6b3900abe60b79b646d8866d67c1092bcda20de Mon Sep 17 00:00:00 2001 From: methylDragon Date: Tue, 7 Jun 2022 16:22:49 -0700 Subject: [PATCH 09/10] Fix header function tick-tocks Signed-off-by: methylDragon --- Migration.md | 2 ++ src/cmd/cmdfuel.rb.in | 10 ++-------- src/ign.cc | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Migration.md b/Migration.md index d8581505..3abd4427 100644 --- a/Migration.md +++ b/Migration.md @@ -6,6 +6,8 @@ * **Replacement**: `gz` namespace * **Deprecation**: `ignition/...` headers * **Replacement**: `gz/...` headers +* **Deprecation**: `ignitionVersion` +* **Replacement**: `gzVersion()` * The following `ign_` prefixed macros are deprecated and will be removed in future versions. Additionally, they will only be available when including the corresponding `ignition/...` header. Use the `gz_` prefix instead. diff --git a/src/cmd/cmdfuel.rb.in b/src/cmd/cmdfuel.rb.in index c334de42..2a0b8529 100755 --- a/src/cmd/cmdfuel.rb.in +++ b/src/cmd/cmdfuel.rb.in @@ -365,14 +365,8 @@ class Cmd begin plugin_version = Importer.gzVersion.to_s rescue DLError - Importer.extern 'char* ignitionVersion()' - begin - plugin_version = Importer.ignitionVersion.to_s - puts "ignitionVersion is deprecated. Use gzVersion instead." - rescue DLError - puts "Library error: Problem running 'gzVersion()' from #{plugin}." - exit(-1) - end + puts "Library error: Problem running 'gzVersion()' from #{plugin}." + exit(-1) end # Sanity check: Verify that the version of the yaml file matches the version diff --git a/src/ign.cc b/src/ign.cc index a6694eb8..8bea25b4 100644 --- a/src/ign.cc +++ b/src/ign.cc @@ -290,7 +290,7 @@ extern "C" GZ_FUEL_TOOLS_VISIBLE char *gzVersion() return strdup(GZ_FUEL_TOOLS_VERSION_FULL); } -extern "C" GZ_FUEL_TOOLS_VISIBLE char GZ_DEPRECATED(8) *ignitionVersion() +extern "C" GZ_FUEL_TOOLS_VISIBLE char *ignitionVersion() { return gzVersion(); } From 17b2a35b45c38511b73ff916b88f413a554056c2 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Fri, 10 Jun 2022 13:23:48 -0700 Subject: [PATCH 10/10] Hard-tock ignitionVersion Signed-off-by: methylDragon --- Migration.md | 2 -- src/ign.cc | 5 ----- src/ign.hh | 1 - 3 files changed, 8 deletions(-) diff --git a/Migration.md b/Migration.md index 3abd4427..d8581505 100644 --- a/Migration.md +++ b/Migration.md @@ -6,8 +6,6 @@ * **Replacement**: `gz` namespace * **Deprecation**: `ignition/...` headers * **Replacement**: `gz/...` headers -* **Deprecation**: `ignitionVersion` -* **Replacement**: `gzVersion()` * The following `ign_` prefixed macros are deprecated and will be removed in future versions. Additionally, they will only be available when including the corresponding `ignition/...` header. Use the `gz_` prefix instead. diff --git a/src/ign.cc b/src/ign.cc index 8bea25b4..bbdf36e0 100644 --- a/src/ign.cc +++ b/src/ign.cc @@ -290,11 +290,6 @@ extern "C" GZ_FUEL_TOOLS_VISIBLE char *gzVersion() return strdup(GZ_FUEL_TOOLS_VERSION_FULL); } -extern "C" GZ_FUEL_TOOLS_VISIBLE char *ignitionVersion() -{ - return gzVersion(); -} - ////////////////////////////////////////////////// extern "C" GZ_FUEL_TOOLS_VISIBLE int listModels(const char *_url, const char *_owner, const char *_raw, const char *_configFile) diff --git a/src/ign.hh b/src/ign.hh index 9744c618..66252912 100644 --- a/src/ign.hh +++ b/src/ign.hh @@ -23,7 +23,6 @@ /// \brief External hook to read the library version. /// \return C-string representing the version. Ex.: 0.1.2 extern "C" GZ_FUEL_TOOLS_VISIBLE char *gzVersion(); -extern "C" GZ_FUEL_TOOLS_VISIBLE char GZ_DEPRECATED(8) *ignitionVersion(); /// \brief Set verbosity level /// \param[in] _verbosity 0 to 4