serpent-os / boulder-d-legacy

Replaced by Rust tooling
https://serpentos.com
21 stars 7 forks source link

builder: Optionally compress man & info pages. Resolves #16 #26

Open joebonrichie opened 2 years ago

joebonrichie commented 2 years ago

Compress any man or info page files found in the manifest with gzip, if enabled by the packager.

There are two considerations:-

joebonrichie commented 1 year ago

Just need to find a file with man page symlinks now and should be good to go. There is also an annoying bug where formattedSize introduces some useless whitespace.

sunnyflunk commented 1 year ago

Just need to find a file with man page symlinks

Probably easier to add a symlink manually to test. But I'm pretty sure it won't work. The first check ensures only Regular files hit the NextFunction (i.e. so a Symlink will never hit compressPage).

Also with if ((fileInfo.type == FileType.Symlink) && (fileInfo.type != FileType.Directory)) the 2nd check is redundant as if it's a Symlink, then it will always not be a Directory.

joebonrichie commented 1 year ago

This is borked with the new zstd pledged size stuff. With the initial move to zstdoubledee it was working okay. Just hangs forever when emitting the packages. Don't really know what's going on.

joebonrichie commented 1 year ago

Bisected to here: https://github.com/serpent-os/moss-format/commit/641c047c3c602881c6900735f4735e6bfb7c32e0

joebonrichie commented 1 year ago

Seems to be failing to flush (remaining never decreases) [12:57:12] TRACE FLUSHING remaining 18446744073709551544

from here: https://github.com/serpent-os/moss-format/blob/main/source/moss/format/binary/writer/zstd_token.d#L117

joebonrichie commented 1 year ago

Switched to gzip compression and it's now working, meaning mandb can correctly display the resulting files! Switching to zstd in the future when the high level API is a bit more fleshed out is an option but I don't really want to use the low-level bindings for something like this.

Updated symlinks is now seemingly working (with the xz pkg) but I need to find a package I can safely remove and reinstall in the rootfs to fully test it, which is the last blocker. [Man] Updated symlink /usr/share/man/ro/man1/unxz.1 to xz.1.gz