El mar, 22-01-2013 a las 10:33 +0100, Tomáš Chvátal escribió:
> 2013/1/22 Pacho Ramos <pa...@gentoo.org>:
> > El mar, 22-01-2013 a las 08:16 +0100, Tomáš Chvátal escribió:
> >> Would'nt be better to just set some variable in the ebuild, rather
> >> than call function that touches empty file?
> >>
> >> Tom
> >>
> >>
> >
> > I think it can be done in either way... but I don't see the advantage of
> > any over the other :/
> 
> Just few I can think of right now:
> 
> You can set the variable in the ebuilds global scope somewhere on top easily.
> You can actually do more magic later based on what content user puts
> to the variable if we want to (all msgs, important ones only, ...)
> You actually allow user to enforce this behaviour in make conf for all
> packages if he desires to do so.
> 
> Also I never seen this being handled by touching files in any other eclasses 
> :-)
> 
> Tom
> 
> 

I agree, thanks for pointing it. Just attached patch should handle it.

--- readme.gentoo.eclass	2013-01-20 12:42:30.000000000 +0100
+++ /usr/portage/eclass/readme.gentoo.eclass	2013-01-22 19:36:12.000000000 +0100
@@ -68,13 +68,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