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 0D5CE15817D for ; Sun, 16 Jun 2024 20:09:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D87D1E2A6C; Sun, 16 Jun 2024 20:09:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 80452E2A65 for ; Sun, 16 Jun 2024 20:09:35 +0000 (UTC) From: Ulrich Mueller To: Florian Schmaus Cc: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH v4] greadme.eclass: new eclass In-Reply-To: <20240616155123.1016092-1-flow@gentoo.org> (Florian Schmaus's message of "Sun, 16 Jun 2024 17:51:23 +0200") References: <20240616155123.1016092-1-flow@gentoo.org> Date: Sun, 16 Jun 2024 22:09:24 +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: 17607a2c-f78d-4331-a666-47591a29395c X-Archives-Hash: dafcf044c97cab859c58be2517bd4ed1 --=-=-= Content-Type: text/plain >>>>> On Sun, 16 Jun 2024, Florian Schmaus wrote: > First, the content of README.gento will only be shown on new Typo. > +greadme_pkg_postinst() { > + debug-print-function ${FUNCNAME} "${@}" > + > + if [[ ! -v _GREADME_SHOW ]]; then > + die "_GREADME_SHOW not set. Did you call greadme_pkg_preinst?" > + fi > + > + if [[ -z ${_GREADME_SHOW} ]]; then > + # If _GREADME_SHOW is empty, then there is no reason to show the contents. > + return > + fi > + > + local greadme="${EROOT}${_GREADME_REL_PATH}" > + > + if [[ ! -f ${greadme} ]]; then > + ewarn "Unable to show ${_GREADME_FILENAME}, file not installed (FEATURES=nodoc enabled?)." I still think that the file's contents should be saved in a variable, which would avoid the problem. (Presumably, pkg_preinst wouldn't be necessary then either, because the variable is still available in the postinst phase, whereas ${D} isn't.) In any case, showing this warning every time might be annoying. How about showing it only the first time, i.e. if REPLACING_VERSIONS is empty? > + return > + fi > + > + local line > + while read -r line; do elog "${line}"; done < "${greadme}" > + elog "" > + elog "(Note: Above message is only printed the first time package is" > + elog "installed or if the message changes on update. Please look at" > + elog "${EPREFIX}${_GREADME_REL_PATH} for future reference)" > +} --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZvRnQPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4udvcH/1YEpcgvecK5gCbO0VOnPAOnP9UpYF+2v8aR wbS1LJMrfxTYHKYgWdIr8IPwf1M+BQBE8HGyEodpHPb3v17Rz7ZCsOLGfPIJ8g7x qEE+ZyRxfliln6d6BQ7bjRELpHIOIwCYJPCSacHtzkc8G8pIdk3VrWJWmAgO7cef gsjrSVT74KNeyiGgRtyiwPUxnUF945z/gK+y9WUjAseOpV7+t5JgiK88wm8hMAag fnl4um/PTshyiagOE6o/C7z8+jSzOEsvP8gSEXaqAE6LItC0BGuH5SvFSXfTPlUi sSvsCgRma5x5MOTTNXXbm6QikO2B4418vQLhtRUnhaztDFEZ4aQ= =GGPj -----END PGP SIGNATURE----- --=-=-=--