From 5819c762897b4845ef4b08baecf028215e6e845a Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Sun, 14 Jul 2024 20:17:47 -0600 Subject: [PATCH] Tidied repository with other small changes --- include/argparse | 1 + include/cache.hpp | 1 + include/types.hpp | 1 + include/version.hpp | 2 +- modules/clipp | 1 - src/cache.cpp | 4 ++++ src/package.cpp | 2 +- src/utils.cpp | 2 +- submodules/indicators | 1 - 9 files changed, 10 insertions(+), 5 deletions(-) create mode 120000 include/argparse delete mode 160000 modules/clipp delete mode 160000 submodules/indicators diff --git a/include/argparse b/include/argparse new file mode 120000 index 0000000..5eb5bec --- /dev/null +++ b/include/argparse @@ -0,0 +1 @@ +../modules/argparse/include/argparse \ No newline at end of file diff --git a/include/cache.hpp b/include/cache.hpp index 75801e3..fdf1aea 100644 --- a/include/cache.hpp +++ b/include/cache.hpp @@ -16,6 +16,7 @@ namespace gdpm::cache { string table_name = GDPM_PACKAGE_CACHE_TABLENAME; }; + bool exists(const params& = params()); error create_package_database(bool overwrite = false, const params& = params()); error insert_package_info(const package::info_list& packages, const params& = params()); result_t get_package_info_by_id(const package::id_list& package_ids, const params& = params()); diff --git a/include/types.hpp b/include/types.hpp index 6896f0e..1ccc1bc 100644 --- a/include/types.hpp +++ b/include/types.hpp @@ -8,6 +8,7 @@ #include #include #include +#include namespace gdpm{ class error; diff --git a/include/version.hpp b/include/version.hpp index d267b2c..881646a 100644 --- a/include/version.hpp +++ b/include/version.hpp @@ -11,7 +11,7 @@ namespace gdpm::version{ int major = 0; int minor = 0; int patch = 0; - string commit = ""; + string description = ""; }; std::string to_string(const context& context); diff --git a/modules/clipp b/modules/clipp deleted file mode 160000 index 02783b6..0000000 --- a/modules/clipp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 02783b6782ebedbb2bebc2e6ceda738ee51c7df2 diff --git a/src/cache.cpp b/src/cache.cpp index 09b62a2..45546ad 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -17,6 +17,10 @@ namespace gdpm::cache{ return utils::replace_all(s, "'", "''"); } + bool exists(const params& params) { + return std::filesystem::exists(params.cache_path); + } + error create_package_database( bool overwrite, const params& params diff --git a/src/package.cpp b/src/package.cpp index 5fbd21a..d44d2cd 100644 --- a/src/package.cpp +++ b/src/package.cpp @@ -58,7 +58,7 @@ namespace gdpm::package{ if(p_cache.empty()){ return log::error_rc( ec::NOT_FOUND, /* TODO: change to PACKAGE_NOT_FOUND */ - "package::install(): no packages found to install." + "package::install(): no package(s) found to install." ); } diff --git a/src/utils.cpp b/src/utils.cpp index b71c2c2..3277f49 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -313,7 +313,7 @@ namespace gdpm::utils{ case 5: return s + " PB"; } return std::to_string(size); - } + } namespace json { string from_array( diff --git a/submodules/indicators b/submodules/indicators deleted file mode 160000 index ef71abd..0000000 --- a/submodules/indicators +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ef71abd9bc7254f7734fa84d5b1c336be2deb9f7