From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4F67315817D for ; Tue, 18 Jun 2024 14:03:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E74E7E2A3E; Tue, 18 Jun 2024 14:03:09 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 81425E2A3B for ; Tue, 18 Jun 2024 14:03:09 +0000 (UTC) From: Ulrich Mueller To: Florian Schmaus Cc: Arthur Zamarin , gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH v4] greadme.eclass: new eclass In-Reply-To: (Florian Schmaus's message of "Tue, 18 Jun 2024 13:33:27 +0200") References: <20240616155123.1016092-1-flow@gentoo.org> <45bcb8d5-bea7-49a2-81e8-ee2d161872bc@gentoo.org> Date: Tue, 18 Jun 2024 16:02:56 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Archives-Salt: d34adff5-8947-468b-9da4-03fc3eb5ee7c X-Archives-Hash: 3d6e8d3e0c5ffdacdaa77d916cfe72cd --=-=-= Content-Type: text/plain >>>>> On Tue, 18 Jun 2024, Florian Schmaus wrote: >>> Finally, unlike readme.gentoo-r1.elcass, this eclass does not need >>> to store the content of the readme in an environment variable. Not >>> having to store the content in an environment variable reduces the >>> pollution of the environment (sadly, this only refers to the process >>> environment). >> I'll be honest, I never felt this is really needed? From looking at >> the current -r1 eclass, you could define DOC_CONTENTS just before >> invoking readme.gentoo_create_doc, so you could for example modify as >> you want the message and use `local DOC_CONTENTS="..."`. > readme.gentoo-r1.eclass requires DOC_CONTENTS to be part of the > package's environment to show it later in readme.gentoo_print_elog(), > which is typically invoked in pkg_postinst(). If DOC_CONTENTS is local > to readme.gentoo_create_doc(), then it wont be able in pkg_postinst() > and can potentially not be obtained from the README.gentoo file > because that file may be compressed. > For greadme.eclass, the file is no longer compressed, therefore > greadme.eclass does not need to carry a variable in the package's > environment. These are two different variables that must not be confused. readme.gentoo-r1 has DOC_CONTENTS as an "input variable" that is assigned by the ebuild. It creates the actual file from it (possibly doing some automatic formatting). The contents of the final file is then saved in another variable README_GENTOO_DOC_VALUE, which is used in readme.gentoo_print_elog to output the message. BTW, I like readme.gentoo-r1's autoformatting, because the message may contain variables (like paths containing EPREFIX) that can expand to different lengths. Ulrich --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZxk5APHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uw9kIAMO2Lblh2bxLOb/0VtQvxs1+bTSJny6zyAwd p+lDOrVle2YNTJi0snAf7fuzFtGl8BW6MXynATx/A6B6zGb7/1/SUj0Qj1VAhmAr OdzdEtHwRPGu98c4nPNKBIEdD3aFPXZJm9fl2Nj+MX6inKCMgzXe+B3YaoMaFEiq 46CUMPZdyl8c/cdjrzMz5qN7DrmwfhycJf6fa8TPlsj7uozPnbwJeWUHxAG0L31C zbyJw1MCngIwAsstGiSm2NBHGZ8FwS7KmFmWoJL2Su2gFOh7FMO/uxNdNPl8iegu 6advsLbooH7USRx25nOsLwNg1UI0roP22hogbgJqQ5tUwjWg95o= =9mrG -----END PGP SIGNATURE----- --=-=-=--