public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Two updates for elisp*.eclass
@ 2013-03-08 19:56 Ulrich Mueller
  2013-03-08 19:57 ` [gentoo-dev] [PATCH 1/2] elisp-common.eclass: Some functions now die on failure Ulrich Mueller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ulrich Mueller @ 2013-03-08 19:56 UTC (permalink / raw
  To: gentoo-dev

Hi,

Please find in the next messages two patches for elisp.eclass and
elisp-common.eclass.

The first patch makes functions elisp-compile(), elisp-install(), etc.
die if there is an error. For EAPI 4, the functions died anyway,
because the underlying package manager functions did so.
In EAPIs where it is supported, nonfatal will give you the old
behaviour.

The second patch makes elisp-common.eclass cooperate with
readme.gentoo.eclass. Many of the ebuilds for elisp packages output
elog messages in postinst, so it makes sense to support this on the
eclass level.

Ulrich


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

* [gentoo-dev] [PATCH 1/2] elisp-common.eclass: Some functions now die on failure.
  2013-03-08 19:56 [gentoo-dev] Two updates for elisp*.eclass Ulrich Mueller
@ 2013-03-08 19:57 ` Ulrich Mueller
  2013-03-08 19:58 ` [gentoo-dev] [PATCH 2/2] elisp.eclass: Cooperate with readme.gentoo.eclass Ulrich Mueller
  2013-03-08 20:02 ` [gentoo-dev] Two updates for elisp*.eclass Michał Górny
  2 siblings, 0 replies; 5+ messages in thread
From: Ulrich Mueller @ 2013-03-08 19:57 UTC (permalink / raw
  To: gentoo-dev

* elisp-common.eclass (elisp-compile, elisp-make-autoload-file)
(elisp-install, elisp-site-file-install): Die on failure.
* elisp.eclass (elisp_src_compile, elisp_src_install): Remove die
commands that are no longer necessary because the called functions
die themselves.

--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -50,7 +50,7 @@
 # directory is added to the load-path which makes sure that all files
 # are loadable.
 #
-#   	elisp-compile *.el || die
+#   	elisp-compile *.el
 #
 # Function elisp-make-autoload-file() can be used to generate a file
 # with autoload definitions for the lisp functions.  It takes the output
@@ -70,7 +70,7 @@
 # choose something else, but remember to tell elisp-site-file-install()
 # (see below) the change, as it defaults to ${PN}.
 #
-#   	elisp-install ${PN} *.el *.elc || die
+#   	elisp-install ${PN} *.el *.elc
 #
 # To let the Emacs support be activated by Emacs on startup, you need
 # to provide a site file (shipped in ${FILESDIR}) which contains the
@@ -112,7 +112,7 @@
 #
 # Which is then installed by
 #
-#   	elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
+#   	elisp-site-file-install "${FILESDIR}/${SITEFILE}"
 #
 # in src_install().  Any characters after the "-gentoo" part and before
 # the extension will be stripped from the destination file's name.
@@ -168,6 +168,7 @@ EMACSFLAGS="-batch -q --no-site-file"
 BYTECOMPFLAGS="-L ."
 
 # @FUNCTION: elisp-emacs-version
+# @RETURN: exit status of Emacs
 # @DESCRIPTION:
 # Output version of currently active Emacs.
 
@@ -223,7 +224,7 @@ elisp-need-emacs() {
 elisp-compile() {
 	ebegin "Compiling GNU Emacs Elisp files"
 	${EMACS} ${EMACSFLAGS} ${BYTECOMPFLAGS} -f batch-byte-compile "$@"
-	eend $? "elisp-compile: batch-byte-compile failed"
+	eend $? "elisp-compile: batch-byte-compile failed" || die
 }
 
 # @FUNCTION: elisp-make-autoload-file
@@ -259,7 +260,7 @@ elisp-make-autoload-file() {
 		--eval "(setq generated-autoload-file (expand-file-name \"${f}\"))" \
 		-f batch-update-autoloads "${@-.}"
 
-	eend $? "elisp-make-autoload-file: batch-update-autoloads failed"
+	eend $? "elisp-make-autoload-file: batch-update-autoloads failed" || die
 }
 
 # @FUNCTION: elisp-install
@@ -275,7 +276,7 @@ elisp-install() {
 		insinto "${SITELISP}/${subdir}"
 		doins "$@"
 	)
-	eend $? "elisp-install: doins failed"
+	eend $? "elisp-install: doins failed" || die
 }
 
 # @FUNCTION: elisp-site-file-install
@@ -305,7 +306,7 @@ elisp-site-file-install() {
 	)
 	ret=$?
 	rm -f "${sf}"
-	eend ${ret} "elisp-site-file-install: doins failed"
+	eend ${ret} "elisp-site-file-install: doins failed" || die
 }
 
 # @FUNCTION: elisp-site-regen
--- a/eclass/elisp.eclass
+++ b/eclass/elisp.eclass
@@ -151,7 +151,7 @@ elisp_src_configure() { :; }
 # GNU Info files from them.
 
 elisp_src_compile() {
-	elisp-compile *.el || die
+	elisp-compile *.el
 	if [[ -n ${ELISP_TEXINFO} ]]; then
 		makeinfo ${ELISP_TEXINFO} || die
 	fi
@@ -165,9 +165,9 @@ elisp_src_compile() {
 # ELISP_TEXINFO and documentation listed in the DOCS variable.
 
 elisp_src_install() {
-	elisp-install ${PN} *.el *.elc || die
+	elisp-install ${PN} *.el *.elc
 	if [[ -n ${SITEFILE} ]]; then
-		elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
+		elisp-site-file-install "${FILESDIR}/${SITEFILE}"
 	fi
 	if [[ -n ${ELISP_TEXINFO} ]]; then
 		set -- ${ELISP_TEXINFO}


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

* [gentoo-dev] [PATCH 2/2] elisp.eclass: Cooperate with readme.gentoo.eclass.
  2013-03-08 19:56 [gentoo-dev] Two updates for elisp*.eclass Ulrich Mueller
  2013-03-08 19:57 ` [gentoo-dev] [PATCH 1/2] elisp-common.eclass: Some functions now die on failure Ulrich Mueller
@ 2013-03-08 19:58 ` Ulrich Mueller
  2013-03-08 20:02 ` [gentoo-dev] Two updates for elisp*.eclass Michał Górny
  2 siblings, 0 replies; 5+ messages in thread
From: Ulrich Mueller @ 2013-03-08 19:58 UTC (permalink / raw
  To: gentoo-dev

* elisp.eclass (elisp_src_install, elisp_pkg_postinst):
Call readme.gentoo_create_doc and readme.gentoo_print_elog
from readme.gentoo.eclass if these functions exist.

--- a/eclass/elisp.eclass
+++ b/eclass/elisp.eclass
@@ -177,6 +177,9 @@ elisp_src_install() {
 	if [[ -n ${DOCS} ]]; then
 		dodoc ${DOCS} || die
 	fi
+	if declare -f readme.gentoo_create_doc >/dev/null; then
+		readme.gentoo_create_doc
+	fi
 }
 
 # @FUNCTION: elisp_pkg_postinst
@@ -186,6 +189,9 @@ elisp_src_install() {
 
 elisp_pkg_postinst() {
 	elisp-site-regen
+	if declare -f readme.gentoo_print_elog >/dev/null; then
+		readme.gentoo_print_elog
+	fi
 }
 
 # @FUNCTION: elisp_pkg_postrm


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

* Re: [gentoo-dev] Two updates for elisp*.eclass
  2013-03-08 19:56 [gentoo-dev] Two updates for elisp*.eclass Ulrich Mueller
  2013-03-08 19:57 ` [gentoo-dev] [PATCH 1/2] elisp-common.eclass: Some functions now die on failure Ulrich Mueller
  2013-03-08 19:58 ` [gentoo-dev] [PATCH 2/2] elisp.eclass: Cooperate with readme.gentoo.eclass Ulrich Mueller
@ 2013-03-08 20:02 ` Michał Górny
  2013-03-08 20:31   ` Ulrich Mueller
  2 siblings, 1 reply; 5+ messages in thread
From: Michał Górny @ 2013-03-08 20:02 UTC (permalink / raw
  To: gentoo-dev; +Cc: ulm

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

On Fri, 8 Mar 2013 20:56:13 +0100
Ulrich Mueller <ulm@gentoo.org> wrote:

> Please find in the next messages two patches for elisp.eclass and
> elisp-common.eclass.
> 
> The first patch makes functions elisp-compile(), elisp-install(), etc.
> die if there is an error. For EAPI 4, the functions died anyway,
> because the underlying package manager functions did so.
> In EAPIs where it is supported, nonfatal will give you the old
> behaviour.

That would mean no EAPIs :). nonfatal applies to built-in helpers only,
and not the explicit 'die'.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

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

* Re: [gentoo-dev] Two updates for elisp*.eclass
  2013-03-08 20:02 ` [gentoo-dev] Two updates for elisp*.eclass Michał Górny
@ 2013-03-08 20:31   ` Ulrich Mueller
  0 siblings, 0 replies; 5+ messages in thread
From: Ulrich Mueller @ 2013-03-08 20:31 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-dev

>>>>> On Fri, 8 Mar 2013, Michał Górny wrote:

>> In EAPIs where it is supported, nonfatal will give you the old
>> behaviour.

> That would mean no EAPIs :). nonfatal applies to built-in helpers
> only, and not the explicit 'die'.

Is it so? Then I've misunderstood PMS.

Anyway, I don't think that there's a concrete case where we would need
prefixing of any elisp* function with nonfatal. So just disregard the
part about "nonfatal" in my previous message, please.

Ulrich


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

end of thread, other threads:[~2013-03-08 20:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-08 19:56 [gentoo-dev] Two updates for elisp*.eclass Ulrich Mueller
2013-03-08 19:57 ` [gentoo-dev] [PATCH 1/2] elisp-common.eclass: Some functions now die on failure Ulrich Mueller
2013-03-08 19:58 ` [gentoo-dev] [PATCH 2/2] elisp.eclass: Cooperate with readme.gentoo.eclass Ulrich Mueller
2013-03-08 20:02 ` [gentoo-dev] Two updates for elisp*.eclass Michał Górny
2013-03-08 20:31   ` Ulrich Mueller

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