LHA archives on Linux

Have a question about our Software Developer Kit? Ask them here.
Post Reply
User avatar
AlfredOne
Beta Tester
Beta Tester
Posts: 132
Joined: Wed Dec 22, 2010 11:45 pm
Location: Terlizzi (BA) , Italy
Contact:

LHA archives on Linux

Post by AlfredOne »

Hello,
I'm trying to build adtools to cross-compile for AmigaOS4.1 on Linux Mint.
I have a problem extracting the "base.lha" archive contained in SDK 53.34.
The base.lha contains the following empty directories:
- Include/include_h/exec
- Include/include_h/expansion
- Include/include_h/utility
On AmigaOS4 empty directories are extracted correctly as empty directories.
On Linux Mint the lha command fails to extract the exec directory and all subsequent ones.
I tried to use 7z and it goes a little better: it manages to extract everything correctly except the empty directories which it interprets as a file of size 0 instead.

Anyone know a way to more reliably extract archives on Linux?
Amiga500 Kickstart1.3
AmigaONE XE G4 833MHz - 2GB RAM - Radeon9200 256MB
AmigaONE X1000 - 2GB RAM - Radeon R9-280X 3GB + Radeon HIS4670 1GB DDR3 - AmigaOS4.1
My site: http://project4a.webs.com
User avatar
Raziel
Posts: 1099
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: LHA archives on Linux

Post by Raziel »

Which lha command/program does linux mint use?

Have you tried lhasa?
sudo apt install lhasa
It's just for unpacking, but maybe works for you
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
AlfredOne
Beta Tester
Beta Tester
Posts: 132
Joined: Wed Dec 22, 2010 11:45 pm
Location: Terlizzi (BA) , Italy
Contact:

Re: LHA archives on Linux

Post by AlfredOne »

lhasa was the first tool I used and opened a bug on the github site:
https://github.com/fragglet/lhasa/issues/37

This is the answer from the author of lhasa:

"The problem is that the item that should have been a directory (type "lhd") is erroneously stored as a regular file (type "lh0"), due to a bug in whatever program created the LHA file. The item does not have a filename; it only has a directory name. Lhasa treats a file without a filename as a fatal error."

So it seems that the program used to create the AmigaOS SDK lha archive has a bug.
Note: despite the bug, on AmigaOS4 I am able to extract empty directories correctly.
Amiga500 Kickstart1.3
AmigaONE XE G4 833MHz - 2GB RAM - Radeon9200 256MB
AmigaONE X1000 - 2GB RAM - Radeon R9-280X 3GB + Radeon HIS4670 1GB DDR3 - AmigaOS4.1
My site: http://project4a.webs.com
User avatar
walkero
Site Admin
Posts: 58
Joined: Mon Dec 20, 2010 2:05 pm
Location: Athens/Dublin
Contact:

Re: LHA archives on Linux

Post by walkero »

@AlfredOne

Try to compile a proper version of lha

Code: Select all

    git clone https://github.com/jca02266/lha.git;
    mkdir build;
    cd lha;
    autoreconf -vfi;
    cd ../build;
    ../lha/configure --prefix=/usr;
    make;
    make install;
That's what I am doing in my docker images for the cross-compiling environments I use.
https://github.com/walkero-gr/docker4AmigaVBCC
https://github.com/walkero-gr/AmigaGCConDocker
If you develop or want to develop for AmigaOS 4.x, then join us at OS4Coding.net
Post Reply