Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-02-01 Thread Fabio Erculiani
Well done!
Binary packages is now broken :-/

## SPM: post-install phase
 * ERROR: x11-misc/bumblebee-3.0.1-r2 failed (postinst phase):
 *   README.gentoo wasn't created at src_install!
 *
 * Call stack:
 * ebuild.sh, line   93:  Called pkg_postinst
 *   environment, line 2080:  Called readme.gentoo_pkg_postinst
 *   environment, line 2230:  Called readme.gentoo_print_elog
 *   environment, line 2245:  Called die
 * The specific snippet of code:
 *   die README.gentoo wasn't created at src_install!;
 *
 * If you need support, post the output of `emerge --info
'=x11-misc/bumblebee-3.0.1-r2'`,
 * the complete build log and the output of `emerge -pqv
'=x11-misc/bumblebee-3.0.1-r2'`.
 * The complete build log is located at
'/var/tmp/entropy/packages/amd64/5/x11-misc_bumblebee-3.0.1-r2_0.tbz2/portage/x11-misc/bumblebee-3.0.1-r2/temp/build.log'.
 * The ebuild environment file is located at
'/var/tmp/entropy/packages/amd64/5/x11-misc_bumblebee-3.0.1-r2_0.tbz2/portage/x11-misc/bumblebee-3.0.1-r2/temp/environment'.
 * Working directory:
'/var/tmp/entropy/packages/amd64/5/x11-misc_bumblebee-3.0.1-r2_0.tbz2/portage/x11-misc/bumblebee-3.0.1-r2'
 * S: 
'/var/tmp/entropy/packages/amd64/5/x11-misc_bumblebee-3.0.1-r2_0.tbz2/portage/x11-misc/bumblebee-3.0.1-r2/work/bumblebee-3.0.1'

-- 
Fabio Erculiani



Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-02-01 Thread Fabio Erculiani
No FILESDIR nor T in pkg_* phases please!

-- 
Fabio Erculiani



Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-24 Thread Pacho Ramos
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.0 +0100
+++ /usr/portage/eclass/readme.gentoo.eclass	2013-01-24 21:30:09.0 +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


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-24 Thread Tomáš Chvátal
Dne Čt 24. ledna 2013 21:33:45, Pacho Ramos napsal(a):
 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?

-   if ! [[ ${REPLACING_VERSIONS} ]] || [[ ${FORCE_PRINT_ELOG} 
]]; then
+   if ! [[ -n ${REPLACING_VERSIONS}  || -n ${FORCE_PRINT_ELOG} 
]]; then

But thats just cosmetic

Tom

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-24 Thread Pacho Ramos
El jue, 24-01-2013 a las 21:42 +0100, Tomáš Chvátal escribió:
 Dne Čt 24. ledna 2013 21:33:45, Pacho Ramos napsal(a):
  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?
 
 - if ! [[ ${REPLACING_VERSIONS} ]] || [[ ${FORCE_PRINT_ELOG} 
 ]]; then
 + if ! [[ -n ${REPLACING_VERSIONS}  || -n ${FORCE_PRINT_ELOG} 
 ]]; then
 
 But thats just cosmetic
 
 Tom

Done, and committed

+  24 Jan 2013; Pacho Ramos pa...@gentoo.org readme.gentoo.eclass:
+  Include FORCE_PRINT_ELOG variable to for printing of messages when
desired.
+  Thanks to Tomáš Chvátal for his suggestions.
+



signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-22 Thread Pacho Ramos
El mar, 22-01-2013 a las 08:16 +0100, Tomáš Chvátal escribió:
 2013/1/21 Pacho Ramos pa...@gentoo.org:
  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
 
 
 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 :/


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-22 Thread Tomáš Chvátal
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



Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-22 Thread Pacho Ramos
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.0 +0100
+++ /usr/portage/eclass/readme.gentoo.eclass	2013-01-22 19:36:12.0 +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


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-22 Thread Tomáš Chvátal
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

signature.asc
Description: This is a digitally signed message part.


[gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-21 Thread Pacho Ramos
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

--- readme.gentoo.eclass	2013-01-20 12:42:30.0 +0100
+++ /usr/portage/eclass/readme.gentoo.eclass	2013-01-21 22:06:46.0 +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


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] readme.gentoo.eclass: Add a readme.gentoo_force_print_elog function to force elog printing

2013-01-21 Thread Tomáš Chvátal
2013/1/21 Pacho Ramos pa...@gentoo.org:
 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


Would'nt be better to just set some variable in the ebuild, rather
than call function that touches empty file?

Tom