I really like the functionality of readme.gentoo-r1.eclass, as it
allows to communicate Gentoo-specific information about a package to
the user. Especially as it improves the signal-to-noise ratio of
messages arriving to our users.
However, readme.gentoo-r1.eclass will only show this information on
new installs, but not if the information changed. This is a major
drawback. Furthermore, readme.gentoo-r1.eclass does not provide an API
to assemble the information via heredoc.
The main item is doc compression. Right now, greadme.eclass defaults
to add the readme doc to the compression exclusion list via
"docompress -x". A mode where the readme doc is compressed, just as readme.gentoo-r1.eclass does, can be activated by setting
_GREADME_COMPRESS. However, I believe this mode is fragile as it can
not be guaranteed that a binary for the used compression algorithms is installed on the host [1].
I believe it is reasonable to simply install the readme doc
uncompressed, since they are typically only a few lines long. However,
if anyone can point out a way to achieve the desired functionality with
a compressed readme doc, then please let me know.
On 06/01/2024 18.21, Michał Górny wrote:
On Sat, 2024-01-06 at 18:01 +0100, Florian Schmaus wrote:
I really like the functionality of readme.gentoo-r1.eclass, as it
allows to communicate Gentoo-specific information about a package to
the user. Especially as it improves the signal-to-noise ratio of
messages arriving to our users.
However, readme.gentoo-r1.eclass will only show this information on
new installs, but not if the information changed. This is a major drawback. Furthermore, readme.gentoo-r1.eclass does not provide an API
to assemble the information via heredoc.
Are you implying that readme.gentoo-r1 is unfixable and you need to
start over, and have a third generation of eclasses to install a readme file?
Not at all. See the second item of the TODO list in the eclass' description.
That said, both eclasses are rather small,
The main item is doc compression. Right now, greadme.eclass defaults
to add the readme doc to the compression exclusion list via
"docompress -x". A mode where the readme doc is compressed, just as readme.gentoo-r1.eclass does, can be activated by setting _GREADME_COMPRESS. However, I believe this mode is fragile as it can
not be guaranteed that a binary for the used compression algorithms is installed on the host [1].
Dangling reference here. In any case, documentation compression is
a standard feature of the package manager. If it doesn't work for
whatever reason, I'd rather see you focus on find a good solution rather than working it around via abusing `docompress -x`.
The problem is the lack of a guarantee that the utilities required to decompress the file are available at installation time.
It gets even worse if you consider binpkgs, as you have surely read the comment while looking at the code of the greadme.eclass.
Even if we say it is the user's fault, then the problem of handling a decompressor failure would still exist. The eclass does not gracefully continue when decompressing the doc file, but instead it runs into a
die(). To address this we would need to make unpacker.eclass and
unpack() aware of nonfatal. The latter would require a PMS change.
Or, I could duplicate unpack logic --- which is probably a lot to
account for the various compression options --- in the eclass. But I
suspect be both do not want that.
I really like the functionality of readme.gentoo-r1.eclass, as it
allows to communicate Gentoo-specific information about a package to
the user. Especially as it improves the signal-to-noise ratio of
messages arriving to our users.
However, readme.gentoo-r1.eclass will only show this information on
new installs, but not if the information changed. This is a major
drawback. Furthermore, readme.gentoo-r1.eclass does not provide an API
to assemble the information via heredoc.
The following patch includes a new eclass named "greadme", that
addresses those shortcomings of readme.gentoo-r1.eclass and hopefully
can be seen as a general overhaul.
On Wed, 10 Jan 2024, Florian Schmaus wrote:
On 10/01/2024 12.04, Sam James wrote:
1) The name seems odd (why not readme.gentoo-r2)?
2) Why can't the existing eclass be improved?
Both points, the name of the eclass and the question if this should be
added to the existing eclass or as a new eclass, are absolutely *no*
hill I want to die on.
What I *really* care about is having the functionality that there is a
readme eclass that *also* shows the elog message if the README's
content changed (and not just on the first installation of the
package).
4) The compression deal seems not worth bothering with.
Just to clarify: you are agreeing that excluding the readme doc from
being compressed is fine?
[...]
It exports phase functions, which readme.gentoo-r1 does not.
The readme.gentoo-r1 eclass always shoves the full content of the
readme into an environment variable.
On Wed, 10 Jan 2024, Florian Schmaus wrote:
On 10/01/2024 14.58, Ulrich Mueller wrote:
Looks like readme.gentoo-r1 already gives you control over this:
# If you want to show them always, please set FORCE_PRINT_ELOG to a non empty
# value in your ebuild before this function is called.
# This can be useful when, for example, DOC_CONTENTS is modified, then, you can
# rely on specific REPLACING_VERSIONS handling in your ebuild to print messages
# when people update from versions still providing old message.
It is easy to forget setting FORCE_PRINT_ELOG, just as it is easy to
forget to unset it again.
An automatism is always preferable over a manual solution.
Just to clarify: you are agreeing that excluding the readme doc fromPlease respect the user's compression settings there. IMHO
being compressed is fine?
overriding
them with docompress -x is a big no-no.
Then why does "docompress -x" exist at all?
There seems to be a big win-win if we override the compression
settingin this case.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (2 / 14) |
Uptime: | 101:47:18 |
Calls: | 8,363 |
Calls today: | 2 |
Files: | 13,165 |
Messages: | 5,898,006 |