public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing
@ 2013-01-21 21:08 Pacho Ramos
  2013-01-22  7:16 ` Tomáš Chvátal
  0 siblings, 1 reply; 11+ messages in thread
From: Pacho Ramos @ 2013-01-21 21:08 UTC (permalink / raw
  To: gentoo-dev


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

This can be useful when, for example, doc contents are modified. You can
then rely on using REPLACING_VERSIONS in your ebuild to print messages
when people updates from versions using old docs

Patch to review attached


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

--- readme.gentoo.eclass	2013-01-20 12:42:30.000000000 +0100
+++ /usr/portage/eclass/readme.gentoo.eclass	2013-01-21 22:06:46.000000000 +0100
@@ -66,6 +66,18 @@
 	fi
 }
 
+# @FUNCTION: readme.gentoo_force_print_elog
+# @DESCRIPTION:
+# For elog message printing. This can be useful when, for example,
+# DOC_CONTENTS is modified. You can then rely on using REPLACING_VERSIONS
+# in your ebuild to print messages when people updates from versions
+# still providing old message.
+# Should be called before pkg_postinst phase.
+readme.gentoo_force_print_elog() {
+	debug-print-function ${FUNCNAME} "${@}"
+	touch "${T}"/README.gentoo.force_print_elog
+}
+
 # @FUNCTION: readme.gentoo_print_elog
 # @DESCRIPTION:
 # Print elog messages with "${T}"/README.gentoo contents.
@@ -74,7 +86,7 @@
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ -f "${T}"/README.gentoo ]]; then
-		if ! [[ "${REPLACING_VERSIONS}" ]]; then
+		if ! [[ "${REPLACING_VERSIONS}" ]] || [[ -f "${T}"/README.gentoo.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 --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-02-01 14:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox