Skip to content

Commit

Permalink
chore: small fixes to Makefile and Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-grechkin committed Apr 17, 2023
1 parent 1c7b2b4 commit e996095
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 37 deletions.
35 changes: 26 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
BUILD_TYPE ?= "Debug"
DIR = ".build-$(BUILD_TYPE)"
THIS_FILE := $(abspath $(firstword $(MAKEFILE_LIST)))
THIS_DIR := $(dir $(THIS_FILE))

GIT_ROOT := $(shell git -C "$(THIS_DIR)" rev-parse --show-toplevel)
GIT_REPO := $(shell git config --file $(THIS_DIR)/.git/config --get remote.origin.url)
GIT_REPO_NAME := $(shell basename -s .git $(GIT_REPO))

BUILD_TYPE ?= Debug
BUILD_DIR = $(GIT_ROOT)/.build-$(BUILD_TYPE)

.PHONY: \
build
build \
clean \
init \
tidy

$(BUILD_DIR):
@mkdir -p "$(BUILD_DIR)"

build: $(BUILD_DIR)
@cmake -DCMAKE_BUILD_TYPE="$(BUILD_TYPE)" -S . -B "$(BUILD_DIR)"
@make -j -C "$(BUILD_DIR)" install

$(DIR):
mkdir -p "$(DIR)"
clean:
@rm -rf "$(BUILD_DIR)"
@rm -rf "$(GIT_ROOT)/.tidyall.d"

build:
@cmake -DCMAKE_BUILD_TYPE="$(BUILD_TYPE)" -S . -B "$(DIR)"
@make -j -C "$(DIR)" install
init:
@git -C "$(GIT_ROOT)" submodule update --init

tidy:
@cp -f "$(shell git rev-parse --show-toplevel)/.clang-format" /tmp
@cp -f "$(GIT_ROOT)/.clang-format" /tmp
@tidyall -a -j 4
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,57 +36,57 @@ encoding `cp866` will be enforced for listing archived files/directories.

### Command line options

* -p <PASSWORD>
* -p `<PASSWORD>`

Provide a password which will be used if archive is protected with a password.
Provide a password which will be used if archive is protected with a password.

### Environment variables

* FUSE3_P7ZIP_LIBRARY

Change where application searches for 7z.so library. By default this is `/usr/lib/p7zip/7z.so`
Change where application searches for 7z.so library. By default this is `/usr/lib/p7zip/7z.so`

* FUSE3_P7ZIP_PASSWORD

Provide a password which will be used if archive is protected with a password.
Provide a password which will be used if archive is protected with a password.

* FUSE3_P7ZIP_FORCE_ENCODING

Some archives (especially those ones created on windows) have file names encoded in non Unicode encoding. This
environment variable forces application to use alternative encoding to decode file names.
Some archives (especially those ones created on windows) have file names encoded in non Unicode encoding. This
environment variable forces application to use alternative encoding to decode file names.

for example:
```
$ fuse3-p7zip cyrillic-created-on-windows.zip /tmp/mnt
$ ls /tmp/mnt
''$'\302\217''ਢ¥â.txt'
for example:
```
$ fuse3-p7zip cyrillic-created-on-windows.zip /tmp/mnt
$ ls /tmp/mnt
''$'\302\217''ਢ¥â.txt'
$ fusermount -u /tmp/mnt
$ fusermount -u /tmp/mnt
$ FUSE3_P7ZIP_FORCE_ENCODING=CP866 fuse3-p7zip cyrillic-created-on-windows.zip /tmp/mnt
$ ls /tmp/mnt
'Привет.txt'
```
$ FUSE3_P7ZIP_FORCE_ENCODING=CP866 fuse3-p7zip cyrillic-created-on-windows.zip /tmp/mnt
$ ls /tmp/mnt
'Привет.txt'
```

* FUSE3_P7ZIP_MAX_OPEN_SIZE

The nature of 7z API does not allow to have random access to the content of a file in archive. This means that each
file should be extracted to a temporary folder on access. If this file is too big (for example it's partition in an
.img file - application will extract the whole partition to /tmp. Most of the time on modern Linux it's a RAM based
folder) To prevent this situation you can set this environment variable to a maximum allowed file size. Attempts
openining any file in archive bigger than this will end up in E2BIG error.
The nature of 7z API does not allow to have random access to the content of a file in archive. This means that each
file should be extracted to a temporary folder on access. If this file is too big (for example it's partition in an
.img file - application will extract the whole partition to /tmp. Most of the time on modern Linux it's a RAM based
folder) To prevent this situation you can set this environment variable to a maximum allowed file size. Attempts
openining any file in archive bigger than this will end up in E2BIG error.

* FUSE3_P7ZIP_FORMATS

When opening a file application tries all formats in the alphabetical order. Sometimes it's desired to open a file
with a format later in the list. This environment variable allows to override formats order.
When opening a file application tries all formats in the alphabetical order. Sometimes it's desired to open a file
with a format later in the list. This environment variable allows to override formats order.

for example (try open .iso file with Iso or Udf formats first and only fallback on APM and GPT formats)
```
FUSE3_P7ZIP_FORMATS="Iso:Udf:*:APM:GPT" fuse3-p7zip ubuntu-20.04-desktop-amd64.iso /tmp/mnt
```
for example (try open .iso file with Iso or Udf formats first and only fallback on APM and GPT formats)
```
FUSE3_P7ZIP_FORMATS="Iso:Udf:*:APM:GPT" fuse3-p7zip ubuntu-20.04-desktop-amd64.iso /tmp/mnt
```

To check the list of all available formats run `7z i` command
To check the list of all available formats run `7z i` command

## Examples

Expand Down

0 comments on commit e996095

Please sign in to comment.