Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZIP format on Linux, no folders(2.0.4) #191

Closed
rysson opened this issue May 2, 2021 · 8 comments
Closed

ZIP format on Linux, no folders(2.0.4) #191

rysson opened this issue May 2, 2021 · 8 comments

Comments

@rysson
Copy link

rysson commented May 2, 2021

Hi, thanks for you work.

I have small issue in 2.0.4 in MiddleCommander on Linux Debian, there are no folder, only files with \ in name.
20210502-131116-650x151

In 2.0.1 everything was fine.

Could you change packing tool? Example 7zip (one developer had changed and the problem was gone).

@sirskunkalot
Copy link
Member

Hi rysson,

is this problem specific to MiddleCommander? Does cmdline zip for example treat it correctly?

@rysson
Copy link
Author

rysson commented May 2, 2021

@sirskunkalot, yes and I see why.
Your ZIP has \ separator. It's replaces with / on unpack but not replaced on view:

$ unzip -v ../ValheimModding-Jotunn-2.0.4.zip 
Archive:  ../ValheimModding-Jotunn-2.0.4.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
  180224  Defl:N    76450  58% 2021-05-02 11:33 469fe54c  plugins\Jotunn.dll
  107943  Defl:N   107978   0% 2021-05-02 12:10 2ed9df78  icon.png
     517  Defl:N      339  34% 2021-05-02 11:30 7f3aadc3  manifest.json
    6366  Defl:N     2603  59% 2021-04-30 22:28 f918e97a  README.md
--------          -------  ---                            -------
  295050           187370  37%                            4 files

Midnight commander takes path directly. And can event unpack file by file (in this case \ is not converted).

Example of ValheimModding-ValheimLib-0.0.16.zip, witch uses / as separator:

$ unzip -v ../../ValheimModding-ValheimLib-0.0.16.zip 
Archive:  ../../ValheimModding-ValheimLib-0.0.16.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    2523  Defl:N     1886  25% 2021-03-26 00:20 1cc2d743  icon.png
     288  Defl:N      214  26% 2021-05-02 13:18 59d5168b  manifest.json
       0  Stored        0   0% 2021-03-26 00:20 00000000  plugins/
       0  Stored        0   0% 2021-03-26 00:20 00000000  plugins/ValheimLib/
   55296  Defl:N    26452  52% 2021-03-26 00:20 92ed25c2  plugins/ValheimLib/ValheimLib.dll
   19571  Defl:N     3373  83% 2021-03-26 00:20 591a7b0a  plugins/ValheimLib/ValheimLib.xml
     115  Defl:N       95  17% 2021-05-02 13:18 3e108e6a  README.md
--------          -------  ---                            -------
   77793            32020  59%                            7 files

unzip version:

$ unzip --help
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.

EDIT:

7z doesn't convert on unpack

$ 7z x ../ValheimModding-Jotunn-2.0.4.zip
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=pl_PL.UTF-8,Utf16=on,HugeFiles=on,64 bits,24 CPUs AMD Ryzen 9 3900X 12-Core Processor             (870F10),ASM,AES-NI)
...
$ ls
 icon.png   manifest.json  'plugins\Jotunn.dll'   README.md

unzip converts as I wrote above but with warning:

$ unzip ../ValheimModding-Jotunn-2.0.4.zip 
Archive:  ../ValheimModding-Jotunn-2.0.4.zip
warning:  ../ValheimModding-Jotunn-2.0.4.zip appears to use backslashes as path separators
  inflating: plugins/Jotunn.dll      
  inflating: icon.png                
  inflating: manifest.json           
  inflating: README.md 

@sirskunkalot
Copy link
Member

OK, thx. Problem is that it is packed with PowerShell. And that specific cmdlet has no option to convert the path seperator. I consider switching to another packer.

@rysson
Copy link
Author

rysson commented May 2, 2021

Thanks a lot.

Do you paste all paths directly (with \) or do you prepare folder and pack them with recursion flag?
Maybe direct name force separator? I just guess, I have no Windows to check.

@sirskunkalot
Copy link
Member

Its recursive, I will give the DirectPath approach a try.

@Algorithman
Copy link
Contributor

There is a fixed version of powershell's Archive commands. Though not installed by default. (Why MS?)

PowerShell/Microsoft.PowerShell.Archive#48 (comment)

After installing, i got a proper zip from the publish script.

@sirskunkalot
Copy link
Member

I can confirm this works fine now on my Kali box. Fixed with v2.0.8

@rysson
Copy link
Author

rysson commented May 14, 2021

I've confirmed, it works in 2.0.8.
BUT it does not work in 2.0.9 (\ came back).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants