aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-16 01:34:51 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-16 01:34:51 +0200
commit8a923ca5fd87e8e63bda337bb2e393fa3acda209 (patch)
treed158dcaa9141aff6f3e8b6e6d0a1e3c8b528c967
parent228e5f935b4f6d08b159c81fdfa10c63332036bf (diff)
Fix package repository download
-rw-r--r--src/Archive.cpp8
-rw-r--r--src/GlobalLib.cpp2
2 files changed, 4 insertions, 6 deletions
diff --git a/src/Archive.cpp b/src/Archive.cpp
index 08106c3..6455df2 100644
--- a/src/Archive.cpp
+++ b/src/Archive.cpp
@@ -75,8 +75,6 @@ namespace sibs
flags |= ARCHIVE_EXTRACT_ACL;
flags |= ARCHIVE_EXTRACT_FFLAGS;
- FileString rootName;
-
a = archive_read_new();
archive_read_support_format_all(a);
archive_read_support_compression_all(a);
@@ -115,11 +113,11 @@ namespace sibs
}
const _tinydir_char_t* currentFile = archive_entry_pathname_native(entry);
- if(rootName.empty())
- rootName = currentFile;
FileString fullOutputPath = destination;
- fullOutputPath += (currentFile + (rootName.empty() ? 0 : rootName.size() - 1));
+ if(!fullOutputPath.empty() && fullOutputPath.back() != '/')
+ fullOutputPath += '/';
+ fullOutputPath += currentFile;
// TODO: Verify if this really works. Why doesn't libarchive have wide string version of archive_entry_set_pathname?
string fullOutputPathUtf8 = toUtf8(fullOutputPath);
archive_entry_set_pathname(entry, fullOutputPathUtf8.c_str());
diff --git a/src/GlobalLib.cpp b/src/GlobalLib.cpp
index 8346a83..9ad3d77 100644
--- a/src/GlobalLib.cpp
+++ b/src/GlobalLib.cpp
@@ -92,7 +92,7 @@ namespace sibs
{
if(globalLibLinkerFlagsResult.getErrorCode() == GlobalLib::DependencyError::DEPENDENCY_NOT_FOUND || globalLibLinkerFlagsResult.getErrorCode() == GlobalLib::DependencyError::DEPENDENCY_VERSION_NO_MATCH)
{
- printf("Dependency not found in global lib, trying to download from github\n");
+ printf("Dependency not found in global lib, trying to download from package repository\n");
// TODO: Download several dependencies at the same time by adding them to a list
// and then iterate them and download them all using several threads.
// All dependecies should be downloaded at the same time, this includes dependencies of dependencies.