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

OpenBSD: icewm -i list doesn't work by default because of tar implementation #179

Open
exceptbees opened this issue Nov 11, 2024 · 3 comments
Assignees

Comments

@exceptbees
Copy link

OpenBSD tar(1) strips off the trailing slash from directory names when listing archive contents, see more on that in the mailing list and the system's tar.c.

Compare:

$ lzip -cd icewm-extra.tar.lz | tar -tf - | head -1 
icewm-extra/18k

vs.

$ lzip -cd icewm-extra.tar.lz | gtar -tf - | head -1
icewm-extra/18k/

So icewm -i list only shows the list of themes if gtaris installed and exits silently if it's not. Would be nice to have it work with the platform's default tar.

P.S. Tested the archive with NetBSD's tar(1), and it does display trailing slashes in directory names. Don't have a FreeBSD system, so can't check.

@gijsbers
Copy link
Contributor

Yes. The function get_tar() in icewm/src/theminst.cc first looks for gtar on BSDs. Wasn't that installed on your OpenBSD? If it was, it should have worked, no?

@gijsbers gijsbers self-assigned this Nov 11, 2024
@exceptbees
Copy link
Author

gtar is not installed on OpenBSD by default, while tar is part of the system, so it doesn't work unless I explicitly intall gtar.

The man page only says that the option

requires the presence of the lzip, tar and wget or curl commands.

And as I undertand from the code, it was intended to work even with BSD's tar, because function get_tar() falls back to tar when it doesn't find gtar.

However, the while cicle in lines 165-175 relies on trailing slashes in the output of tar -tf - to find themes' names. OpenBSD's tar strips those slashes off, which makes icewm -i list print nothing.

Again, this is specific to how tar works on OpenBSD. NetBSD's one works fine.

gijsbers added a commit to bbidulock/icewm that referenced this issue Nov 11, 2024
@exceptbees
Copy link
Author

Thanks for the fix!

I've built icewm 3.6.0 applying the patch from the commit above. It now works with OpenBSD's tar, with a minor difference in the output.

When tar is used, the list is a column with extra spaces and an extra newline after the last theme:

$ icewm -i list  
18k            
 708090     
 Aalglatt  
 Anon       
[...snip...]
 yak
 yamm
 yellowmotif

$

With gtar installed, it's all in one row:

$ icewm -i list   
18k 708090 Aalglatt Anon Arc-Dark Area51 BerryXP BlueObscure Chicago CoolSteel Crux-Teal ElbergBlue ElbergGreen ElbergRed Flames95 FrostyG GlamICE IceBlueCurve IceBlueOkayish IceCrack2 IceGnome2 K-ath-Leen LightBox Natural No.15 OpenLook-shaped SilverXP SkyBox Slashdot Urbicande WhistlerX Wigren XPBlue XPSilver aesthetech aesthetech-big aeteria aquablue axxlite blueCrux blueHeart bluePlastic bluemetal2 daniel3 daniel4 daniel5 device dotFLAT dusk easy fake95 faux95 gnomeish gradient1 green gtk2 jaywalk jim-mac kaos kde2 liQuid mavvert metal metal-big metal-small mozmodern nice nice2 paranoia pkde pkde2 shiceMavvert slashdot small sortofaqua spiffICE tile tin tubes twilite unusualscars warp3 warp3x warp4 win95-dark xp xp-new yak yamm yellowmotif

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

2 participants