ouch icon indicating copy to clipboard operation
ouch copied to clipboard

Decompressing multiple archives conflicts with overwrite prompt

Open valoq opened this issue 4 months ago • 0 comments

Version

0.5.1

Description

When decompressing multiple archives that contain the same file or directory names, ouch asks the user if the files should be overwritten multiple times, which can also be a random archive in the list:

Current Behavior

ouch decompress testA.zip testB.zip testC.zip [INFO] Created temporary directory /tmp/experiment/./.tmpBER78Y to hold decompressed elements. [INFO] File 0 extracted to "/tmp/experiment/./.tmpBER78Y/test/" [INFO] Created temporary directory /tmp/experiment/./.tmpt6Uh2b to hold decompressed elements. [INFO] ".tmpBER78Y/test/a" extracted. (4.00 B) [INFO] Created temporary directory /tmp/experiment/./.tmp8oJZxo to hold decompressed elements. [INFO] File 0 extracted to "/tmp/experiment/./.tmpt6Uh2b/test/" [INFO] Successfully moved /tmp/experiment/./.tmpBER78Y/test to ./test. [INFO] File 0 extracted to "/tmp/experiment/./.tmp8oJZxo/test/" [INFO] Successfully decompressed archive in current directory (2 files). [INFO] ".tmpt6Uh2b/test/b" extracted. (4.00 B) [INFO] ".tmp8oJZxo/test/c" extracted. (4.00 B) Do you want to overwrite './test'? [Y/n] Do you want to overwrite './test'? [Y/n]

Expected Behavior

The user should be prompted multiple times, one after another with specification of which archive is asking to overwrite the specified files.

Example:

Archive testB.zip: Do you want to overwrite './test'? [Y/n] n
Archive testC.zip: Do you want to overwrite './test'? [Y/n] Y

Additional Information

The example used in this report should not ask to overwrite any data since there are not file conflicts (directories with the same name should not be considered a conflict by default) See https://github.com/ouch-org/ouch/issues/466

(The test archives all contain the folder test and a single text file a, b and c respectively) testA.zip testB.zip testC.zip

valoq avatar Oct 09 '24 13:10 valoq