Skip to content

Commit

Permalink
Release v0.9.2
Browse files Browse the repository at this point in the history
* fix bug when deep empty folders were missing from list
  • Loading branch information
andrew-grechkin committed May 30, 2020
1 parent 005bf44 commit e756090
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.12 FATAL_ERROR)

project (fuse3-p7zip
VERSION 0.9.1
VERSION 0.9.2
DESCRIPTION "fuse3 file system that uses the p7zip library to mount archives"
LANGUAGES CXX
)
Expand Down Expand Up @@ -102,12 +102,13 @@ install(TARGETS "${PROJECT_NAME}"
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
)

set(CPACK_GENERATOR "TGZ")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "Andrew Grechkin")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_GENERATOR "TGZ")
include(CPack)
5 changes: 4 additions & 1 deletion src/7zip/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ namespace sevenzip {
{
NWindows::NCOM::CPropVariant prop;
auto res = impl->get_prop(kpidPath, prop);
//if (res == S_OK && prop.bstrVal) printf("prop bstr: '%ls'\n", (const wchar_t*)prop.bstrVal);
//log().printf("prop path: %d\n", res);
//std::setlocale(LC_ALL, "");
//if (res == S_OK && prop.bstrVal) log().printf("prop bstr (l): '%ls'\n", (const wchar_t*)prop.bstrVal);
//if (res == S_OK && prop.bstrVal) log().printf("prop bstr (u): '%s'\n", utf8((const wchar_t*)prop.bstrVal).c_str());
if (res == S_OK && prop.bstrVal) {
auto override_encoding = std::getenv("FUSE3_P7ZIP_FORCE_ENCODING");
return override_encoding ? utf8raw((const wchar_t*)prop.bstrVal, override_encoding)
Expand Down
11 changes: 11 additions & 0 deletions src/fuse3.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "fuse3.hpp"
#include "exception.hpp"
#include "logger.hpp"
#include "pattern.hpp"
#include "string.hpp"
#include "version.hpp"
Expand Down Expand Up @@ -209,6 +210,7 @@ ssize_t Fuse::execute(sevenzip::IArchive* arc)
root_stat.st_mode = (root_stat.st_mode & ~S_IFMT) | S_IFDIR;
cache.tree.emplace(root, std::make_pair(arc->end(), root_stat));
for (auto it = arc->begin(); it != arc->end(); ++it) {
//log().printf("it: '%s'\n", it.path().c_str());
auto path = root / it.path();
auto name = sevenzip::Path(root == path && it.name().empty() ? arc->proposed_name() : it.name());
if (!it.extension().empty()) name += "." + it.extension();
Expand All @@ -223,7 +225,16 @@ ssize_t Fuse::execute(sevenzip::IArchive* arc)
} else {
file_stat.st_mode |= S_IFREG;
}
//log().printf("path: '%s'\n", path.c_str());
cache.tree.emplace(path, std::make_pair(it, file_stat));
for (auto p = path.parent_path(); !p.empty() && p != root; p = p.parent_path()) {
if (cache.tree.contains(p)) break;
//log().printf("sub: '%s'\n", p.c_str());
file_stat.st_size = it.size();
file_stat.st_mode &= ~S_IFMT;
file_stat.st_mode |= S_IFDIR;
cache.tree.emplace(p, std::make_pair(arc->end(), file_stat));
}
}

fuse = fuse_new(&_params->args, _operations.get(), sizeof(fuse_operations), &cache);
Expand Down

0 comments on commit e756090

Please sign in to comment.