You are not logged in.

#1 2024-11-24 12:56:08

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,985

[Solved] convert extracted filename to lowercase in PKGBUILD

I currently have 4 wine prefixes for a Might & Magic 7 : For blood and Honor

vanilla install from cd
gog install
gog install + mod1
gog install + mod2

All 4 have grayface patch installed ( bugfixes and changes to allow running on later directx/windows versions) and the mods also include mmextension .
Currently all those prefixes are created manually on an ext4 /home filesystem .

I expect there will soon be 2 or 3 more as I intend to help testing a mod.
I'm considering to create packages for them.

The original is from around 1998 and uses dos-style uppercase filenames. gog install mixes upper & lowercase names and so do the mods .

As the mods overwrite files from the install the case of the filenames matters.
Fortunately the mods come as zip files and unzip has the option -LL to force lowercase on extraction .

I could download and extract those files manually in prepare() using unzip with that option, but I'd like to put them in source= and let makepkg do the job.

Unzip is fast and takes about a minute to extract the largest mod with 3.1 GiB compressed data.

Is there a way to mount folders case-insensitive ?

If not, how to convert the extracted files and subfolder contents to lowercase efficiently ?

Last edited by Lone_Wolf (2024-11-27 09:36:19)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#2 2024-11-25 02:08:21

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,147

Re: [Solved] convert extracted filename to lowercase in PKGBUILD

Have you considered using noextract and using the first line of prepare() as your custom extraction with -LL, similar to the 'lrzip' example used in the Wiki?

Offline

#3 2024-11-25 10:16:21

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,985

Re: [Solved] convert extracted filename to lowercase in PKGBUILD

looks very useful, thanks.

I didn't know there was a noextract array in PKGBUILD, was this recently added ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2024-11-25 10:20:12

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,477
Website

Re: [Solved] convert extracted filename to lowercase in PKGBUILD

It has been there for longer than I have been about here!

Offline

#5 2024-11-25 12:58:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,313

Re: [Solved] convert extracted filename to lowercase in PKGBUILD

For the other part of the question, you can actually enable per dir case insensitivity on ext4 filesystems since some 5.2 kernel or so: https://docs.kernel.org/admin-guide/ext … me-lookups -- though you need to tune2fs enable the casefold functionality on it unmounted if you want to do so after the fact: https://unix.stackexchange.com/a/559022

That reminds me... I've been meaning to enable that on my system for a game that has mods which sometimes rely on Windows' case insensitivity (i.e. basically your situation) but never got around to it, maybe this is the kick in the butt I need.

Last edited by V1del (2024-11-25 12:59:03)

Offline

#6 2024-11-27 09:35:53

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,985

Re: [Solved] convert extracted filename to lowercase in PKGBUILD

So there are 2 viable methods :

use noextract= and extract the files using unzip in prepare()

Use the casefold capibility of ext4 (requires changes outside of PKGBUILD) .

Thanls for the responses, declaring solved.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB