AutoarExtract: refactor pathname building process
Previously, operations with pathnames obtained from libarchive were performed directly on strings, without the use of the GFile API. This lead to an increasing complexity of the code and also to oversights. Also, the process of turning a path in the archive to a path on the file system had a complex logic. It relied on multiple parameters that could have different meanings according to some context elements, such as the number of files in an archive. One example is the `top_level_dir` member, which could be a file if the archive had just one element inside, or a directory in other situations. In order to fix these issues, use the GFile API for path operations, like finding a common prefix, path concatenation etc. For the logic part, make sure that the top level directory is always a directory so the number of checks can be reduced. https://bugzilla.gnome.org/show_bug.cgi?id=768645
parent
08cf3543
Please register or sign in to comment