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?
--- 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: signature.asc
Description: This is a digitally signed message part

Reply via email to