public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] readme.gentoo.eclass: Add a DISABLE_AUTOFORMATTING variable
@ 2013-01-27 14:00 Pacho Ramos
  2013-01-27 17:47 ` readme.gentoo.eclass: use echo -e instead of plain echo (Was: Re: [gentoo-dev] readme.gentoo.eclass: Add a DISABLE_AUTOFORMATTING variable= Pacho Ramos
  2013-01-31 15:22 ` [gentoo-dev] readme.gentoo.eclass: Add a DISABLE_AUTOFORMATTING variable Dan Douglas
  0 siblings, 2 replies; 21+ messages in thread
From: Pacho Ramos @ 2013-01-27 14:00 UTC (permalink / raw
  To: gentoo-dev


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

Currently, when people uses DOC_CONTENTS variable to place their desired
messages, they are automatically reformatted by "fmt" to get proper
messages (for example, splitting long lines).

But, in some cases, may be useful to disable this behavior and respect
strictly how DOC_CONTENTS was formatted, for example in that kind of
messages telling people to run a command and, then, requiring a new line
to be used. This can also be useful to append extra information to
DOC_CONTENTS when, for example, additional info is needed when enabling
a USE flag.



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

--- /home/pacho/gentoo-x86/eclass/readme.gentoo.eclass	2013-01-24 22:38:41.000000000 +0100
+++ ./readme.gentoo.eclass	2013-01-27 14:51:58.000000000 +0100
@@ -36,6 +36,12 @@
 
 EXPORT_FUNCTIONS src_install pkg_postinst
 
+# @ECLASS-VARIABLE: DISABLE_AUTOFORMATTING
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If non-empty, DOC_CONTENTS information will be strictly respected,
+# not getting it automatically formatted by fmt.
+
 # @ECLASS-VARIABLE: FORCE_PRINT_ELOG
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -53,7 +59,11 @@
 	if [[ -n "${DOC_CONTENTS}" ]]; then
 		eshopts_push
 		set -f
-		echo ${DOC_CONTENTS} | fmt > "${T}"/README.gentoo
+		if [[ -n "${DISABLE_AUTOFORMATTING}" ]]; then
+			echo "${DOC_CONTENTS}" > "${T}"/README.gentoo
+		else
+			echo ${DOC_CONTENTS} | fmt > "${T}"/README.gentoo
+		fi
 		eshopts_pop
 		dodoc "${T}"/README.gentoo
 	else

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

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

end of thread, other threads:[~2013-02-02 11:05 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-27 14:00 [gentoo-dev] readme.gentoo.eclass: Add a DISABLE_AUTOFORMATTING variable Pacho Ramos
2013-01-27 17:47 ` readme.gentoo.eclass: use echo -e instead of plain echo (Was: Re: [gentoo-dev] readme.gentoo.eclass: Add a DISABLE_AUTOFORMATTING variable= Pacho Ramos
2013-01-27 18:05   ` Mike Frysinger
2013-01-27 18:21     ` Pacho Ramos
2013-01-28  4:37       ` Mike Frysinger
2013-01-28  6:37         ` Ben de Groot
2013-01-28 19:30           ` Pacho Ramos
2013-01-29  2:28             ` Mike Frysinger
2013-01-29  6:03             ` Ben de Groot
2013-01-29 21:47               ` Pacho Ramos
2013-01-29 22:06                 ` Michał Górny
2013-01-30  8:27                 ` Ralph Sennhauser
2013-01-30 13:24                 ` Ben de Groot
2013-01-30 18:43                   ` Pacho Ramos
2013-01-31 18:59   ` Pacho Ramos
2013-02-01  9:55     ` Ben de Groot
2013-02-01 11:07       ` Michael Weber
2013-02-01 20:34       ` Pacho Ramos
2013-02-02 11:04         ` Pacho Ramos
2013-01-31 15:22 ` [gentoo-dev] readme.gentoo.eclass: Add a DISABLE_AUTOFORMATTING variable Dan Douglas
2013-01-31 20:43   ` [gentoo-dev] " Duncan

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