Page 1 of 1
LHA archives on Linux
Posted: Tue Jan 11, 2022 4:06 pm
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?
Re: LHA archives on Linux
Posted: Tue Jan 11, 2022 10:53 pm
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
Re: LHA archives on Linux
Posted: Wed Jan 12, 2022 5:34 pm
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.
Re: LHA archives on Linux
Posted: Wed Jan 19, 2022 6:28 pm
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
Re: LHA archives on Linux
Posted: Mon Aug 22, 2022 1:40 am
by rjd324
Linking this to
https://github.com/sba1/adtools/issues/112. I came across the same issue.
Just for completeness.
Re: LHA archives on Linux
Posted: Wed Sep 14, 2022 4:03 am
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.

Re: LHA archives on Linux
Posted: Wed Sep 14, 2022 4:07 am
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.