Re: [gentoo-dev] [PATCH] latex-package.eclass: Support EAPI 6.

2016-01-29 Thread Alexis Ballier
On Fri, 29 Jan 2016 08:10:19 +0100
Ulrich Mueller  wrote:

> > On Wed, 27 Jan 2016, Alexis Ballier wrote:  
> 
> > On Wed, 27 Jan 2016 20:59:21 +0100
> > Ulrich Mueller  wrote:  
> 
> >> Please find below a patch which will enable EAPI 6 support in
> >> latex-package.eclass. The main change is that it won't inherit base
> >> any more.  
> 
> > lgtm, thanks  
> 
> Pushed to master, with one additional change (see below). Seems better
> to have the function explicitly die, especially since for a query
> function there won't be any error checking in the caller.

indeed; one last thing I was thinking is the 'texmf-update' call in
latex-package_rehash will always run for /, even with ROOT!=/. Since
with those changes texlive is more or less mandated, maybe it'd be
worth using etexmf-update from texlive-common.eclass. It won't make a
big difference but at least show a warning :)



Re: [gentoo-dev] [PATCH] latex-package.eclass: Support EAPI 6.

2016-01-29 Thread Dean Stephens
On 01/27/16 14:59, Ulrich Mueller wrote:
> -# @FUNCTION: latex-package_has_tetex3 -# @RETURN: true if at
> least one of (>=tetex-3 or >=ptex-3.1.8 or >=texlive-core-2007) is 
> installed, else false -# @DESCRIPTION: -# It is often used to know 
> if the current TeX installation supports gentoo's -# texmf-update 
> or if the package has to do it the old way 
> -latex-package_has_tetex_3() { -  if has_version 
> '>=app-text/tetex-3' || has_version '>=app-text/ptex-3.1.8' || 
> has_version '>=app-text/texlive-core-2007' ; then -   true -  else - 
> false -   fi -} +case ${EAPI:-0} in + 0|1|2|3|4|5) +  # Kept 
> for 
> backwards compatibility + latex-package_has_tetex_3() { true; } + 
> ;; +esac
> 
Why remove the preexisting comment marked up for documentation
generation which indicated what it did and why, and stub it out with a
generically uninformative comment instead of just adding a deprecation
notice and literally one line of text to indicate why it was
deprecated and stubbed out? I am not taking issue with the change to
the code itself, just the removal of documentation in it.



Re: [gentoo-dev] [PATCH] latex-package.eclass: Support EAPI 6.

2016-01-28 Thread Ulrich Mueller
> On Wed, 27 Jan 2016, Alexis Ballier wrote:

> On Wed, 27 Jan 2016 20:59:21 +0100
> Ulrich Mueller  wrote:

>> Please find below a patch which will enable EAPI 6 support in
>> latex-package.eclass. The main change is that it won't inherit base
>> any more.

> lgtm, thanks

Pushed to master, with one additional change (see below). Seems better
to have the function explicitly die, especially since for a query
function there won't be any error checking in the caller.

Ulrich

--- a/eclass/latex-package.eclass
+++ b/eclass/latex-package.eclass
@@ -71,12 +71,13 @@
 # DESCRIPTION above)
 SUPPLIER="misc"
 
-case ${EAPI:-0} in
-   0|1|2|3|4|5)
-   # Kept for backwards compatibility
-   latex-package_has_tetex_3() { true; }
-   ;;
-esac
+# Kept for backwards compatibility
+latex-package_has_tetex_3() {
+   case ${EAPI:-0} in
+   0|1|2|3|4|5) return 0 ;;
+   *) die "${FUNCNAME} no longer supported in EAPI ${EAPI}" ;;
+   esac
+}
 
 # @FUNCTION: latex-package_src_doinstall
 # @USAGE: [ module ]


pgpXRc27UxenS.pgp
Description: PGP signature


[gentoo-dev] [PATCH] latex-package.eclass: Support EAPI 6.

2016-01-27 Thread Ulrich Mueller
[Re-sent, with good GPG signature this time.]

Please find below a patch which will enable EAPI 6 support in
latex-package.eclass. The main change is that it won't inherit base
any more.

Ulrich


From 990fce89a3ec1a462399089541b67bbcc6baff87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= 
Date: Wed, 27 Jan 2016 17:15:23 +0100
Subject: [PATCH] latex-package.eclass: Support EAPI 6.

Don't inherit base.eclass in EAPI 6.

Don't define SRC_URI and S (which was the default).

Convert latex-package_has_tetex_3() to a dummy function for backwards
compatibility and remove its documentation.

Add some die commands.
---
 eclass/latex-package.eclass | 40 
 1 file changed, 16 insertions(+), 24 deletions(-)

diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass
index 0acfcc9..f0228d5 100644
--- a/eclass/latex-package.eclass
+++ b/eclass/latex-package.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -51,16 +51,18 @@
 # you must either grab each file individually, or find a place to mirror an
 # archive of them.  (iBiblio)
 #
-# It inherits base.
+# It inherits base in EAPI 5 and earlier.
 
-inherit base
+case ${EAPI:-0} in
+   0|1|2|3|4|5) inherit base ;;
+   6) ;;
+   *) die "Unknown EAPI ${EAPI} for ${ECLASS}" ;;
+esac
 
 RDEPEND="virtual/latex-base"
 DEPEND="${RDEPEND}
>=sys-apps/texinfo-4.2-r5"
 HOMEPAGE="http://www.tug.org/;
-SRC_URI="ftp://tug.ctan.org/macros/latex/;
-S=${WORKDIR}/${P}
 TEXMF="/usr/share/texmf-site"
 
 # @ECLASS-VARIABLE: SUPPLIER
@@ -69,18 +71,12 @@ TEXMF="/usr/share/texmf-site"
 # DESCRIPTION above)
 SUPPLIER="misc"
 
-# @FUNCTION: latex-package_has_tetex3
-# @RETURN: true if at least one of (>=tetex-3 or >=ptex-3.1.8 or 
>=texlive-core-2007) is installed, else false
-# @DESCRIPTION:
-# It is often used to know if the current TeX installation supports gentoo's
-# texmf-update or if the package has to do it the old way
-latex-package_has_tetex_3() {
-   if has_version '>=app-text/tetex-3' || has_version 
'>=app-text/ptex-3.1.8' || has_version '>=app-text/texlive-core-2007' ; then
-   true
-   else
-   false
-   fi
-}
+case ${EAPI:-0} in
+   0|1|2|3|4|5)
+   # Kept for backwards compatibility
+   latex-package_has_tetex_3() { true; }
+   ;;
+esac
 
 # @FUNCTION: latex-package_src_doinstall
 # @USAGE: [ module ]
@@ -130,7 +126,7 @@ latex-package_src_doinstall() {
for i in `find . -maxdepth 1 -type f -name 
"*.${1}"`
do
einfo "Making documentation: $i"
-   texi2dvi -q -c --language=latex $i &> 
/dev/null
+   texi2dvi -q -c --language=latex $i &> 
/dev/null || die
done
;;
"tfm" | "vf" | "afm")
@@ -190,7 +186,7 @@ latex-package_src_compile() {
for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"`
do
einfo "Extracting from $i"
-   latex --interaction=batchmode $i &> /dev/null
+   latex --interaction=batchmode $i &> /dev/null || die
done
 }
 
@@ -228,11 +224,7 @@ latex-package_pkg_postrm() {
 # Rehashes the kpathsea database, according to the current TeX installation
 latex-package_rehash() {
debug-print function $FUNCNAME $*
-   if latex-package_has_tetex_3 ; then
-   texmf-update
-   else
-   texconfig rehash
-   fi
+   texmf-update
 }
 
 EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
-- 
2.7.0


pgp9oB7KNLOUG.pgp
Description: PGP signature


[gentoo-dev] [PATCH] latex-package.eclass: Support EAPI 6.

2016-01-27 Thread Ulrich Mueller
Please find below a patch which will enable EAPI 6 support in
latex-package.eclass. The main change is that it won't inherit base
any more.

Ulrich


From 990fce89a3ec1a462399089541b67bbcc6baff87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= 
Date: Wed, 27 Jan 2016 17:15:23 +0100
Subject: [PATCH] latex-package.eclass: Support EAPI 6.

Don't inherit base.eclass in EAPI 6.

Don't define SRC_URI and S (which was the default).

Convert latex-package_has_tetex_3() to a dummy function for backwards
compatibility and remove its documentation.

Add some die commands.
---
 eclass/latex-package.eclass | 40 
 1 file changed, 16 insertions(+), 24 deletions(-)

diff --git a/eclass/latex-package.eclass b/eclass/latex-package.eclass
index 0acfcc9..f0228d5 100644
--- a/eclass/latex-package.eclass
+++ b/eclass/latex-package.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -51,16 +51,18 @@
 # you must either grab each file individually, or find a place to mirror an
 # archive of them.  (iBiblio)
 #
-# It inherits base.
+# It inherits base in EAPI 5 and earlier.
 
-inherit base
+case ${EAPI:-0} in
+   0|1|2|3|4|5) inherit base ;;
+   6) ;;
+   *) die "Unknown EAPI ${EAPI} for ${ECLASS}" ;;
+esac
 
 RDEPEND="virtual/latex-base"
 DEPEND="${RDEPEND}
>=sys-apps/texinfo-4.2-r5"
 HOMEPAGE="http://www.tug.org/;
-SRC_URI="ftp://tug.ctan.org/macros/latex/;
-S=${WORKDIR}/${P}
 TEXMF="/usr/share/texmf-site"
 
 # @ECLASS-VARIABLE: SUPPLIER
@@ -69,18 +71,12 @@ TEXMF="/usr/share/texmf-site"
 # DESCRIPTION above)
 SUPPLIER="misc"
 
-# @FUNCTION: latex-package_has_tetex3
-# @RETURN: true if at least one of (>=tetex-3 or >=ptex-3.1.8 or 
>=texlive-core-2007) is installed, else false
-# @DESCRIPTION:
-# It is often used to know if the current TeX installation supports gentoo's
-# texmf-update or if the package has to do it the old way
-latex-package_has_tetex_3() {
-   if has_version '>=app-text/tetex-3' || has_version 
'>=app-text/ptex-3.1.8' || has_version '>=app-text/texlive-core-2007' ; then
-   true
-   else
-   false
-   fi
-}
+case ${EAPI:-0} in
+   0|1|2|3|4|5)
+   # Kept for backwards compatibility
+   latex-package_has_tetex_3() { true; }
+   ;;
+esac
 
 # @FUNCTION: latex-package_src_doinstall
 # @USAGE: [ module ]
@@ -130,7 +126,7 @@ latex-package_src_doinstall() {
for i in `find . -maxdepth 1 -type f -name 
"*.${1}"`
do
einfo "Making documentation: $i"
-   texi2dvi -q -c --language=latex $i &> 
/dev/null
+   texi2dvi -q -c --language=latex $i &> 
/dev/null || die
done
;;
"tfm" | "vf" | "afm")
@@ -190,7 +186,7 @@ latex-package_src_compile() {
for i in `find \`pwd\` -maxdepth 1 -type f -name "*.ins"`
do
einfo "Extracting from $i"
-   latex --interaction=batchmode $i &> /dev/null
+   latex --interaction=batchmode $i &> /dev/null || die
done
 }
 
@@ -228,11 +224,7 @@ latex-package_pkg_postrm() {
 # Rehashes the kpathsea database, according to the current TeX installation
 latex-package_rehash() {
debug-print function $FUNCNAME $*
-   if latex-package_has_tetex_3 ; then
-   texmf-update
-   else
-   texconfig rehash
-   fi
+   texmf-update
 }
 
 EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
-- 
2.7.0


pgpU26MS6n6DP.pgp
Description: PGP signature


pgpqqWAgpVbE0.pgp
Description: PGP signature


Re: [gentoo-dev] [PATCH] latex-package.eclass: Support EAPI 6.

2016-01-27 Thread Alexis Ballier
On Wed, 27 Jan 2016 20:59:21 +0100
Ulrich Mueller  wrote:

> Please find below a patch which will enable EAPI 6 support in
> latex-package.eclass. The main change is that it won't inherit base
> any more.
> 
> Ulrich


lgtm, thanks