• [gentoo-dev] [PATCH v2 1/3] greadme.eclass: new eclass

    From Florian Schmaus@21:1/5 to All on Tue Jan 9 09:40:02 2024
    This new eclass is similar to readme.gentoo-r1.eclass. The main
    differences are as follows. Firstly, it also displays the doc file
    contents if they have changed. Secondly, it provides a convenient API to install the doc file via stdin.

    Furthermore, this eclass dos not store the doc file's contents in an environment variable, which helps to keep the environment size of
    ebuilds using the eclass small.

    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    ---
    eclass/greadme.eclass | 307 ++++++++++++++++++++++++++++++++++++++++++
    1 file changed, 307 insertions(+)
    create mode 100644 eclass/greadme.eclass

    diff --git a/eclass/greadme.eclass b/eclass/greadme.eclass
    new file mode 100644
    index 000000000000..25e0210406c1
    --- /dev/null
    +++ b/eclass/greadme.eclass
    @@ -0,0 +1,307 @@
    +# Copyright 1999-2024 Gentoo Authors
    +# Distributed under the terms of the GNU General Public License v2
    +
    +# @ECLASS: greadme.eclass
    +# @MAINTAINER:
    +# Florian Schmaus <flow@gentoo.org>
    +# @AUTHOR:
    +# Author: Florian Schmaus <flow@gentoo.org>
    +# @SUPPORTED_EAPIS: 6 7 8
    +# @BLURB: install a doc file, that will be conditionally shown via elog messages
    +# @DESCRIPTION:
    +# An eclass for installing a README.gentoo doc file recording tips
    +# shown via elog messages. With this eclass, those elog messages will only be +# shown at first package installation or if the contents of the file have changed.
    +# Furthermore, a file for later reviewing will be installed under
    +
  • From Florian Schmaus@21:1/5 to All on Tue Jan 9 09:40:02 2024
    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    ---
    eclass/0000-cover-letter.patch | 49 ++++
    eclass/0001-greadme.eclass-new-eclass.patch | 305 ++++++++++++++++++++
    eclass/unpacker.eclass | 7 +
    3 files changed, 361 insertions(+)
    create mode 100644 eclass/0000-cover-letter.patch
    create mode 100644 eclass/0001-greadme.eclass-new-eclass.patch

    diff --git a/eclass/0000-cover-letter.patch b/eclass/0000-cover-letter.patch new file mode 100644
    index 000000000000..2e162d419a44
    --- /dev/null
    +++ b/eclass/0000-cover-letter.patch
    @@ -0,0 +1,49 @@
    +From edff06160e33b361c9d6a7e273fc7808337c4518 Mon Sep 17 00:00:00 2001
    +From: Florian Schmaus <flow@gentoo.org>
    +Date: Sat, 6 Jan 2024 17:44:44 +0100
    +Subject: [PATCH 0/1] [RFC] greadme.eclass
    +
    +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.ecl
  • From Florian Schmaus@21:1/5 to All on Sun Jun 2 16:00:01 2024
    Following up on the comments of the last patchset, this revision
    incorporates the functionality of the initially proposed
    greadme.eclass into the existing readme.gentoo-r1.eclass. While this
    misses the chance to get rid of some ballast of the existing eclass,
    people asked to extend the existing eclass instead of starting fresh.

    As a quick reminder, those changes aim to improve the user experience
    of readme.gentoo-r1.eclass by reducing the amount of messages
    presented to the user upon emerge. This is achieved by only showing
    the contents of README.gentoo *if they have changed* (or on fresh installations).

    The previous revision was criticized for using "docompress -x
    README.gentoo", i.e., excluding README.gentoo from being
    compressed. However, exclusion from compression is necessary to
    reliably detect if the contents have changed.

    After discussing this with others, we came up with the following
    compromise that should be acceptable by everyone.

    Instead of excluding the whole README.eclass from compression, we use
    chksum to create the 4-byte CRC value of the file. The eclass then
    uses the existing 4-byte value and compares it with the 4-byte value
    in the package's image directory to determine if the contents of
    README.gentoo have changed.

    I would like to thank Sam for the helpful comments that led to the
    resulting design.

    Note that this changes readme.gentoo-r1.eclass to export phase
    functions when it previously did not.
    Finally, I'd like to (restate) my concern that updating the existing
    eclass, instead of starting fresh with a new eclass, misses the chance
    to eliminate some ballast.


    Florian Schmaus (4):
    readme.gentoo-r1.eclass: display readme if content changed (or fresh
    install)
    readme.gentoo-r1.eclass: use _GREADME_TMP_FILE in existing code
    readme.gentoo-r1.eclass: add readme.gentoo_stdin()
    readme.gentoo-r1.eclass: add readme.gentoo_file()

    eclass/readme.gentoo-r1.eclass | 206 +++++++++++++++++++++++++++++----
    1 file changed, 185 insertions(+), 21 deletions(-)

    --
    2.44.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Florian Schmaus@21:1/5 to All on Sun Jun 2 16:00:01 2024
    The new readme.gentoo_file() function provided more flexibility from
    where the readme file is obtained, compared to the existing methods.

    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    ---
    eclass/readme.gentoo-r1.eclass | 21 +++++++++++++++++++++
    1 file changed, 21 insertions(+)

    diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass index db7fa0c47077..619f3eaa8fbf 100644
    --- a/eclass/readme.gentoo-r1.eclass
    +++ b/eclass/readme.gentoo-r1.eclass
    @@ -110,6 +110,27 @@ readme.gentoo_stdin() {
    readme.gentoo_create_doc
    }

    +# @FUNCTION: readme.gentoo_file
    +# @USAGE: <file>
    +# @DESCRIPTION:
    +# Installs the provided file as readme doc.
    +readme.gentoo_file() {
    + debug-print-function ${FUNCNAME} "${@}"
    +
    + local input_doc_file="${1}"
    + if [[ -z "${input_doc_file}" ]]; then
    + die "No file specified"
    + fi
    +
    + if [[ -f "${_GREADME_TMP_FILE}" ]]; then
    + die "Gentoo README already exists"
    + fi
    +
    + cp "${input_doc_file}" "${_GREADME_TMP_FILE}" || die "Failed to copy ${input_doc_file}"
    +
    + readme.gentoo_create_doc
    +}
    +
    # @FUNCTION: readme.gentoo_create_doc
    # @DESCRIPTION:
    # Create doc file with ${DOC_CONTENTS} variable (preferred) and, if no
  • From Florian Schmaus@21:1/5 to All on Sun Jun 2 16:00:01 2024
    Add a new function readme.gentoo_stdin() that consumes the content of README.gentoo from stdin. In many cases, this is a supperiour method to construct readme, compared to the eclass' DOC_CONTENTS approach.

    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    ---
    eclass/readme.gentoo-r1.eclass | 51 ++++++++++++++++++++++++++++++++++
    1 file changed, 51 insertions(+)

    diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass index 078077241944..db7fa0c47077 100644
    --- a/eclass/readme.gentoo-r1.eclass
    +++ b/eclass/readme.gentoo-r1.eclass
    @@ -14,6 +14,22 @@
    # shown at first package installation and a file for later reviewing will be
    # installed under /usr/share/doc/${PF}
    #
    +# @CODE
    +# inherit readme.gentoo-r1
    +#
    +# src_install() {
    +# …
    +# readme.gentoo_stdin <<-EOF
    +# This is the content of the created readme doc file.
    +# EOF
    +# …
    +# if use foo; then
    +# readme.gentoo_stdin --apend <<-EOF
    +# This is conditional readme content, based on USE=foo.
    +# EOF
    +# fi
    +# }
    +# @CODE
    #
    # You need to call readme.gentoo_create_doc in src_install phase if you
    # use DOC_CONTENTS or obtain the readme from FILESIDR.
    @@ -59,6 +75,41 @@ _GREADME_DOC_DIR="usr/share/doc/${PF}"
    _GREADME_REL_PATH="${_GREA
  • From Florian Schmaus@21:1/5 to All on Sun Jun 2 16:00:01 2024
    The previous commit introduced _GREADME_TMP_FILE. This commit changes
    the existing code to use this variable.

    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    ---
    eclass/readme.gentoo-r1.eclass | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass index 2a79911cafbf..078077241944 100644
    --- a/eclass/readme.gentoo-r1.eclass
    +++ b/eclass/readme.gentoo-r1.eclass
    @@ -70,20 +70,20 @@ readme.gentoo_create_doc() {

    if [[ -n "${DOC_CONTENTS}" ]]; then
    if [[ -n "${DISABLE_AUTOFORMATTING}" ]]; then
    - echo "${DOC_CONTENTS}" > "${T}"/README.gentoo || die
    + echo "${DOC_CONTENTS}" > "${_GREADME_TMP_FILE}" || die
    else
    local saved_flags=$-
    set -f # disable filename expansion in echo arguments
    echo -e ${DOC_CONTENTS} | fold -s -w 70 \
    - | sed 's/[[:space:]]*$//' > "${T}"/README.gentoo
    + | sed 's/[[:space:]]*$//' > "${_GREADME_TMP_FILE}"
    assert
    set +f -${saved_flags}
    fi
    elif [[ -f "${FILESDIR}/README.gentoo-${SLOT%/*}" ]]; then
    - cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo || die
    + cp "${FILESDIR}/README
  • From Florian Schmaus@21:1/5 to All on Sun Jun 2 16:00:01 2024
    Improve the user experience of readme.gentoo-r1.eclass by reducing the
    number of messages presented to the user upon emerge. We reduce the
    number of messages by only showing the contents of README.gentoo *if
    they have changed* (or on fresh installations).

    To be able to detect if the content has changed, the eclass now records
    the 4-byte CRC value of README.gentoo. Upon installation, this 4-byte
    value is compared. It is necessary to indirectly compare the content, as README.gentoo is installed via dodoc, which is subject to docdir
    compression, and there is no guarantee that we will be able to
    uncompress the live system's version of README.gentoo (let alone that it
    is not trivial to find a suitable decompressor candidate).

    Signed-off-by: Florian Schmaus <flow@gentoo.org>
    ---
    eclass/readme.gentoo-r1.eclass | 124 ++++++++++++++++++++++++++++-----
    1 file changed, 108 insertions(+), 16 deletions(-)

    diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass index 202ba31f4f70..2a79911cafbf 100644
    --- a/eclass/readme.gentoo-r1.eclass
    +++ b/eclass/readme.gentoo-r1.eclass
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2023 Gentoo Authors
    +# Copyright 1999-2024 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: readme.gentoo-r1.eclass
    @@ -14,8 +14,11 @@
    # shown at first package installation and a file for later reviewing will be
    # installed under /usr/share/doc/${PF}
    #
    -# You need to call readme.gentoo_create_doc in src_install phase and
    -# readme.gentoo_print_elog in pkg_postinst
    +#
    +# You need to call readme.gentoo_create_doc in src_install phase if you
    +# use DOC_CONTENTS or obtain the readme from FILESIDR.
    +#
    +# Note that this eclass exports pkg_preinst and pkg_postinst functions.

    if [[ -z ${_READM
  • From Ulrich Mueller@21:1/5 to All on Sun Jun 2 17:30:01 2024
    On Sun, 02 Jun 2024, Florian Schmaus wrote:

    Note that this changes readme.gentoo-r1.eclass to export phase
    functions when it previously did not.

    IMHO that's a very bad idea and will probably break ebuilds that rely
    on the current behaviour.

    (Also, readme.gentoo.eclass used to export phase functions, which was
    removed in -r1. So you should have a good rationale for reverting this.)

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZcjv0PHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uGRMH/27DCj91d18Ix+FUQ7Cpgds7MqZLo1zoaaWB ljmOxIKb+DKIb4KIjK5P6pIz8htiHHRlCvuLb5hISX9CIv6jIwmvunv4xRSlzeL6 GcFjoWOW+V41iMvriIZ9GuPgKcXuZiWeE+dNYVXKYi0jJHa67fCxfodq0ywY97A5 5y9NXjFTeIXBynh5NwDhBQ/2MgrASr9dOoN1MUueLaUBldEjBNkUKhgw9fulWFLP H5/hNQpNl3pgrKmmkBMgWe65FJZ1jaVNOKdC3CpaqBOPgbW19a9SO7MvCb3Fab8d Wx5zCpfFJCJZXvx0pJcSVcPkOucjCe8gh1vVi6t5NzKvLI3hpck=
    =Sz3k
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sun Jun 2 17:40:01 2024
    On Sun, 02 Jun 2024, Florian Schmaus wrote:

    + (
    + insinto "${_GREADME_DOC_DIR}"
    +
    + doins "${_GREADME_TMP_FILE}"
    + cksum --raw "${_GREADME_TMP_FILE}" | newins - "${_GREADME_HASH_FILENAME}"
    + assert
    + )

    Why do you need that hash file? The old README file exists on the
    system, so couldn't you just compare the new one with it?

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZckSMPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4u+FQH/0FNmZT3+BC5u0O/swHDGDCMvnxBe1q87ENr LLywr1MDDtt2R45kYlIrXDz/DT3l6vPnCJvZbaylJPHKo44orZFStjg87zB0acmG nZYBB6zKc+IqdO0u/PWjrRnP5aXORuh7qpwEou96KCVZFs9nup/S/9FZ8ti63ipu 11Nn02lUFEY/E8A7WWlVKuEFx/Jo9C8xwaVII6zEjKXbZHvMgB4DyUPrBqlzOPUt rH/HwGQvP1L38NOf6oPAy5+94eycUQK5Vk58koVy6wk/dz1mXDMKpZvcuBlqnQIV YGCB+sAt0HZNsJu+MpjsDozonYL5uiZLYC42VjidXx9BNKR0LZo=
    =3DER
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sun Jun 2 18:50:01 2024
    On Sun, 02 Jun 2024, Florian Schmaus wrote:

    IMHO that's a very bad idea and will probably break ebuilds that rely
    on the current behaviour.

    I pondered about this and its one of the reasons I'd rather start with
    a fresh eclass.

    That said, worst case scenario I could came up with is that the elog
    message is printed twice. And this is also only the case if the ebuild
    has readme.gentoo_print_elog *not* in pkg_postinst. However, the readme.gentoo-r1.eclass documentation suggests you to put it in
    pkg_postinst.

    And if an ebuild has readme.gentoo_print_elog *in* pkg_postinst, which
    should be true for nearly all ebuilds currently inheriting
    readme.gentoo-r1, then you don't use the newly exported pkg_postinst
    function (and the outcome of the exproted pkg_preinst is simply
    ignored).

    Bottom line is: exporting the functions should do no harm.

    It would break most ebuilds that inherit elisp and readme.gentoo-r1,
    because elisp_pkg_postinst would no longer be called.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sun Jun 2 18:30:01 2024
    On Sun, 02 Jun 2024, Eli Schwartz wrote:

    Per the commit message, the old readme and the new readme can have the
    same contents, but be compressed by different compressors on the live
    system vs the image, and/or a compressor with unstable algorithms,
    and/or one that isn't installed at the time of merging.

    Given you've explicitly rejected disabling compression, I don't quite
    see how you can have your cake and eat it too.

    How is installing another file (4 KiB on many file systems) an
    improvement over disabling compression for README.gentoo itself?

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZcnZIPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uEXUH/RtJZZ02fp+lc7gW58uE01FJF1BOrZY/6pdE 5FtCCBv4+K4S7RBT6ki16DIZMykZdJFiyyBWwBenQpuLZxSqAcl47yjZnIRJ+Y7r Or9qvBHhEaJTU5UML9f0V8CSgjP5A4fo4wfRwaA9ZXWwwPfAFuffpp1ivD5o1nY4 kYyrCA64d1pT/IdUsrDIyJl3x6fsj1StklifIii6YqlrjpnsZuLW7V83ypz42bWO zGyDft59XJ9btqadvsyJPeX3WbX3GcH18erujYGCHbjR2se6VqErVboQKxRLIw3i FfETQzSZxGR/j5PwoC1cFcVfTgyNCSj7vpmNAOngAIjV0m0MEng=
    =vxQ/
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sun Jun 2 20:30:02 2024
    On Sun, 02 Jun 2024, Eli Schwartz wrote:

    readme.gentoo-r1.eclass as proposed in this thread is exactly such an upstream program (gentoo is the upstream, and gentoo cannot cope with compressed files there).

    It strikes me as rules lawyering to use this as an argument against
    the eclass, but whatever. The alternative to `docompress -x` is to
    *not have to decompress* when comparing the compressed contents of two
    files, which means recording persistent state.

    There is one approach that I can think of for this:

    - recording state in a second file (additional to README.gentoo itself)

    If you dislike this solution, and are unwilling to back down on
    "docompress -x", then my personal feeling is that it is *your*
    responsibility to come up with an alternative mechanism for
    implementing the functionality.

    Installing another file just for the sake of avoiding "docompress -x"
    doesn't solve the problem but makes it worse, IMHO. Rather don't
    compress README.gentoo then.

    (Also, I still don't understand the argument about different compress
    programs. That's not likely to happen very often. You could go for best
    effort there, and if it fails, consider the files as different. There's
    no need for exact science when the only thing that can happen is
    additional output.)

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZcuNUPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4ugH0IAJqIfD7cyxlZbmpvT1gFWtDKdl4j3/NNqMgc lnYuBlRyESnSNcyOwr01YtVZbdrVeDSnZBp+OmGv5MJpVezUpNhgdNZh4lCTjdwG 63REjR2GbE/UeNZ1kFklR0boRjR8o4bwRzTOQ361kGqcms3fv1ndeS+bP/U27uuE 2KZhach8jFVvCZf7fDVCLtbGToacucQLe+rjDm6Br3FPTnJfYDFDfTUQmCXlUeUB KcKgTOdQcBZDqJTNhgWFLUxFpEGhq2AiHwy4ObLL3ml+r3g0zLlf0hfxt1lo2ZOv z9QEXpiq5NnlwgqYDvJgLHASV9DUYg7QPsQ2XeYhUwnGr7bGCZQ=
    =36nt
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Tue Jun 4 19:50:01 2024
    On Tue, 04 Jun 2024, Florian Schmaus wrote:

    Both is fine with me.

    That said, many filesystem support inline data. If I am not mistaken,
    then its even enabled by default for xfs (which we recommend in the
    handbook) and btrfs. Also some README.gentoo files become suitable for inlining after compression (btrfs' limit is 2048 bytes).

    I see 48 README.gentoo* files on my system here, and the _uncompressed_
    size of the largest of them (belonging to www-client/firefox) is 1238
    bytes. So, by your metric all of them could be inlined even without
    compressing them. 14 of the 48 files aren't even compressed because
    their size is below Portage's size limit (which is 128 bytes IIRC).

    Also, it's not surprising that these files are very small. If they were
    large, they wouldn't be suitable as output in pkg_postinst.

    OTOH, if the filesystem is ext4, README.gentoo and the hash file will
    each use up one 4 KiB block and one inode.

    Considering this, the 4-byte hash file is superior under the right circumstances when compared to excluding README.gentoo from
    compression. And I could imagine that the circumstances are right for
    many of our users.

    I very much doubt this.

    In any case, the above size considerations aren't important. My main
    point is that the code is getting way too complicated for the simple
    task of printing a few lines in pkg_postinst.

    Ulrich

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZfUsMPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uTB8IALpC6ihQoqW6Ty0nneBaxEa3OT9lpL4OvrJ/ O4qtqXGsUwqnjSMHAA8bdJlhaHxTsV8SbN6TQljZ5Wypq0I6qM/J1ZLQo84mofG6 YngQVNdynD5i5qWFUJuoOIhAiXKJqGY3RzNJk40G2OP6PFk3Sb6k4QpworLv+AGq AWeiPdR8F5ndojGSMB81hcngRuioyB+HI/O1IpaFvssEoaSk+c/MEVCi9ZntJHau 0ts6GYrriqA5xZG/cco5+EQm9/oa9kmUcq28RuWCjBSYYIFaF1PanxByZT90Ksxx bok824ggRlfO2vSXpB3FwCGDyeMm2VOtyaafipZgAgASPjeSPsg=
    =FZM4
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Tue Jun 4 20:50:01 2024
    On Tue, 04 Jun 2024, Florian Schmaus wrote:

    And yes, "docompress -x README.gentoo" would make the code muuuuuuuuch simpler.

    Go for it then. Apparently it is the lesser evil.

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZfX7YPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4u4X8IALIKyYAwYEfQznbNgSJvJtvEjS/+zeVcwXF6 w6ouLiZz8WcDW70JNNOJfzNjiop3tcU9O9DvgBkedNr6BZVJ9GYzFcUibqFuQFeo dghwcWO/s0LCviWSioXr0bTG0I6mWUgjs6Sdnneih/8bTEi0As0AGztEr1Qw5vNK Hqmo28l0tBDRILLxkILoMpVK6Mcpi28Ph8rbzItEZMqgsu1XAnbmiFhIt50WtY6z SBzOT8kH2d4mOo+4kBqYdSZrOQPEyhGO1/aIqvYyFKi0HF6icoJPWEVk0JHOrO7E jo+Q2bgZhFL5BLozVzDg/qRs9ZNQopPy+6BiCUXMzQwB+Myl7k8=
    =mphS
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ionen Wolkens@21:1/5 to Ulrich Mueller on Tue Jun 4 20:40:02 2024
    On Tue, Jun 04, 2024 at 07:45:39PM +0200, Ulrich Mueller wrote:
    In any case, the above size considerations aren't important. My main
    point is that the code is getting way too complicated for the simple
    task of printing a few lines in pkg_postinst.

    Have to say that this is mostly how I feel as well. Not that I followed
    this whole conversation in full.

    That aside, with all this talk of using the installed README.gentoo,
    note that the file may not even be there because of FEATURES="nodoc".
    Albeit could just assume it's unchanged in these cases.

    Don't know if idea came up in this thread before but, if *really* had
    to implement a mechanic to display the README.gentoo again on changes,
    think I'd personally add an optional version variable/argument that
    could be bumped by the ebuild maintainer whenever the README is
    changed. Then if the version it's replacing is older than that it'll
    display it again with a notice explaining that it changed. There are
    some limitations to this approach but well, e.g.
    - won't work without a bump/revbump to compare with
    - maintainer might forget to set the version after changes
    - version won't mean as much if update the README in all ebuild
    versions at once, and can't tell what's actually been seen
    (might cause occasional see-it-again when stabilizing)
    - can't display a diff if wanted one, not that the hash approach
    could do that either
    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmZfXwMACgkQskQGsLCs QzSN3gf+MwTHKyNDqhgokBPG98QKxaJ9TleG89ZEV1k68EqfEP6VsUhUVBzg+g10 TGmAZKrVzluw9yIcTt4skhXrmam93PuyUB65KRZANbE+tZ81Necw/aPHrRTWQT6l Dosln3/xG9dCgyv5MlYcLLAsRi1WCj/bKmta8S+8ln9mImLAZzL65hVfLILXwEBa NGKH/1gdKxMLwNecK3ZX1RmHOhGkZ1elV+wA0Q3sqT347PeWVhO/46YFqlJz8vvE C4vtghDxVGChNIqwFykMjpP9TqsvZcXPOu9jTkjIjG50VRHSsgS+NykAwCP7Ft1G RyNxtTGPpO47g3luOIgOZxq0QtyoWw==
    =dmo7
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ionen Wolkens@21:1/5 to Ionen Wolkens on Tue Jun 4 21:00:01 2024
    On Tue, Jun 04, 2024 at 02:37:56PM -0400, Ionen Wolkens wrote:
    On Tue, Jun 04, 2024 at 07:45:39PM +0200, Ulrich Mueller wrote:
    In any case, the above size considerations aren't important. My main
    point is that the code is getting way too complicated for the simple
    task of printing a few lines in pkg_postinst.

    Have to say that this is mostly how I feel as well. Not that I followed
    this whole conversation in full.

    That aside, with all this talk of using the installed README.gentoo,
    note that the file may not even be there because of FEATURES="nodoc".
    Albeit could just assume it's unchanged in these cases.

    Don't know if idea came up in this thread before but, if *really* had
    to implement a mechanic to display the README.gentoo again on changes,
    think I'd personally add an optional version variable/argument that
    could be bumped by the ebuild maintainer whenever the README is
    changed. Then if the version it's replacing is older than that it'll
    display it again with a notice explaining that it changed. There are
    some limitations to this approach but well, e.g.
    - won't work without a bump/revbump to compare with
    - maintainer might forget to set the version after changes
    - version won't mean as much if update the README in all ebuild
    versions at once, and can't tell what's actually been seen
    (might cause occasional see-it-again when stabilizing)
    - can't display a diff if wanted one, not that the hash approach
    could do that either

    Forgot to say, one perk is that maintainer can choose when the readme
    is worth showing again. Hash would display it for minor style or typo
    fixes.

    Also in case what I was talking about is unclear, I'm talking about
    ver_test using ${REPLACING_VERSIONS} like we often do in pkg_postinst
    to show information only once on a bump.

    e.g.
    pkg-1.0.0: initial readme (no version)
    pkg-1.0.1: modified readme, set readme's version to 1.0.1 in ebuild
    pkg-1.0.2: readme is the same, keep readme's 1.0.1 unchanged

    first install (any version) = display
    1.0.0 -> 1.0.1 bump = display again
    1.0.1 -> 1.0.2 bump = won't display
    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmZfY/oACgkQskQGsLCs QzQ3UQf/cDKwmwUEDtk44vfzFViof3mHkO9XLnoAFUfZcjNdaPf9UzsnJIlzR+su m4oIfU8GLDx4RrVrmRlZpgLPsQtG0mrmTnEuWq8qMsayqr30K1600hihNsW1XLTl IhCQdh2NhubN27F+ypUhjVjFZtfJ6lbOkAM4m0xVgbcd3DBV4Iq2ljEKlJZWRDj6 iXmxe48IFJkMw1EcJz5zxMnXMSdTRRWjBHDVaGg5YUPhcZgc0D+HWLNxkbD+5cMI AZDnIvDvaasvscx/7PtZ284t8tKq7+qdGTyynLQSXRV1QmOeimwnvuB35hE38ipi G/miBCuwrEN1u0pjs0Z7mObcQIX1bg==
    =DpfX
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)