public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Pacho Ramos <pacho@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing
Date: Thu, 24 Jan 2013 21:33:45 +0100	[thread overview]
Message-ID: <1359059625.2927.5.camel@belkin4> (raw)
In-Reply-To: <8563168.sNAmIqxMNg@arcarius>


[-- Attachment #1.1: Type: text/plain, Size: 377 bytes --]

El mar, 22-01-2013 a las 19:42 +0100, Tomáš Chvátal escribió:
> Dne Út 22. ledna 2013 19:37:12, Pacho Ramos napsal(a):
> > I agree, thanks for pointing it. Just attached patch should handle it.
> 
> Still not nice enough for me :D
> 
> Use the ECLASS_VARIABLE to describe it @DEFAULT_UNSET is what you seek, see 
> git-2.eclass.
> 
> Tom

What about this one?

[-- Attachment #1.2: 1.patch --]
[-- Type: text/x-patch, Size: 1529 bytes --]

--- readme.gentoo.eclass	2013-01-20 12:42:30.000000000 +0100
+++ /usr/portage/eclass/readme.gentoo.eclass	2013-01-24 21:30:09.000000000 +0100
@@ -36,6 +36,11 @@
 
 EXPORT_FUNCTIONS src_install pkg_postinst
 
+# @ECLASS-VARIABLE: FORCE_PRINT_ELOG
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If non-empty this variable forces elog messages to be printed.
+
 # @FUNCTION: readme.gentoo_create_doc
 # @DESCRIPTION:
 # Create doc file with ${DOC_CONTENTS} variable (preferred) and, if not set,
@@ -68,13 +73,20 @@
 
 # @FUNCTION: readme.gentoo_print_elog
 # @DESCRIPTION:
-# Print elog messages with "${T}"/README.gentoo contents.
+# Print elog messages with "${T}"/README.gentoo contents. They will be
+# shown only when package is installed at first time.
 # Usually called at pkg_postinst phase.
+#
+# 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.
 readme.gentoo_print_elog() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ -f "${T}"/README.gentoo ]]; then
-		if ! [[ "${REPLACING_VERSIONS}" ]]; then
+		if ! [[ "${REPLACING_VERSIONS}" ]] || [[ "${FORCE_PRINT_ELOG}" ]]; then
 			eshopts_push
 			set -f
 			cat "${T}"/README.gentoo | while read -r ELINE; do elog "${ELINE}"; done

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2013-01-24 20:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21 21:08 [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing Pacho Ramos
2013-01-22  7:16 ` Tomáš Chvátal
2013-01-22  8:07   ` Pacho Ramos
2013-01-22  9:33     ` Tomáš Chvátal
2013-01-22 18:37       ` Pacho Ramos
2013-01-22 18:42         ` Tomáš Chvátal
2013-01-24 20:33           ` Pacho Ramos [this message]
2013-01-24 20:42             ` Tomáš Chvátal
2013-01-24 21:39               ` Pacho Ramos
2013-02-01 14:32                 ` Fabio Erculiani
2013-02-01 14:34                   ` Fabio Erculiani

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=1359059625.2927.5.camel@belkin4 \
    --to=pacho@gentoo.org \
    --cc=gentoo-dev@lists.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