Remove the usage of 7z "-r" flag
Closed this issue · 1 comments
rapiz1 commented
From 7z manpages
-r[-|0]
Recurse subdirectories (CAUTION: this flag does not do what you think, avoid using it)
Do not use "-r" because this flag does not do what you think.
https://itectec.com/superuser/7z-what-does-the-r-flag-do/
This doesn't fit most people's expectation. And simply removing it will do.
rapiz1 commented
A little explanation here:
$ tree
.
├── bar
│ └── foo
└── foo
$ 7z a -tzip expect.zip foo
$ 7z a -r -tzip actual.zip foo
$ 7z l expect.zip
7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs x64)
Scanning the drive for archives:
1 file, 140 bytes (1 KiB)
Listing archive: expect.zip
--
Path = expect.zip
Type = zip
Physical Size = 140
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2022-01-06 16:21:55 ..... 0 0 foo
------------------- ----- ------------ ------------ ------------------------
2022-01-06 16:21:55 0 0 1 files
$ 7z l actual.zip
7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs x64)
Scanning the drive for archives:
1 file, 266 bytes (1 KiB)
Listing archive: actual.zip
--
Path = actual.zip
Type = zip
Physical Size = 266
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2022-01-06 16:21:58 ..... 0 0 bar/foo
2022-01-06 16:21:55 ..... 0 0 foo
------------------- ----- ------------ ------------ ------------------------
2022-01-06 16:21:58 0 0 2 files