Install and Remove Patch

Fixed issue where packages would not install or remove correctly.
This commit is contained in:
David Allen 2022-01-16 23:14:47 -06:00
parent 2b250d9a2d
commit 2fd55de71e
6 changed files with 64 additions and 38 deletions

View file

@ -1,5 +1,6 @@
#pragma once
#include <rapidjson/rapidjson.h>
#include <string>
namespace gdpm::constants{
@ -75,4 +76,4 @@ namespace gdpm::constants{
#ifndef GDPM_TIMESTAMP_FORMAT
#define GDPM_TIMESTAMP_FORMAT ":%I:%M:%S %p; %Y-%m-%d"
#endif
#endif

View file

@ -11,8 +11,8 @@ namespace gdpm::http{
std::unordered_map<std::string, std::string> headers{};
};
response request_get(const std::string& url, size_t timeout = GDPM_CONFIG_TIMEOUT_MS);
response request_post(const std::string& url, const char *post_fields="", size_t timeout = GDPM_CONFIG_TIMEOUT_MS);
response download_file(const std::string& url, const std::string& storage_path, size_t timeout = GDPM_CONFIG_TIMEOUT_MS);
response request_get(const std::string& url, size_t timeout = GDPM_CONFIG_TIMEOUT_MS, int verbose = 0);
response request_post(const std::string& url, const char *post_fields="", size_t timeout = GDPM_CONFIG_TIMEOUT_MS, int verbose = 0);
response download_file(const std::string& url, const std::string& storage_path, size_t timeout = GDPM_CONFIG_TIMEOUT_MS, int verbose = 0);
}

View file

@ -60,6 +60,7 @@ namespace gdpm::utils{
return fwrite(ptr, size, nmemb, (FILE*)userdata);
}
/* Use ISO 8601 for default timestamp format. */
static inline auto timestamp(const std::string& format = GDPM_TIMESTAMP_FORMAT){
time_t t = std::time(nullptr);
#if GDPM_ENABLE_TIMESTAMPS == 1
@ -78,7 +79,7 @@ namespace gdpm::utils{
}
// A make_tuple wrapper for enforcing certain requirements
template <typename... Args>
template <typename...Args>
auto range(Args...args)
{
// Limit number of args to only 2
@ -101,4 +102,5 @@ namespace gdpm::utils{
std::string prompt_user(const char *message);
bool prompt_user_yn(const char *message);
void delay(std::chrono::milliseconds milliseconds = GDPM_REQUEST_DELAY);
// TODO: Add function to get size of decompressed zip
}