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: 135
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
  • Radeon RX550
My site: https://project4a.eu
User avatar
Raziel
Posts: 1170
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: 135
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
  • Radeon RX550
My site: https://project4a.eu
User avatar
walkero
Site Admin
Posts: 62
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
rjd324
Posts: 14
Joined: Sun Nov 21, 2021 3:52 am

Re: LHA archives on Linux

Post by rjd324 »

Linking this to https://github.com/sba1/adtools/issues/112. I came across the same issue.

Just for completeness.
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 645
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: LHA archives on Linux

Post by Hypex »

AlfredOne wrote: Wed Jan 12, 2022 5:34 pm 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.
This would explain a lot. I have found extracting LhA files on Linux doesn't work on newer archives or archives I pack from OS4. I tend to use DOpus but they always tend to break. It looks like a crash. I open an archive and it just quits when reading it.

Doesn't matter what I try. Rarely do any LhA files fork for me in Linux. Could be -lha5- or -lha6- but Linux doesn't like them.

It's really annoying as I always want to read an LhA archive on Linux a lot. :-)
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 645
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: LHA archives on Linux

Post by Hypex »

walkero wrote: Wed Jan 19, 2022 6:28 pm Try to compile a proper version of lha
Thanks. I'll give this a shot.
Post Reply