public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Florian Schmaus <flow@gentoo.org>
To: "Michał Górny" <mgorny@gentoo.org>, gentoo-dev@lists.gentoo.org
Cc: pacho@gentoo.org
Subject: Re: [gentoo-dev] [PATCH 0/1] [RFC] greadme.eclass
Date: Tue, 9 Jan 2024 09:30:07 +0100	[thread overview]
Message-ID: <b1188769-0d07-4700-9555-ce67ba9f762d@gentoo.org> (raw)
In-Reply-To: <1bd554f569029d8d99d315fa2d965ca63e76dbb7.camel@gentoo.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 3803 bytes --]

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, and "fixing" readme.gentoo-r1 
would consist of copying most of greadme into readme.gentoo-r1, while 
still having the "legacy" readme.gentoo-r1 functionality in it.

Starting over strikes me as sensible in this case.


>> 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.


 > It's basically
 > a case of "standard feature X doesn't work for me sometimes, so I now
 > randomly disable X via my eclass, and hope nobody notices".

The primary motivation for posting this RFC was to find a solution and 
avoid the "docompress -x" approach. However, I don't think there is one 
that does not require adjusting PMS to provide the guarantee that the 
eclass can decompress the compressed doc file.

Adjusting PMS seems overkill just for avoiding to exclude a single small 
file from compression.

I also tried to make the greadme eclass handle unpacking errors 
gracefully. This turned out to be harder than I hoped because most 
(all?) functions of unpacker.eclass are not nonfatal compatible. The 
same is true for unpack() from PMS, which is used by unpacker.eclass.

I'll send out v2 of greadme.eclass soon.

Looking at the conditional _GREADME_COMPRESS code, you will find that 
adding support for compressing the doc file introduces a lot of 
complexity to the eclass. That would still make me consider it, but I 
can not see any reliable approach to unpacking that does not involve 
adjusting PMS.

Surely you would be able to correct me if I am wrong.


>> 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.
> 
> The compression mechanism automatically detects when the file is too
> small to be worth compressing.  See PORTAGE_DOCOMPRESS_SIZE_LIMIT.

How is this mechanism helpful here?

- Flow


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 17273 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

  reply	other threads:[~2024-01-09  8:30 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-06 17:01 [gentoo-dev] [PATCH 0/1] [RFC] greadme.eclass Florian Schmaus
2024-01-06 17:01 ` [gentoo-dev] [PATCH 1/1] greadme.eclass: new eclass Florian Schmaus
2024-01-06 17:21 ` [gentoo-dev] [PATCH 0/1] [RFC] greadme.eclass Michał Górny
2024-01-09  8:30   ` Florian Schmaus [this message]
2024-01-09  8:39     ` [gentoo-dev] [PATCH v2 1/3] greadme.eclass: new eclass Florian Schmaus
2024-01-09  8:39       ` [gentoo-dev] [PATCH v2 2/3] add UNPACKER_NO_BANNER variable Florian Schmaus
2024-01-09  8:45         ` [gentoo-dev] " Florian Schmaus
2024-01-09  8:39       ` [gentoo-dev] [PATCH v2 3/3] greadme.eclass: set UNPACKER_NO_BANNER Florian Schmaus
2024-01-09 11:23       ` [gentoo-dev] [PATCH v2 1/3] greadme.eclass: new eclass David Seifert
2024-01-09 11:30         ` Florian Schmaus
2024-06-02 13:57       ` [gentoo-dev] [PATCH 0/4] Improve readme.gentoo-r1.eclass Florian Schmaus
2024-06-02 13:57         ` [gentoo-dev] [PATCH 1/4] readme.gentoo-r1.eclass: display readme if content changed (or fresh install) Florian Schmaus
2024-06-02 15:34           ` Ulrich Mueller
2024-06-02 15:48             ` Eli Schwartz
2024-06-02 16:28               ` Ulrich Mueller
2024-06-02 17:48                 ` Florian Schmaus
2024-06-02 17:51                 ` Eli Schwartz
2024-06-02 18:24                   ` Ulrich Mueller
2024-06-04 15:15                     ` Florian Schmaus
2024-06-04 17:45                       ` Ulrich Mueller
2024-06-04 18:28                         ` Florian Schmaus
2024-06-04 18:33                           ` Eli Schwartz
2024-06-04 18:40                           ` Ulrich Mueller
2024-06-04 18:37                         ` Ionen Wolkens
2024-06-04 18:59                           ` Ionen Wolkens
2024-06-02 16:16             ` Florian Schmaus
2024-06-02 13:57         ` [gentoo-dev] [PATCH 2/4] readme.gentoo-r1.eclass: use _GREADME_TMP_FILE in existing code Florian Schmaus
2024-06-02 13:57         ` [gentoo-dev] [PATCH 3/4] readme.gentoo-r1.eclass: add readme.gentoo_stdin() Florian Schmaus
2024-06-02 13:57         ` [gentoo-dev] [PATCH 4/4] readme.gentoo-r1.eclass: add readme.gentoo_file() Florian Schmaus
2024-06-02 15:25         ` [gentoo-dev] [PATCH 0/4] Improve readme.gentoo-r1.eclass Ulrich Mueller
2024-06-02 16:12           ` Florian Schmaus
2024-06-02 16:40             ` Ulrich Mueller
2024-06-02 17:34               ` Florian Schmaus
2024-01-09  9:59     ` [gentoo-dev] [PATCH 0/1] [RFC] greadme.eclass Michał Górny
2024-01-09 10:39       ` Florian Schmaus
2024-01-09 10:43         ` Michał Górny
2024-01-09 10:47           ` Florian Schmaus
2024-01-10 11:04 ` Sam James
2024-01-10 13:23   ` Florian Schmaus
2024-01-10 13:58     ` Ulrich Mueller
2024-01-10 14:30       ` Florian Schmaus
2024-01-10 15:10         ` Ulrich Mueller
2024-01-10 15:54           ` Florian Schmaus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1188769-0d07-4700-9555-ce67ba9f762d@gentoo.org \
    --to=flow@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=mgorny@gentoo.org \
    --cc=pacho@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox