Re: [gentoo-dev] New QA policy suggestion: Disallow "live-only" packages

2020-11-04 Thread Marty E. Plummer
On Wed, Nov 04, 2020 at 06:24:39PM +, Alexey Sokolov wrote:
> 04.11.2020 19:10, Marty E. Plummer пишет:
> > On Tue, Nov 03, 2020 at 07:13:32AM +0200, Joonas Niilola wrote:
> >> Hey,
> >>
> > <-snip->
> > Just my 2c, One of the major reasons I use gentoo is the ability to use
> > live ebuilds relatively easily. One has the equivalent in arch linux in
> > the form of ${pkgname}-${vcs} aur packages but keeping them up to date
> > is quite annoying.
> >>
> >> -- juippis
> >>
> > 
> 
> What you're describing is live ebuilds, and I agree they are useful.
> Joonas was talking about packages which have *only* live ebuilds, and no
> other versions, and not even snapshots.
> 
I must have misread, then, as I assumed a kill of all ${PN}-**.ebuild
I suppose no live-only is reasonable for the most part, if there are
non-live releases (not all software is at that point in their release
cycles).
> -- 
> Best regards,
> Alexey "DarthGandalf" Sokolov
> 



Re: [gentoo-dev] New QA policy suggestion: Disallow "live-only" packages

2020-11-04 Thread Marty E. Plummer
On Tue, Nov 03, 2020 at 07:13:32AM +0200, Joonas Niilola wrote:
> Hey,
> 
<-snip->
Just my 2c, One of the major reasons I use gentoo is the ability to use
live ebuilds relatively easily. One has the equivalent in arch linux in
the form of ${pkgname}-${vcs} aur packages but keeping them up to date
is quite annoying.
> 
> -- juippis
> 



Re: [gentoo-dev] [PATCH] eclass/java-utils-2: switch to eapi7-ver

2019-02-22 Thread Marty E. Plummer
On Thu, Feb 21, 2019 at 03:30:32PM +0100, Andreas Sturmlechner wrote:
> On Montag, 17. Dezember 2018 09:09:13 CET Marty E. Plummer wrote:
> > @@ -15,7 +15,7 @@
> >  # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for
> > packages # that have optional Java support. In addition you can inherit
> > java-ant-2 for # Ant-based packages.
> > -inherit eutils versionator multilib
> > +inherit eutils multilib
> 
> I would recommend to keep inheriting all those eclasses (including 
> versionator) for EAPI 0-6, in order not to break revdeps with implicit use. 
> Who knows in what shape they are, and no one is going to fix them for a long 
> time. But we don't want to inherit any of them with EAPI-7, hence merge it 
> with below hunk.
> 
Yeah, I came to the same conclusion when I suggested a move from
versionator to eapi7-ver for gnome.org.eclass and it had implicit deps
on versionator in its consumers.
> > @@ -25,6 +25,9 @@ export WANT_JAVA_CONFIG="2"
> >  # Prefix variables are only available for EAPI>=3
> >  has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
> > 
> > +# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier 
> > eclasses.
> > +[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver
> > +
> >  # @VARIABLE: JAVA_PKG_E_DEPEND
> >  # @INTERNAL
> >  # @DESCRIPTION:
> 
> 
> Regards,
> Andreas
> 
> 
> 



[gentoo-dev] [PATCH] gnome.org.eclass: use eapi7-ver

2019-01-01 Thread Marty E. Plummer
Signed-off-by: Marty E. Plummer 
---
 eclass/gnome.org.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/gnome.org.eclass b/eclass/gnome.org.eclass
index 6b2ae672a2d..f41646749a0 100644
--- a/eclass/gnome.org.eclass
+++ b/eclass/gnome.org.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: gnome.org.eclass
@@ -11,7 +11,7 @@
 # @DESCRIPTION:
 # Provide a default SRC_URI for tarball hosted on gnome.org mirrors.
 
-inherit versionator
+[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver
 
 # @ECLASS-VARIABLE: GNOME_TARBALL_SUFFIX
 # @DESCRIPTION:
@@ -41,7 +41,7 @@ fi
 # @INTERNAL
 # @DESCRIPTION:
 # Major and minor numbers of the version number.
-: ${GNOME_ORG_PVP:=$(get_version_component_range 1-2)}
+: ${GNOME_ORG_PVP:=$(ver_cut 1-2)}
 
 
SRC_URI="mirror://gnome/sources/${GNOME_ORG_MODULE}/${GNOME_ORG_PVP}/${GNOME_ORG_MODULE}-${PV}.tar.${GNOME_TARBALL_SUFFIX}"
 
-- 
2.20.1




[gentoo-dev] [PATCH] twisted-r1.eclass: switch to eapi7-ver

2018-12-20 Thread Marty E. Plummer
Signed-off-by: Marty E. Plummer 
---
 eclass/twisted-r1.eclass | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/twisted-r1.eclass b/eclass/twisted-r1.eclass
index 7f0f796ec96..a57470bb2f3 100644
--- a/eclass/twisted-r1.eclass
+++ b/eclass/twisted-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: twisted-r1.eclass
@@ -25,7 +25,9 @@ esac
 
 if [[ ! ${_TWISTED_R1} ]]; then
 
-inherit distutils-r1 versionator
+inherit distutils-r1
+
+[[ ${EAPI} == [456] ]] && inherit eapi7-ver
 
 fi # ! ${_TWISTED_R1}
 
@@ -96,7 +98,7 @@ _twisted-r1_camelcase() {
 # in dependencies against other Twisted packages.
 #
 # Example: 1.2
-: ${TWISTED_RELEASE:=$(get_version_component_range 1-2 ${PV})}
+: ${TWISTED_RELEASE:=$(ver_cut 1-2 ${PV})}
 
 HOMEPAGE="https://www.twistedmatrix.com/trac/";
 SRC_URI="https://twistedmatrix.com/Releases/${TWISTED_PN#Twisted}";
-- 
2.20.0




[gentoo-dev] [PATCH] eclass/java-utils-2: switch to eapi7-ver

2018-12-17 Thread Marty E. Plummer
Signed-off-by: Marty E. Plummer 
---
 eclass/java-utils-2.eclass | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 473b177e539..a4c218c394e 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2018 Gentoo Foundation
+# Copyright 2004-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: java-utils-2.eclass
@@ -15,7 +15,7 @@
 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
packages
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
-inherit eutils versionator multilib
+inherit eutils multilib
 
 IUSE="elibc_FreeBSD"
 
@@ -25,6 +25,9 @@ export WANT_JAVA_CONFIG="2"
 # Prefix variables are only available for EAPI>=3
 has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
 
+# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier 
eclasses.
+[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver
+
 # @VARIABLE: JAVA_PKG_E_DEPEND
 # @INTERNAL
 # @DESCRIPTION:
@@ -1518,8 +1521,8 @@ java-pkg_is-vm-version-eq() {
 
local vm_version="$(java-pkg_get-vm-version)"
 
-   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
-   needed_version="$(get_version_component_range 1-2 "${needed_version}")"
+   vm_version="$(ver_cut 1-2 "${vm_version}")"
+   needed_version="$(ver_cut 1-2 "${needed_version}")"
 
if [[ -z "${vm_version}" ]]; then
debug-print "Could not get JDK version from DEPEND"
@@ -1570,7 +1573,7 @@ java-pkg_is-vm-version-ge() {
debug-print "Could not get JDK version from DEPEND"
return 1
else
-   if version_is_at_least "${needed_version}" "${vm_version}"; then
+   if ver_test "${vm_version}" -ge "${needed_version}"; then
debug-print "Detected a JDK(${vm_version}) >= 
${needed_version}"
return 0
else
-- 
2.20.0




Re: [gentoo-dev] Re: [PATCH 3/5] xdg.eclass: move deps to RDEPEND

2018-10-01 Thread Marty E. Plummer
On Mon, Oct 01, 2018 at 10:08:03AM -0400, Mike Gilbert wrote:
> On Mon, Oct 1, 2018 at 9:17 AM James Le Cuirot  wrote:
> >
> > On Mon, 1 Oct 2018 09:00:38 -0400
> > Mike Gilbert  wrote:
> >
> > > > The reason why it is in DEPEND though is that none of these tools
> > > > are required at runtime. They are needed at postinst and postrm
> > > > stages which afaik makes them DEPEND on EAPI previous to EAPI 7 and
> > > > BDEPEND in EAPI 7 if I'm not mistaken.
> > >
> > > This is incorrect; programs executed in pkg_postinst/pkg_postrm should
> > > be present in RDEPEND. Consider a binpkg installation, which would
> > > ignore DEPEND, but would still execute pkg_postinst.
> > >
> > > Another option: since xdg-utils.eclass functions will politely skip
> > > the updates if the tools are missing, we could just drop the
> > > dependency from xdg.eclass entirely and wait for the tools to get
> > > installed through some indirect means.
> >
> > Unfortunately there is no correct answer here as we didn't consider
> > this scenario when planning EAPI 7. We should have looked at Exherbo,
> > which does make this important distinction. There is a bug report open.
> >
> > https://bugs.gentoo.org/660306
> >
> > What I will say is that we should not attempt to executing anything
> > from within ROOT or SYSROOT unless it known to be interpreted
> > (e.g. a shell script) and there is no feasible alternative. I add that
> > exclusion clause because I have been forced to do this with
> > python-config.
> 
> That's a good point; both update-desktop-database and
> update-mime-database are compiled binaries, and should probably be
> executed from BROOT (/) instead. I'll revise my patchset.
> 
Not to steal the show/etc, but I do have a patchset which does most of
this already across {gnome2,xdg}{,-utils}.eclass, though I'm as
conflicted as you guys are with regards to the DEPEND/PDEPEND/BDEPEND/RDPEND
for it as well.
https://archives.gentoo.org/gentoo-dev/message/e0167edbb7b48b03dc90bfbb250ae16d




Re: mcrypt status (Re: [gentoo-dev] Idea for a new project: gentoo-libs)

2018-08-04 Thread Marty E. Plummer
On Sat, Aug 04, 2018 at 11:43:28AM +0300, Andrew Savchenko wrote:
> On Mon, 25 Jun 2018 07:59:47 +0200 Hanno Böck wrote:
> > On Fri, 22 Jun 2018 21:50:50 -0500
> > "Marty E. Plummer"  wrote:
> > 
> > > So, as you may be aware I've been doing some work on moving bzip2 to
> > > an autotools based build. Recently I've ran into app-crypt/mhash,
> > > which is in a semi-abandoned state (talking with the maintainer on
> > > twitter atm), and I was thinking it may be a good idea to set up a
> > > project for keeping these semi-abandoned and really-abandoned
> > > libraries and projects up to date and such.
> > 
> > This is a common problem, however if you want to make this reasonable
> > you wouldn't make it a gentoo thing, but a cross-distro effort. The
> > idea has been tossed around a lot, but noone yet started implementing
> > it.
> > 
> > However keeping things alive may not always be the right option.
> > There's a reason mcrypt is abandoned. It's an ancient crypto library,
> > crypto is moving forward, there are better options.
> 
> Do you have any evidence that mcrypt should not be used?
> 
> Symmetric cryptography is quite conservative and it took years and
> even decades for algorithms and their implementations to become
> trusted, so there is nothing wrong in using good old verified
> software.
> 
> Actually for local symmetric encryption this is the best tool I
> know.
> 
> Best regards,
> Andrew Savchenko
It seems that every last person commenting on this is talking mcrypt,
not mhash, which is what I mentioned in the first place. As far as I can
tell, these are entirely differnt projects which just happen to have a
similar name.




Re: [gentoo-dev] [PATCH] multilib: allow specifying the subtype of library in get_libname

2018-08-03 Thread Marty E. Plummer
On Fri, Aug 03, 2018 at 09:13:35AM +0200, Fabian Groffen wrote:
> Just wondering, we have get_libname, get_modname, shouldn't we just
> introduce get_linklibname or something instead of trying to overload
> get_libname?
> 
> The implementation of get_linklibname could be to just call get_libname
> for anything but mingw of course.
Actually that's a pretty good idea... Possibly with a warning to migrate
to the proper one in later eapis. Also, runtime libraries are a bit fun
too. for say, libFLAC(get_libname 8) on linux, you'd get libFLAC.so.8,
but on mingw-w64, you'd want libFLAC-8.dll on a mingw-w64 build.
> 
> Fabian
> 
> On 03-08-2018 00:09:41 -0500, Marty E. Plummer wrote:
> > Signed-off-by: Marty E. Plummer 
> > ---
> > 
> > On mingw-w64 (and perhaps cygwin and mingw.org), there are two forms of
> > non-static libraries. Standard *.dll libraries are for runtime and are
> > loaded from %PATH% on windows systems, and are typically stored in
> > either /bin or /usr/bin on mingw-w64 cross-toolchain filesystems. Import
> > libraries, *.dll.a, are used when linking and live in the ''normal''
> > libdirs, eg, /lib, /usr/lib and so on.
> > 
> > A number of ebuilds which otherwise work on mingw-w64 crossdev
> > toolchains exhibit failure due to usage of get_libname not being able to
> > specify which of the two types are required.
> > 
> > For example, sys-libs/ncurses, uses the following snippet of code:
> > ln -sf libncurses$(get_libname) 
> > "${ED}"/usr/$(get_libdir)/libcurses$(get_libname) || die
> > in order to create a 'libcurses.so -> libncurses.so' symlink.
> > 
> > However, on a crossdev-built mingw-w64 toolchain, one will end up with a
> > broken 'libcurses.dll -> libncurses.dll' symlink, which should properly
> > be a 'libcurses.dll.a -> libncurses.dll.a' symlink, as the symlink here
> > is provided to allow linking with -lcurses instead of -lncurses.
> > 
> >  eclass/multilib.eclass | 52 ++
> >  1 file changed, 48 insertions(+), 4 deletions(-)
> > 
> > diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
> > index 350b6f949d1..6a99f5977ec 100644
> > --- a/eclass/multilib.eclass
> > +++ b/eclass/multilib.eclass
> > @@ -239,26 +239,70 @@ get_exeext() {
> >  }
> >  
> >  # @FUNCTION: get_libname
> > -# @USAGE: [version]
> > +# @USAGE: --link|--run [version]
> >  # @DESCRIPTION:
> >  # Returns libname with proper suffix {.so,.dylib,.dll,etc} and optionally
> >  # supplied version for the current platform identified by CHOST.
> >  #
> > +# If '--link' argument is passed, the linktime library's suffix is 
> > returned,
> > +# as in the file that must exist to let `gcc -lfoo foo.c -o foo` to work.
> > +# If '--run' argument is passed, the runtime library's suffix is returned.
> > +#
> > +# In most unix-like platforms the two are identical, however on mingw-w64 
> > the
> > +# linktime library has the suffix of '.dll.a' and the runtime library 
> > '.dll'.
> > +#
> >  # Example:
> >  # get_libname ${PV}
> >  # Returns: .so.${PV} (ELF) || .${PV}.dylib (MACH) || ...
> > +# get_libname --link
> > +# Returns: .so (ELF) || .dylib (MACH) || .dll.a (PE32) || ...
> >  get_libname() {
> > -   local libname
> > -   local ver=$1
> > +   local libtype="undefined"
> > +   local libname opt ver
> > +   for opt; do
> > +   case "${opt}" in
> > +   --link)
> > +   libtype="link"
> > +   shift
> > +   ;;
> > +   --run)
> > +   libtype="run"
> > +   shift
> > +   ;;
> > +   *)
> > +   ;;
> > +   esac
> > +   done
> > +   ver="$1"
> > +   # general unixy types
> > case ${CHOST} in
> > *-cygwin*)   libname="dll.a";; # import lib
> > -   mingw*|*-mingw*) libname="dll";;
> > *-darwin*)   libname="dylib";;
> > *-mint*) libname="irrelevant";;
> > hppa*-hpux*) libname="sl";;
> > *)   libname="so";;
> > esac
> >  
> > +   # wierd mingw-w6

Re: [gentoo-dev] [PATCH] multilib: allow specifying the subtype of library in get_libname

2018-08-02 Thread Marty E. Plummer
On Fri, Aug 03, 2018 at 08:25:28AM +0200, Michał Górny wrote:
> W dniu pią, 03.08.2018 o godzinie 00∶09 -0500, użytkownik Marty E.
> Plummer napisał:
> > Signed-off-by: Marty E. Plummer 
> > ---
> > 
> > On mingw-w64 (and perhaps cygwin and mingw.org), there are two forms of
> > non-static libraries. Standard *.dll libraries are for runtime and are
> > loaded from %PATH% on windows systems, and are typically stored in
> > either /bin or /usr/bin on mingw-w64 cross-toolchain filesystems. Import
> > libraries, *.dll.a, are used when linking and live in the ''normal''
> > libdirs, eg, /lib, /usr/lib and so on.
> > 
> > A number of ebuilds which otherwise work on mingw-w64 crossdev
> > toolchains exhibit failure due to usage of get_libname not being able to
> > specify which of the two types are required.
> > 
> > For example, sys-libs/ncurses, uses the following snippet of code:
> > ln -sf libncurses$(get_libname) 
> > "${ED}"/usr/$(get_libdir)/libcurses$(get_libname) || die
> > in order to create a 'libcurses.so -> libncurses.so' symlink.
> > 
> > However, on a crossdev-built mingw-w64 toolchain, one will end up with a
> > broken 'libcurses.dll -> libncurses.dll' symlink, which should properly
> > be a 'libcurses.dll.a -> libncurses.dll.a' symlink, as the symlink here
> > is provided to allow linking with -lcurses instead of -lncurses.
> > 
> >  eclass/multilib.eclass | 52 ++
> >  1 file changed, 48 insertions(+), 4 deletions(-)
> > 
> > diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
> > index 350b6f949d1..6a99f5977ec 100644
> > --- a/eclass/multilib.eclass
> > +++ b/eclass/multilib.eclass
> > @@ -239,26 +239,70 @@ get_exeext() {
> >  }
> >  
> >  # @FUNCTION: get_libname
> > -# @USAGE: [version]
> > +# @USAGE: --link|--run [version]
> 
> It's optional, so it should go into square brackets.
> 
True, it's optional for most platforms, but should be explicit on
ebuilds which are relevant to the 'wierd' ones.
> >  # @DESCRIPTION:
> >  # Returns libname with proper suffix {.so,.dylib,.dll,etc} and optionally
> >  # supplied version for the current platform identified by CHOST.
> >  #
> > +# If '--link' argument is passed, the linktime library's suffix is 
> > returned,
> > +# as in the file that must exist to let `gcc -lfoo foo.c -o foo` to work.
> > +# If '--run' argument is passed, the runtime library's suffix is returned.
> 
> '...as the first argument'.  If order matters, make sure to explicitly
> specify that.
> 
Yeah, that will need to go first because of the arg parse code I used.
Will add that.
> > +#
> > +# In most unix-like platforms the two are identical, however on mingw-w64 
> > the
> > +# linktime library has the suffix of '.dll.a' and the runtime library 
> > '.dll'.
> 
> Also, you want to explicitly specify what happens if neither is passed.
> 
The intent is that for every ebuild which makes sense for
windows/cygwin/etc it has to be passed, and in which case it errors out
for the weirdos like me to file a bug/patch/pr to get the correct
behavior. For instance, I'm highly doubting anyone is going to be able
to use sys-cluster/gasnet on windows or the like, so it can stay as is,
but other libraries are going to have hella issue based on the
difference between a dll and dll.a, and should be specified.
> > +#
> >  # Example:
> >  # get_libname ${PV}
> >  # Returns: .so.${PV} (ELF) || .${PV}.dylib (MACH) || ...
> > +# get_libname --link
> > +# Returns: .so (ELF) || .dylib (MACH) || .dll.a (PE32) || ...
> >  get_libname() {
> > -   local libname
> > -   local ver=$1
> > +   local libtype="undefined"
> > +   local libname opt ver
> > +   for opt; do
> > +   case "${opt}" in
> > +   --link)
> > +   libtype="link"
> > +   shift
> > +   ;;
> > +   --run)
> > +   libtype="run"
> > +   shift
> > +   ;;
> > +   *)
> > +   ;;
> > +   esac
> > +   done
> > +   ver="$1"
> 
> + # general unixy types
> > case ${CHOST} in
> > *-cygwin*)   li

[gentoo-dev] [PATCH] multilib: allow specifying the subtype of library in get_libname

2018-08-02 Thread Marty E. Plummer
Signed-off-by: Marty E. Plummer 
---

On mingw-w64 (and perhaps cygwin and mingw.org), there are two forms of
non-static libraries. Standard *.dll libraries are for runtime and are
loaded from %PATH% on windows systems, and are typically stored in
either /bin or /usr/bin on mingw-w64 cross-toolchain filesystems. Import
libraries, *.dll.a, are used when linking and live in the ''normal''
libdirs, eg, /lib, /usr/lib and so on.

A number of ebuilds which otherwise work on mingw-w64 crossdev
toolchains exhibit failure due to usage of get_libname not being able to
specify which of the two types are required.

For example, sys-libs/ncurses, uses the following snippet of code:
ln -sf libncurses$(get_libname) 
"${ED}"/usr/$(get_libdir)/libcurses$(get_libname) || die
in order to create a 'libcurses.so -> libncurses.so' symlink.

However, on a crossdev-built mingw-w64 toolchain, one will end up with a
broken 'libcurses.dll -> libncurses.dll' symlink, which should properly
be a 'libcurses.dll.a -> libncurses.dll.a' symlink, as the symlink here
is provided to allow linking with -lcurses instead of -lncurses.

 eclass/multilib.eclass | 52 ++
 1 file changed, 48 insertions(+), 4 deletions(-)

diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index 350b6f949d1..6a99f5977ec 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -239,26 +239,70 @@ get_exeext() {
 }
 
 # @FUNCTION: get_libname
-# @USAGE: [version]
+# @USAGE: --link|--run [version]
 # @DESCRIPTION:
 # Returns libname with proper suffix {.so,.dylib,.dll,etc} and optionally
 # supplied version for the current platform identified by CHOST.
 #
+# If '--link' argument is passed, the linktime library's suffix is returned,
+# as in the file that must exist to let `gcc -lfoo foo.c -o foo` to work.
+# If '--run' argument is passed, the runtime library's suffix is returned.
+#
+# In most unix-like platforms the two are identical, however on mingw-w64 the
+# linktime library has the suffix of '.dll.a' and the runtime library '.dll'.
+#
 # Example:
 # get_libname ${PV}
 # Returns: .so.${PV} (ELF) || .${PV}.dylib (MACH) || ...
+# get_libname --link
+# Returns: .so (ELF) || .dylib (MACH) || .dll.a (PE32) || ...
 get_libname() {
-   local libname
-   local ver=$1
+   local libtype="undefined"
+   local libname opt ver
+   for opt; do
+   case "${opt}" in
+   --link)
+   libtype="link"
+   shift
+   ;;
+   --run)
+   libtype="run"
+   shift
+   ;;
+   *)
+   ;;
+   esac
+   done
+   ver="$1"
+   # general unixy types
case ${CHOST} in
*-cygwin*)   libname="dll.a";; # import lib
-   mingw*|*-mingw*) libname="dll";;
*-darwin*)   libname="dylib";;
*-mint*) libname="irrelevant";;
hppa*-hpux*) libname="sl";;
*)   libname="so";;
esac
 
+   # wierd mingw-w64 stuff, maybe even cygwin
+   case ${CHOST} in
+   mingw*|*-mingw*)
+   case ${libtype} in
+   link)
+   libname="dll.a" # import library
+   ;;
+   run)
+   libname="dll" # runtime library
+   ;;
+   undefined)
+   eerror "please specify either --link or 
--run to get_libname"
+   eerror "for mingw builds, as there are 
two types of libraries"
+   eerror "on this platform"
+   die
+   ;;
+   esac
+   ;;
+   esac
+
if [[ -z $* ]] ; then
echo ".${libname}"
else
-- 
2.18.0




[gentoo-dev] [PATCH] linux-info.eclass: fix for prematurely merged patch

2018-07-17 Thread Marty E. Plummer
https://github.com/gentoo/gentoo/pull/9222 was merged prematurely, and
included the first iteration of my linux-info EAPI 7 patch, and requires
this patch on top to avoid a double slash.
---
 eclass/linux-info.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 31464766038..6cd64457edd 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -554,7 +554,7 @@ get_version() {
# caught before this if they are.
if [[ -z ${OUTPUT_DIR} ]] ; then
# Try to locate a kernel that is most relevant for us.
-   for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}/" "" ; do
+   for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}" "" ; do

OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
if [[ -e ${OUTPUT_DIR} ]] ; then
break
-- 
2.18.0




Re: [gentoo-dev] [PATCH 01/10] gnome2-utils: move icon functions into xdg-utils

2018-07-15 Thread Marty E. Plummer
On Sun, Jul 15, 2018 at 08:22:02AM +0200, Hans de Graaff wrote:
> On Tue, 2018-06-26 at 20:27 -0500, Marty E. Plummer wrote:
> > 
> >  # Updates Gtk+ icon cache files under /usr/share/icons.
> > -# This function should be called from pkg_postinst and pkg_postrm.
> > +# Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
> >  gnome2_icon_cache_update() {
> 
> This would be a good candidate for an eqawarn message. Not sure how
> many people will catch this deprecation in the documentation.
> 
> Hans
Later patch in the series causes this function to error out on EAPI 7+,
along with a message. I had previously had the same idea, but the ml
thought it would be a bad idea for n amount of currently working ebuilds
to just start yelling out of nowhere. Just force the migration when
updating to EAPI 7 and we're good :)




[gentoo-dev] [PATCH v2] linux-info.eclass: account for lack of trailing slash

2018-07-14 Thread Marty E. Plummer
In EAPI 7, D, ED, ROOT, EROOT no longer have a trailing slash[1]. This
makes finding /usr/src/linux not work properly as it currently stands.

Use the form "${ROOT%/}/" where apropos in order to unify behavior across
EAPIs.

1: https://projects.gentoo.org/pms/7/pms.html#x1-113001r7
---
 eclass/linux-info.eclass | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 96f94e4072a..6cd64457edd 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -115,7 +115,7 @@ IUSE="kernel_linux"
 
 # Overwritable environment Var's
 # ---
-KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
+KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}"
 
 
 # Bug fixes
@@ -554,7 +554,7 @@ get_version() {
# caught before this if they are.
if [[ -z ${OUTPUT_DIR} ]] ; then
# Try to locate a kernel that is most relevant for us.
-   for OUTPUT_DIR in "${SYSROOT}" "${ROOT}" "" ; do
+   for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}" "" ; do

OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
if [[ -e ${OUTPUT_DIR} ]] ; then
break
@@ -615,19 +615,19 @@ get_running_version() {
 
KV_FULL=$(uname -r)
 
-   if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile && -f 
${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
-   KBUILD_OUTPUT=$(readlink -f 
${ROOT}/lib/modules/${KV_FULL}/build)
+   if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f 
${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/source)
+   KBUILD_OUTPUT=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/build)
unset KV_FULL
get_version
return $?
-   elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
+   elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/source)
unset KV_FULL
get_version
return $?
-   elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build)
+   elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
unset KV_FULL
get_version
return $?
-- 
2.18.0




Re: [gentoo-dev] [PATCH] linux-info.eclass: account for lack of trailing slash

2018-07-14 Thread Marty E. Plummer
On Sat, Jul 14, 2018 at 08:21:42AM +0200, Ulrich Mueller wrote:
> >>>>> On Fri, 13 Jul 2018, Marty E Plummer wrote:
> 
> > In EAPI 7, D, ED, ROOT, EROOT no longer have a trailing slash[1]. This
> > makes finding /usr/src/linux not work properly as it currently stands.
> 
> > Use the form "${ROOT%/}/" where apropos in order to unify behavior across
> > EAPIs.
> 
> > 1: https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-113001r7
> 
> Please use https://projects.gentoo.org/pms/7/pms.html if you want the
> fragment identifier to be stable (which is not guaranteed for the
> version in my home directory).
> 
Ok, will do.
> > @@ -554,7 +554,7 @@ get_version() {
> > # caught before this if they are.
> > if [[ -z ${OUTPUT_DIR} ]] ; then
> > # Try to locate a kernel that is most relevant for us.
> > -   for OUTPUT_DIR in "${SYSROOT}" "${ROOT}" "" ; do
> > +   for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}/" "" ; do
> 
> Shouldn't it be "${ROOT%/}" here? Otherwise OUTPUT_DIR may begin with
> a double slash.
> 
Ah, good point. I didn't check that well enough, will fix it up.
> > 
> > OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
> > if [[ -e ${OUTPUT_DIR} ]] ; then
> > break





[gentoo-dev] [PATCH] linux-info.eclass: account for lack of trailing slash

2018-07-13 Thread Marty E. Plummer
In EAPI 7, D, ED, ROOT, EROOT no longer have a trailing slash[1]. This
makes finding /usr/src/linux not work properly as it currently stands.

Use the form "${ROOT%/}/" where apropos in order to unify behavior across
EAPIs.

1: https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-113001r7
---
 eclass/linux-info.eclass | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 96f94e4072a..31464766038 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -115,7 +115,7 @@ IUSE="kernel_linux"
 
 # Overwritable environment Var's
 # ---
-KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
+KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}"
 
 
 # Bug fixes
@@ -554,7 +554,7 @@ get_version() {
# caught before this if they are.
if [[ -z ${OUTPUT_DIR} ]] ; then
# Try to locate a kernel that is most relevant for us.
-   for OUTPUT_DIR in "${SYSROOT}" "${ROOT}" "" ; do
+   for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}/" "" ; do

OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
if [[ -e ${OUTPUT_DIR} ]] ; then
break
@@ -615,19 +615,19 @@ get_running_version() {
 
KV_FULL=$(uname -r)
 
-   if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile && -f 
${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
-   KBUILD_OUTPUT=$(readlink -f 
${ROOT}/lib/modules/${KV_FULL}/build)
+   if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f 
${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/source)
+   KBUILD_OUTPUT=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/build)
unset KV_FULL
get_version
return $?
-   elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
+   elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/source)
unset KV_FULL
get_version
return $?
-   elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build)
+   elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
unset KV_FULL
get_version
return $?
-- 
2.18.0




[gentoo-dev] [PATCH] linux-info.eclass: account for lack of trailing slash

2018-07-13 Thread Marty E. Plummer
In EAPI 7, D, ED, ROOT, EROOT no longer have a trailing slash[1]. This
makes finding /usr/src/linux not work properly as it currently stands.

Use the form "${ROOT%}/" where apropos in order to unify behavior across
EAPIs.
---
 eclass/linux-info.eclass | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 96f94e4072a..31464766038 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -115,7 +115,7 @@ IUSE="kernel_linux"
 
 # Overwritable environment Var's
 # ---
-KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
+KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}"
 
 
 # Bug fixes
@@ -554,7 +554,7 @@ get_version() {
# caught before this if they are.
if [[ -z ${OUTPUT_DIR} ]] ; then
# Try to locate a kernel that is most relevant for us.
-   for OUTPUT_DIR in "${SYSROOT}" "${ROOT}" "" ; do
+   for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}/" "" ; do

OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
if [[ -e ${OUTPUT_DIR} ]] ; then
break
@@ -615,19 +615,19 @@ get_running_version() {
 
KV_FULL=$(uname -r)
 
-   if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile && -f 
${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
-   KBUILD_OUTPUT=$(readlink -f 
${ROOT}/lib/modules/${KV_FULL}/build)
+   if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f 
${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/source)
+   KBUILD_OUTPUT=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/build)
unset KV_FULL
get_version
return $?
-   elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
+   elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f 
${ROOT%/}/lib/modules/${KV_FULL}/source)
unset KV_FULL
get_version
return $?
-   elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then
-   KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build)
+   elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+   KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
unset KV_FULL
get_version
return $?
-- 
2.18.0




[gentoo-dev] [PATCH] linux-info.eclass: enable EAPI 7

2018-07-10 Thread Marty E. Plummer
versionator is banned in EAPI 7, so switch to either native EAPI 7
version functions or inherit eapi7-ver on EAPI 0-6
---
 eclass/linux-info.eclass | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 77df7a6ad60..96f94e4072a 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -106,7 +106,8 @@
 # KBUILD_OUTPUT is used. This should be used for referencing .config.
 
 # And to ensure all the weirdness with crosscompile
-inherit toolchain-funcs versionator
+inherit toolchain-funcs
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
 
 EXPORT_FUNCTIONS pkg_setup
 
@@ -634,9 +635,9 @@ get_running_version() {
# This handles a variety of weird kernel versions.  Make sure 
to update
# tests/linux-info_get_running_version.sh if you want to change 
this.
local kv_full=${KV_FULL//[-+_]*}
-   KV_MAJOR=$(get_version_component_range 1 ${kv_full})
-   KV_MINOR=$(get_version_component_range 2 ${kv_full})
-   KV_PATCH=$(get_version_component_range 3 ${kv_full})
+   KV_MAJOR=$(ver_cut 1 ${kv_full})
+   KV_MINOR=$(ver_cut 2 ${kv_full})
+   KV_PATCH=$(ver_cut 3 ${kv_full})

KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}"
: ${KV_PATCH:=0}
fi
-- 
2.18.0




[gentoo-dev] [PATCH] linux-info.eclass: enable EAPI 7

2018-07-10 Thread Marty E. Plummer
versionator is banned in EAPI 7, so switch to either native EAPI 7
version functions or inherit eapi7-ver on EAPI 0-6
---
 eclass/linux-info.eclass | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 77df7a6ad60..96f94e4072a 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -106,7 +106,8 @@
 # KBUILD_OUTPUT is used. This should be used for referencing .config.
 
 # And to ensure all the weirdness with crosscompile
-inherit toolchain-funcs versionator
+inherit toolchain-funcs
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
 
 EXPORT_FUNCTIONS pkg_setup
 
@@ -634,9 +635,9 @@ get_running_version() {
# This handles a variety of weird kernel versions.  Make sure 
to update
# tests/linux-info_get_running_version.sh if you want to change 
this.
local kv_full=${KV_FULL//[-+_]*}
-   KV_MAJOR=$(get_version_component_range 1 ${kv_full})
-   KV_MINOR=$(get_version_component_range 2 ${kv_full})
-   KV_PATCH=$(get_version_component_range 3 ${kv_full})
+   KV_MAJOR=$(ver_cut 1 ${kv_full})
+   KV_MINOR=$(ver_cut 2 ${kv_full})
+   KV_PATCH=$(ver_cut 3 ${kv_full})

KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}"
: ${KV_PATCH:=0}
fi
-- 
2.18.0




[gentoo-dev] [PATCH] meson.eclass: add EAPI 7 support

2018-07-10 Thread Marty E. Plummer
---

It seems this is all that is needed, and all the eclasses inherited by
it are supported for EAPI 7. I could be missing something, so please do
comment if I have.
 eclass/meson.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index f2202a04593..7c5b3da6ffa 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -34,7 +34,7 @@
 # @CODE
 
 case ${EAPI:-0} in
-   6) ;;
+   6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -69,7 +69,11 @@ MESON_DEPEND=">=dev-util/meson-0.40.0
 # their own DEPEND string.
 : ${MESON_AUTO_DEPEND:=yes}
 if [[ ${MESON_AUTO_DEPEND} != "no" ]] ; then
-   DEPEND=${MESON_DEPEND}
+   if [[ ${EAPI:-0} == [0123456] ]]; then
+   DEPEND=${MESON_DEPEND}
+   else
+   BDEPEND=${MESON_DEPEND}
+   fi
 fi
 __MESON_AUTO_DEPEND=${MESON_AUTO_DEPEND} # See top of eclass
 
-- 
2.18.0




Re: [gentoo-dev] [PATCH 05/10] xdg.eclass: make EAPI 7 ready

2018-07-04 Thread Marty E. Plummer
On Wed, Jun 27, 2018 at 08:37:04AM +0200, Michał Górny wrote:
> W dniu śro, 27.06.2018 o godzinie 06∶58 +0200, użytkownik Ulrich Mueller
> napisał:
> > > > > > > On Tue, 26 Jun 2018, Marty E Plummer wrote:
> > > Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
> > > as a number of executables which will need to be executed on the build
> > > host are included in them.
> > > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > > ---
> > >  eclass/xdg.eclass | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
> > > index 2a4e1f81abf..fc4bee30ca5 100644
> > > --- a/eclass/xdg.eclass
> > > +++ b/eclass/xdg.eclass
> > > @@ -26,6 +26,7 @@ DEPEND="
> > >   dev-util/desktop-file-utils
> > >   x11-misc/shared-mime-info
> > >  "
> > > +[[ ${EAPI:-0} == [0123456] ]] || BDEPEND="${DEPEND}"
> > 
> > Are these also needed in DEPEND? If not, you should set DEPEND="" in
> > EAPI 7.
> > 
> 
> Technically, they don't belong in either because they're run
> in pkg_post* phases only.
>
https://projects.gentoo.org/pms/7/pms.html#x1-680008.1
According to this, if I read it right, pkg_{pre,post}{inst,rm} deps
should go into PDEPEND; is that still correct in terms of EAPI7 and
such?
> -- 
> Best regards,
> Michał Górny





Re: [gentoo-dev] Packages up for grabs: app-emulation/virtualbox-bin

2018-07-03 Thread Marty E. Plummer
On Tue, Jul 03, 2018 at 09:03:45PM +0200, Jonas Stein wrote:
> Dear all,
> 
> The following packages are up for grabs:
> 
> app-emulation/virtualbox-bin
> 
> 
> after retirement of the proxied maintainer.
> 
> https://packages.gentoo.org/packages/app-emulation/virtualbox-bin
> 
> This famous package has open bugs and
> 
> RepoMan scours the neighborhood...
>   inherit.deprecated3
>app-emulation/virtualbox-bin/virtualbox-bin-5.1.36.122089.ebuild:
> please migrate from 'versionator' to 'eapi7-ver (built-in since EAPI 7)'
> on line: 8
>app-emulation/virtualbox-bin/virtualbox-bin-5.1.38.122592.ebuild:
> please migrate from 'versionator' to 'eapi7-ver (built-in since EAPI 7)'
> on line: 8
>app-emulation/virtualbox-bin/virtualbox-bin-5.2.12.122591.ebuild:
> please migrate from 'versionator' to 'eapi7-ver (built-in since EAPI 7)'
I'm half inclined to do this work prior to it getting nixed, that way if
someone resurrects it it won't have this, at least. Fair?
> on line: 8
>   repo.eapi-deprecated  3
>app-emulation/virtualbox-bin/virtualbox-bin-5.1.36.122089.ebuild: 5
>app-emulation/virtualbox-bin/virtualbox-bin-5.1.38.122592.ebuild: 5
>app-emulation/virtualbox-bin/virtualbox-bin-5.2.12.122591.ebuild: 5
> 
> 
> -- 
> Best,
> Jonas
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 






Re: [gentoo-dev] [PATCH 02/10] gnome2.eclass: move icon handling code to xdg.eclass

2018-06-27 Thread Marty E. Plummer
On Wed, Jun 27, 2018 at 06:42:23PM +0200, Pacho Ramos wrote:
> El mar, 26-06-2018 a las 20:27 -0500, Marty E. Plummer escribió:
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/gnome2.eclass |  9 +
> gnome2.eclass would also need to fix this regression in eapi6
> (https://bugs.gentoo.org/613364) and to deprecate ltprune.eclass usage
> (https://bugs.gentoo.org/658638)
> 
Good to know, I could probably look into that after this gets fully
approved, since I don't want to juggle too many patches with that many
different goals.



Re: [gentoo-dev] [PATCH 05/10] xdg.eclass: make EAPI 7 ready

2018-06-27 Thread Marty E. Plummer
On Wed, Jun 27, 2018 at 08:37:04AM +0200, Michał Górny wrote:
> W dniu śro, 27.06.2018 o godzinie 06∶58 +0200, użytkownik Ulrich Mueller
> napisał:
> > > > > > > On Tue, 26 Jun 2018, Marty E Plummer wrote:
> > > Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
> > > as a number of executables which will need to be executed on the build
> > > host are included in them.
> > > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > > ---
> > >  eclass/xdg.eclass | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
> > > index 2a4e1f81abf..fc4bee30ca5 100644
> > > --- a/eclass/xdg.eclass
> > > +++ b/eclass/xdg.eclass
> > > @@ -26,6 +26,7 @@ DEPEND="
> > >   dev-util/desktop-file-utils
> > >   x11-misc/shared-mime-info
> > >  "
> > > +[[ ${EAPI:-0} == [0123456] ]] || BDEPEND="${DEPEND}"
> > 
> > Are these also needed in DEPEND? If not, you should set DEPEND="" in
> > EAPI 7.
> > 
> 
> Technically, they don't belong in either because they're run
> in pkg_post* phases only.
> 
Huh. well, should there not be some way to specify that they are needed
for the pkg_post* phases or should I just drop them entirely?
> -- 
> Best regards,
> Michał Górny





[gentoo-dev] [PATCH 10/10] gnome2.eclass: enable EAPI 7

2018-06-26 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 57eafcd451b..d49a9c21baf 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -22,7 +22,7 @@ case "${EAPI:-0}" in
4|5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure 
src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
-   6)
+   6|7)
EXPORT_FUNCTIONS src_prepare src_configure src_compile 
src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
-- 
2.17.1




[gentoo-dev] [PATCH 09/10] xdg.eclass: enable EAPI 7

2018-06-26 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index fc4bee30ca5..78164993eb5 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -14,7 +14,7 @@
 inherit xdg-utils
 
 case "${EAPI:-0}" in
-   4|5|6)
+   4|5|6|7)
EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
-- 
2.17.1




[gentoo-dev] [PATCH 08/10] gnome2-utils.eclass: enable EAPI 7

2018-06-26 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 6bd3cebac2d..ee570fe9c66 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -18,7 +18,7 @@
 inherit eutils xdg-utils
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6) ;;
+   0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-- 
2.17.1




[gentoo-dev] [PATCH 07/10] xdg-utils.eclass: enable EAPI 7

2018-06-26 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index 9e4d4638e38..a947aad58d6 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -15,7 +15,7 @@
 #  * XDG mime information database management
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6) ;;
+   0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-- 
2.17.1




[gentoo-dev] [PATCH 06/10] gnome2.eclass: make EAPI 7 ready

2018-06-26 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index c4418df92bb..57eafcd451b 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -256,7 +256,7 @@ gnome2_src_install() {
# create bogus directories in /var/lib/
if has ${EAPI:-0} 4 5; then
dodir "${sk_tmp_dir}" || die "dodir failed"
-   emake DESTDIR="${D}" 
"scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install 
failed"
+   emake DESTDIR="${D}" 
"scrollkeeper_localstate_dir=${ED%/}${sk_tmp_dir} " "$@" install || die 
"install failed"
else
default
fi
@@ -282,14 +282,14 @@ gnome2_src_install() {
 
# Do not keep /var/lib/scrollkeeper because:
# 1. The scrollkeeper database is regenerated at pkg_postinst()
-   # 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current 
pkg
+   # 2. ${ED%/}/var/lib/scrollkeeper contains only indexes for the current 
pkg
#thus it makes no sense if pkg_postinst ISN'T run for some reason.
-   rm -rf "${ED}${sk_tmp_dir}"
-   rmdir "${ED}/var/lib" 2>/dev/null
-   rmdir "${ED}/var" 2>/dev/null
+   rm -rf "${ED%/}${sk_tmp_dir}"
+   rmdir "${ED%/}/var/lib" 2>/dev/null
+   rmdir "${ED%/}/var" 2>/dev/null
 
# Make sure this one doesn't get in the portage db
-   rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
+   rm -fr "${ED%/}/usr/share/applications/mimeinfo.cache"
 
# Delete all .la files
if has ${EAPI:-0} 4; then
-- 
2.17.1




[gentoo-dev] [PATCH 04/10] gnome2-utils.eclass: make EAPI 7 ready

2018-06-26 Thread Marty E. Plummer
Use ${EROOT%/} whereever possible, as most of the directories and files
used in conjunction with it have a leading /; add missing leading /
where apropriate.

Drop EAPI 0-2 support as no in-tree ebuilds use it to simplify the
ROOT/EROOT/BROOT logic.

Use BROOT to specify path to executable files, setting that to EROOT
when not EAPI 7

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 100 ++---
 1 file changed, 61 insertions(+), 39 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 1597ac4ad08..6bd3cebac2d 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -76,9 +76,6 @@ esac
 # @DESCRIPTION:
 # List of gdk-pixbuf loaders provided by the package
 
-DEPEND=">=sys-apps/sed-4"
-
-
 # @FUNCTION: gnome2_environment_reset
 # @DESCRIPTION:
 # Reset various variables inherited from root's evironment to a reasonable
@@ -95,7 +92,7 @@ gnome2_environment_reset() {
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
 
-   if has ${EAPI:-0} 6; then
+   if [[ ${EAPI:-0} != [012345] ]]; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
 
@@ -110,7 +107,6 @@ gnome2_environment_reset() {
 # in the GNOME2_ECLASS_SCHEMAS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_gconf_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name 
'*.schemas' 2> /dev/null)
popd > /dev/null || die
@@ -122,8 +118,8 @@ gnome2_gconf_savelist() {
 # using gconftool-2.
 # This function should be called from pkg_postinst.
 gnome2_gconf_install() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GCONFTOOL_BIN}"
+   [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+   local updater="${BROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -143,9 +139,9 @@ gnome2_gconf_install() {
 
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
-   if [[ -e "${EROOT}${F}" ]]; then
+   if [[ -e "${EROOT%/}${F}" ]]; then
debug-print "Installing schema: ${F}"
-   "${updater}" --makefile-install-rule "${EROOT}${F}" 
1>/dev/null
+   "${updater}" --makefile-install-rule "${EROOT%/}${F}" 
1>/dev/null
fi
done
 
@@ -163,8 +159,8 @@ gnome2_gconf_install() {
 # Removes schema files previously installed by the current ebuild from Gconf's
 # database.
 gnome2_gconf_uninstall() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GCONFTOOL_BIN}"
+   [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+   local updater="${BROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -183,9 +179,9 @@ gnome2_gconf_uninstall() {
 
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
-   if [[ -e "${EROOT}${F}" ]]; then
+   if [[ -e "${EROOT%/}${F}" ]]; then
debug-print "Uninstalling gconf schema: ${F}"
-   "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 
1>/dev/null
+   "${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 
1>/dev/null
fi
done
 
@@ -206,10 +202,15 @@ gnome2_gconf_uninstall() {
 # gnome2_icon_cache_update conditionally.
 # This function should be called from pkg_preinst.
 gnome2_icon_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
-   pushd "${ED}" > /dev/null || die
-   export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 
-mindepth 1 -type d 2> /dev/null)
-   popd > /dev/null || die
+   if [[ ${EAPI:-0} == [0123456] ]]; then
+   pushd "${ED}" > /dev/null || die
+   export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 
-mindepth 1 -type d 2> /dev/null)
+   popd > /dev/null || die
+   else
+   eerror "gnome2_icon_savelist is banned in EAPI ${EAPI}"
+   eerror "please migrate to the related functions in xdg-utils 
and xdg"
+   die
+   fi
 }
 
 # @FUNCTION: gnome2_icon_cache_update
@@ -217,7 +218,13 @@ gnome2_icon_savelist() {
 # Updates Gtk+ icon cache files under /usr/share/icons.
 # Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
 gnome2_icon_cache_update() {
-   xdg_icon_cache_update
+   if [[ ${EAPI:-0} == [0123456] ]]; then
+   xdg_icon_cache_update
+   else
+   eerror "gnome2_icon_cache_update is banned in EAPI ${EAPI}"
+ 

[gentoo-dev] [PATCH 05/10] xdg.eclass: make EAPI 7 ready

2018-06-26 Thread Marty E. Plummer
Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
as a number of executables which will need to be executed on the build
host are included in them.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg.eclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index 2a4e1f81abf..fc4bee30ca5 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -26,6 +26,7 @@ DEPEND="
dev-util/desktop-file-utils
x11-misc/shared-mime-info
 "
+[[ ${EAPI:-0} == [0123456] ]] || BDEPEND="${DEPEND}"
 fi
 
 # @FUNCTION: xdg_src_prepare
@@ -34,7 +35,7 @@ fi
 xdg_src_prepare() {
xdg_environment_reset
 
-   has ${EAPI:-0} 6 && default
+   [[ ${EAPI:-0} == [012345] ]] || default
 }
 
 # @FUNCTION: xdg_pkg_preinst
-- 
2.17.1




[gentoo-dev] [PATCH 03/10] xdg-utils.eclass: make EAPI 7 ready

2018-06-26 Thread Marty E. Plummer
Use ${EROOT%/} whereever possible, as the tools and directories which
are used with it are already prefixed with a /
Use BROOT to specify path to update-mime-database and friends, setting
that to EROOT when not EAPI 7

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index f9088d9c348..9e4d4638e38 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -72,7 +72,8 @@ xdg_environment_reset() {
 # Updates the .desktop files database.
 # Generates a list of mimetypes linked to applications that can handle them
 xdg_desktop_database_update() {
-   local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
+   [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+   local updater="${BROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
 
if [[ ${EBUILD_PHASE} != post* ]] ; then
die "xdg_desktop_database_update must be used in pkg_post* 
phases."
@@ -84,7 +85,7 @@ xdg_desktop_database_update() {
fi
 
ebegin "Updating .desktop files database"
-   "${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
+   "${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
eend $?
 }
 
@@ -93,8 +94,8 @@ xdg_desktop_database_update() {
 # Updates Gtk+ icon cache files under /usr/share/icons.
 # This function should be called from pkg_postinst and pkg_postrm.
 xdg_icon_cache_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
+   [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+   local updater="${BROOT%/}${GTK_UPDATE_ICON_CACHE}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -145,7 +146,8 @@ xdg_icon_cache_update() {
 # Update the mime database.
 # Creates a general list of mime types from several sources
 xdg_mimeinfo_database_update() {
-   local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
+   [[ ${EAPI:-0} == [0123456] ]] && BROOT=${EROOT}
+   local updater="${BROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
 
if [[ ${EBUILD_PHASE} != post* ]] ; then
die "xdg_mimeinfo_database_update must be used in pkg_post* 
phases."
@@ -157,6 +159,6 @@ xdg_mimeinfo_database_update() {
fi
 
ebegin "Updating shared mime info database"
-   "${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
+   "${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
eend $?
 }
-- 
2.17.1




[gentoo-dev] [PATCH 01/10] gnome2-utils: move icon functions into xdg-utils

2018-06-26 Thread Marty E. Plummer
Kept some dummy stub functions in place in order to maintain
functionality of existing ebuilds.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 56 ++-
 eclass/xdg-utils.eclass| 60 +-
 2 files changed, 62 insertions(+), 54 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 65076ae2d61..1597ac4ad08 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: gnome2-utils.eclass
@@ -40,12 +40,6 @@ esac
 # Path to scrollkeeper-update
 : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
 
-# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
-# @INTERNAL
-# @DESCRIPTION:
-# Path to gtk-update-icon-cache
-: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
-
 # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
 # @INTERNAL
 # @DESCRIPTION:
@@ -221,53 +215,9 @@ gnome2_icon_savelist() {
 # @FUNCTION: gnome2_icon_cache_update
 # @DESCRIPTION:
 # Updates Gtk+ icon cache files under /usr/share/icons.
-# This function should be called from pkg_postinst and pkg_postrm.
+# Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
 gnome2_icon_cache_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
-
-   if [[ ! -x "${updater}" ]] ; then
-   debug-print "${updater} is not executable"
-   return
-   fi
-
-   ebegin "Updating icons cache"
-
-   local retval=0
-   local fails=( )
-
-   for dir in "${EROOT%/}"/usr/share/icons/*
-   do
-   if [[ -f "${dir}/index.theme" ]] ; then
-   local rv=0
-
-   "${updater}" -qf "${dir}"
-   rv=$?
-
-   if [[ ! $rv -eq 0 ]] ; then
-   debug-print "Updating cache failed on ${dir}"
-
-   # Add to the list of failures
-   fails+=( "${dir}" )
-
-   retval=2
-   fi
-   elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
-   # Clear stale cache files after theme uninstallation
-   rm "${dir}/icon-theme.cache"
-   fi
-
-   if [[ -z $(ls "${dir}") ]]; then
-   # Clear empty theme directories after theme 
uninstallation
-   rmdir "${dir}"
-   fi
-   done
-
-   eend ${retval}
-
-   for f in "${fails[@]}" ; do
-   eerror "Failed to update cache with icon $f"
-   done
+   xdg_icon_cache_update
 }
 
 # @FUNCTION: gnome2_omf_fix
diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index ac075185d8e..f9088d9c348 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xdg-utils.eclass
@@ -31,6 +31,12 @@ esac
 # Directory where .desktop files database is stored
 : ${DESKTOP_DATABASE_DIR="/usr/share/applications"}
 
+# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
+# @INTERNAL
+# @DESCRIPTION:
+# Path to gtk-update-icon-cache
+: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
+
 # @ECLASS-VARIABLE: MIMEINFO_DATABASE_UPDATE_BIN
 # @INTERNAL
 # @DESCRIPTION:
@@ -82,6 +88,58 @@ xdg_desktop_database_update() {
eend $?
 }
 
+# @FUNCTION: xdg_icon_cache_update
+# @DESCRIPTION:
+# Updates Gtk+ icon cache files under /usr/share/icons.
+# This function should be called from pkg_postinst and pkg_postrm.
+xdg_icon_cache_update() {
+   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
+   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
+
+   if [[ ! -x "${updater}" ]]; then
+   debug-print "${updater} is not executable"
+   return
+   fi
+
+   ebegin "Updating icons cache"
+
+   local retval=0
+   local fails=( )
+
+   for dir in "${EROOT%/}"/usr/share/icons/*
+   do
+   if [[ -f "${dir}/index.theme" ]] ; then
+   local rv=0
+
+   "${updater}" -qf "${dir}"
+   rv=$?
+
+   if [[ ! $rv -eq 0 ]] ; then
+   debug-print "Updating cache failed on ${dir}"
+
+   # Add to the list of failures
+   fails+=( "${dir}" )
+
+   retval=2
+   fi
+   elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
+   # Clear stale cache files after theme uninstallation
+

[gentoo-dev] [PATCH 02/10] gnome2.eclass: move icon handling code to xdg.eclass

2018-06-26 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass |  9 +
 eclass/xdg.eclass| 31 ---
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 6db6d08b14e..c4418df92bb 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: gnome2.eclass
@@ -315,7 +315,6 @@ gnome2_src_install() {
 gnome2_pkg_preinst() {
xdg_pkg_preinst
gnome2_gconf_savelist
-   gnome2_icon_savelist
gnome2_schemas_savelist
gnome2_scrollkeeper_savelist
gnome2_gdk_pixbuf_savelist
@@ -337,9 +336,6 @@ gnome2_pkg_preinst() {
 gnome2_pkg_postinst() {
xdg_pkg_postinst
gnome2_gconf_install
-   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
-   gnome2_icon_cache_update
-   fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
@@ -361,9 +357,6 @@ gnome2_pkg_postinst() {
 # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
 gnome2_pkg_postrm() {
xdg_pkg_postrm
-   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
-   gnome2_icon_cache_update
-   fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index fd4816b8447..2a4e1f81abf 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xdg.eclass
@@ -39,9 +39,9 @@ xdg_src_prepare() {
 
 # @FUNCTION: xdg_pkg_preinst
 # @DESCRIPTION:
-# Finds .desktop and mime info files for later handling in pkg_postinst.
-# Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES
-# respectively.
+# Finds .desktop, icon and mime info files for later handling in pkg_postinst.
+# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONFILES
+# and XDG_ECLASS_MIMEINFOFILES respectively.
 xdg_pkg_preinst() {
local f
 
@@ -50,17 +50,22 @@ xdg_pkg_preinst() {
XDG_ECLASS_DESKTOPFILES+=( ${f} )
done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 
2>/dev/null)
 
+   XDG_ECLASS_ICONFILES=()
+   while IFS= read -r '' f; do
+   XDG_ECLASS_ICONFILES+=( ${f} )
+   done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 
2>/dev/null)
+
XDG_ECLASS_MIMEINFOFILES=()
while IFS= read -r -d '' f; do
XDG_ECLASS_MIMEINFOFILES+=( ${f} )
done < <(cd "${D}" && find 'usr/share/mime' -type f -print0 2>/dev/null)
 
-   export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_MIMEINFOFILES
+   export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_ICONFILES 
XDG_ECLASS_MIMEINFOFILES
 }
 
 # @FUNCTION: xdg_pkg_postinst
 # @DESCRIPTION:
-# Handle desktop and mime info database updates.
+# Handle desktop, icon and mime info database updates.
 xdg_pkg_postinst() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
xdg_desktop_database_update
@@ -68,6 +73,12 @@ xdg_pkg_postinst() {
debug-print "No .desktop files to add to database"
fi
 
+   if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
+   xdg_icon_cache_update
+   else
+   debug-print "No icon files to add to cache"
+   fi
+
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
xdg_mimeinfo_database_update
else
@@ -77,7 +88,7 @@ xdg_pkg_postinst() {
 
 # @FUNCTION: xdg_pkg_postrm
 # @DESCRIPTION:
-# Handle desktop and mime info database updates.
+# Handle desktop, icon and mime info database updates.
 xdg_pkg_postrm() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
xdg_desktop_database_update
@@ -85,6 +96,12 @@ xdg_pkg_postrm() {
debug-print "No .desktop files to add to database"
fi
 
+   if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
+   xdg_icon_cache_update
+   else
+   debug-print "No icon files to add to cache"
+   fi
+
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
xdg_mimeinfo_database_update
else
-- 
2.17.1




[gentoo-dev] [PATCH 00/10] {gnome2,xdg}{,-utils}.eclass: EAPI 7 work

2018-06-26 Thread Marty E. Plummer
Round four. I think I've finally got everything covered properly.
Flipped a lot of has ${EAPI} 6 stuff to [[ ${EAPI:-0} == [012345] ]]
negations as the former version would require adding new EAPI versions
until the end of time. This way you have a finite list of unsupported
EAPIs

Marty E. Plummer (10):
  gnome2-utils: move icon functions into xdg-utils
  gnome2.eclass: move icon handling code to xdg.eclass
  xdg-utils.eclass: make EAPI 7 ready
  gnome2-utils.eclass: make EAPI 7 ready
  xdg.eclass: make EAPI 7 ready
  gnome2.eclass: make EAPI 7 ready
  xdg-utils.eclass: enable EAPI 7
  gnome2-utils.eclass: enable EAPI 7
  xdg.eclass: enable EAPI 7
  gnome2.eclass: enable EAPI 7

 eclass/gnome2-utils.eclass | 154 +++--
 eclass/gnome2.eclass   |  23 ++
 eclass/xdg-utils.eclass|  72 +++--
 eclass/xdg.eclass  |  36 ++---
 4 files changed, 164 insertions(+), 121 deletions(-)

-- 
2.17.1




Re: [gentoo-dev] Idea for a new project: gentoo-libs

2018-06-26 Thread Marty E. Plummer
On Mon, Jun 25, 2018 at 07:59:47AM +0200, Hanno Böck wrote:
> On Fri, 22 Jun 2018 21:50:50 -0500
> "Marty E. Plummer"  wrote:
> 
> > So, as you may be aware I've been doing some work on moving bzip2 to
> > an autotools based build. Recently I've ran into app-crypt/mhash,
> > which is in a semi-abandoned state (talking with the maintainer on
> > twitter atm), and I was thinking it may be a good idea to set up a
> > project for keeping these semi-abandoned and really-abandoned
> > libraries and projects up to date and such.
> 
> This is a common problem, however if you want to make this reasonable
> you wouldn't make it a gentoo thing, but a cross-distro effort. The
> idea has been tossed around a lot, but noone yet started implementing
> it.
> 
> However keeping things alive may not always be the right option.
> There's a reason mcrypt is abandoned. It's an ancient crypto library,
mhash, not mcrypt. I've not loked at mcrypt at all yet, so I have no
ideas as to its status.
> crypto is moving forward, there are better options. THe main user of
> mcrypt was PHP, and PHP is abandoning it with 7.2. (There are 2 other
> users in the gentoo tree of libmcrypt, which are both rather obscure
> packages - nsca and elettra.)
> 
> -- 
> Hanno Böck
> https://hboeck.de/
> 
> mail/jabber: ha...@hboeck.de
> GPG: FE73757FA60E4E21B937579FA5880072BBB51E42
> 



Re: [gentoo-dev] Idea for a new project: gentoo-libs

2018-06-23 Thread Marty E. Plummer
On Sat, Jun 23, 2018 at 10:15:06AM +0200, Paweł Hajdan, Jr. wrote:
> On 23/06/2018 09:43, Mikle Kolyada wrote:
> > But how would it serve gentoo itself? Lots of packages in the distro
> > have dead upstream but still work.
> > Why would you want to make gentoo an upstream area rather than moving a
> > dead project itself, say,
> > to github and do the job there?
> 
> +1
> 
> I like the idea of taking responsibility for the abandoned packages that
> are still useful.
> 
> It's probably not Gentoo-specific, so a distro-neutral way of handling
> that seems most appropriate.
> 
> It may even be worth it to coordinate with other distros (and maybe
> downstreams) so that the new version becomes a standard.
> 
> Finally, having more than one person on this (to help continuity), and a
> common platform like GitHub also seem very helpful.
> 
> Paweł
> 
Agreed in general; the problem is getting it started at all; difficult
to get other distros to join if there is nothing to join.



Re: [gentoo-dev] Idea for a new project: gentoo-libs

2018-06-23 Thread Marty E. Plummer
On Sat, Jun 23, 2018 at 09:22:00AM +0200, Michał Górny wrote:
> W dniu pią, 22.06.2018 o godzinie 21∶50 -0500, użytkownik Marty E.
> Plummer napisał:
> > So, as you may be aware I've been doing some work on moving bzip2 to an
> > autotools based build. Recently I've ran into app-crypt/mhash, which is
> > in a semi-abandoned state (talking with the maintainer on twitter atm),
> > and I was thinking it may be a good idea to set up a project for keeping
> > these semi-abandoned and really-abandoned libraries and projects up to
> > date and such.
> > 
> > Basically, an upstream for packages who's upstream is either
> > uncontactable or is otherwise not accepting bug fixes and patches. So
> > far I can only think of app-crypt/mhash and app-arch/bzip2 but I'm sure
> > there are others in this state.
> > 
> 
> So in order to fix problem of semi-abandoned packages, you're creating
> an indirect herd-like entity that will soon be semi-abandoned itself
> because people will be dumping random packages into it and afterwards
> nobody will claim responsibility for them.
> 
> -- 
> Best regards,
> Michał Górny

No, I mean for packages which are important enough in gentoo to warrant
such treatment. For instance, every email I've tried for bzip2's
upstream bounced or recieved no reply. That, I assume, is important
enough to actually maintain and improve. Any other library which may be
as important which are as inactive would be added.



Re: [gentoo-dev] Idea for a new project: gentoo-libs

2018-06-22 Thread Marty E. Plummer
On Fri, Jun 22, 2018 at 09:50:50PM -0500, Marty E. Plummer wrote:
> So, as you may be aware I've been doing some work on moving bzip2 to an
> autotools based build. Recently I've ran into app-crypt/mhash, which is
> in a semi-abandoned state (talking with the maintainer on twitter atm),
> and I was thinking it may be a good idea to set up a project for keeping
> these semi-abandoned and really-abandoned libraries and projects up to
> date and such.
> 
> Basically, an upstream for packages who's upstream is either
> uncontactable or is otherwise not accepting bug fixes and patches. So
> far I can only think of app-crypt/mhash and app-arch/bzip2 but I'm sure
> there are others in this state.
> 
Or... call it proxy-upstream, to be in line with the current proxy-maint
setup?



[gentoo-dev] Idea for a new project: gentoo-libs

2018-06-22 Thread Marty E. Plummer
So, as you may be aware I've been doing some work on moving bzip2 to an
autotools based build. Recently I've ran into app-crypt/mhash, which is
in a semi-abandoned state (talking with the maintainer on twitter atm),
and I was thinking it may be a good idea to set up a project for keeping
these semi-abandoned and really-abandoned libraries and projects up to
date and such.

Basically, an upstream for packages who's upstream is either
uncontactable or is otherwise not accepting bug fixes and patches. So
far I can only think of app-crypt/mhash and app-arch/bzip2 but I'm sure
there are others in this state.



Re: [gentoo-dev] Re: [PATCH 3/5] toolchain.eclass: avoid leading double slash

2018-06-21 Thread Marty E. Plummer
On Thu, Jun 21, 2018 at 10:16:45AM +0200, Michael Haubenwallner wrote:
> On 06/21/2018 12:40 AM, Ulrich Mueller wrote:
> >> On Wed, 20 Jun 2018, Michael Haubenwallner wrote:
> > 
> >> Path starting with "//" is a Network path for Cygwin:
> >> As DATAPATH starts with EPREFIX, we have to use it with ${ROOT%/}.
> >> ---
> >>  eclass/toolchain.eclass | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> >> diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
> >> index a51d8e84f5e..bc3a80e0e8a 100644
> >> --- a/eclass/toolchain.eclass
> >> +++ b/eclass/toolchain.eclass
> >> @@ -2133,12 +2133,12 @@ toolchain_pkg_postinst() {
> >  
> >>mkdir -p "${EROOT}"usr/{share/gcc-data,sbin,bin}
> >># DATAPATH has EPREFIX already, use ROOT with it
> >> -  cp "${ROOT}${DATAPATH}"/fixlafiles.awk 
> >> "${EROOT}"usr/share/gcc-data/ || die
> >> -  cp "${ROOT}${DATAPATH}"/fix_libtool_files.sh 
> >> "${EROOT}"usr/sbin/ || die
> >> +  cp "${ROOT%/}${DATAPATH}"/fixlafiles.awk 
> >> "${EROOT}"usr/share/gcc-data/ || die
> >> +  cp "${ROOT%/}${DATAPATH}"/fix_libtool_files.sh 
> >> "${EROOT}"usr/sbin/ || die
> > 
> > Looks a bit short-sighted for the destinations, since EROOT lost its
> > trailing slash in EAPI 7. So better use "${EROOT%/}/" there too.
> 
> Well, DATAPATH already has the leading slash, and I have to avoid double 
> slash here.
> 
> /haubi/
> 
 -  mkdir -p "${EROOT}"usr/{share/gcc-data,sbin,bin}
 +  mkdir -p "${EROOT%/}"/usr/{share/gcc-data,sbin,bin}
# DATAPATH has EPREFIX already, use ROOT with it
 -  cp "${ROOT}${DATAPATH}"/fixlafiles.awk 
"${EROOT}"usr/share/gcc-data/ || die
 -  cp "${ROOT}${DATAPATH}"/fix_libtool_files.sh 
"${EROOT}"usr/sbin/ || die
 +  cp "${ROOT%/}${DATAPATH}"/fixlafiles.awk 
"${EROOT%/}"/usr/share/gcc-data/ || die
 +  cp "${ROOT%/}${DATAPATH}"/fix_libtool_files.sh 
"${EROOT%/}"/usr/sbin/ || die



Re: [gentoo-dev] Re: [PATCH 3/5] toolchain.eclass: avoid leading double slash

2018-06-21 Thread Marty E. Plummer
On Thu, Jun 21, 2018 at 10:16:45AM +0200, Michael Haubenwallner wrote:
> On 06/21/2018 12:40 AM, Ulrich Mueller wrote:
> >> On Wed, 20 Jun 2018, Michael Haubenwallner wrote:
> > 
> >> Path starting with "//" is a Network path for Cygwin:
> >> As DATAPATH starts with EPREFIX, we have to use it with ${ROOT%/}.
> >> ---
> >>  eclass/toolchain.eclass | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> >> diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
> >> index a51d8e84f5e..bc3a80e0e8a 100644
> >> --- a/eclass/toolchain.eclass
> >> +++ b/eclass/toolchain.eclass
> >> @@ -2133,12 +2133,12 @@ toolchain_pkg_postinst() {
> >  
> >>mkdir -p "${EROOT}"usr/{share/gcc-data,sbin,bin}
> >># DATAPATH has EPREFIX already, use ROOT with it
> >> -  cp "${ROOT}${DATAPATH}"/fixlafiles.awk 
> >> "${EROOT}"usr/share/gcc-data/ || die
> >> -  cp "${ROOT}${DATAPATH}"/fix_libtool_files.sh 
> >> "${EROOT}"usr/sbin/ || die
> >> +  cp "${ROOT%/}${DATAPATH}"/fixlafiles.awk 
> >> "${EROOT}"usr/share/gcc-data/ || die
> >> +  cp "${ROOT%/}${DATAPATH}"/fix_libtool_files.sh 
> >> "${EROOT}"usr/sbin/ || die
> > 
> > Looks a bit short-sighted for the destinations, since EROOT lost its
> > trailing slash in EAPI 7. So better use "${EROOT%/}/" there too.
> 
> Well, DATAPATH already has the leading slash, and I have to avoid double 
> slash here.
> 
> /haubi/
>
Well, still slap in the %/ to catch any extra trailing slash in ${ROOT}
itself.



[gentoo-dev] [PATCH 10/10] gnome2.eclass: enable EAPI 7

2018-06-20 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 57eafcd451b..d49a9c21baf 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -22,7 +22,7 @@ case "${EAPI:-0}" in
4|5)
EXPORT_FUNCTIONS src_unpack src_prepare src_configure 
src_compile src_install pkg_preinst pkg_postinst pkg_postrm
;;
-   6)
+   6|7)
EXPORT_FUNCTIONS src_prepare src_configure src_compile 
src_install pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
-- 
2.17.1




[gentoo-dev] [PATCH 09/10] xdg.eclass: enable EAPI 7

2018-06-20 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index bd609f3a493..01e92bc6246 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -14,7 +14,7 @@
 inherit xdg-utils
 
 case "${EAPI:-0}" in
-   4|5|6)
+   4|5|6|7)
EXPORT_FUNCTIONS src_prepare pkg_preinst pkg_postinst pkg_postrm
;;
*) die "EAPI=${EAPI} is not supported" ;;
@@ -35,7 +35,7 @@ fi
 xdg_src_prepare() {
xdg_environment_reset
 
-   has ${EAPI:-0} 6 && default
+   has ${EAPI:-0} 6 7 && default
 }
 
 # @FUNCTION: xdg_pkg_preinst
-- 
2.17.1




[gentoo-dev] [PATCH 08/10] gnome2-utils.eclass: enable EAPI 7

2018-06-20 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index b2569ce11ed..8d3359013b7 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -18,7 +18,7 @@
 inherit eutils xdg-utils
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6) ;;
+   0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -92,7 +92,7 @@ gnome2_environment_reset() {
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
 
-   if has ${EAPI:-0} 6; then
+   if has ${EAPI:-0} 6 7; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
 
-- 
2.17.1




[gentoo-dev] [PATCH 07/10] xdg-utils.eclass: enable EAPI 7

2018-06-20 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index 43c981251d9..8789570c12f 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -15,7 +15,7 @@
 #  * XDG mime information database management
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6) ;;
+   0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-- 
2.17.1




[gentoo-dev] [PATCH 06/10] gnome2.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index c4418df92bb..57eafcd451b 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -256,7 +256,7 @@ gnome2_src_install() {
# create bogus directories in /var/lib/
if has ${EAPI:-0} 4 5; then
dodir "${sk_tmp_dir}" || die "dodir failed"
-   emake DESTDIR="${D}" 
"scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install 
failed"
+   emake DESTDIR="${D}" 
"scrollkeeper_localstate_dir=${ED%/}${sk_tmp_dir} " "$@" install || die 
"install failed"
else
default
fi
@@ -282,14 +282,14 @@ gnome2_src_install() {
 
# Do not keep /var/lib/scrollkeeper because:
# 1. The scrollkeeper database is regenerated at pkg_postinst()
-   # 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current 
pkg
+   # 2. ${ED%/}/var/lib/scrollkeeper contains only indexes for the current 
pkg
#thus it makes no sense if pkg_postinst ISN'T run for some reason.
-   rm -rf "${ED}${sk_tmp_dir}"
-   rmdir "${ED}/var/lib" 2>/dev/null
-   rmdir "${ED}/var" 2>/dev/null
+   rm -rf "${ED%/}${sk_tmp_dir}"
+   rmdir "${ED%/}/var/lib" 2>/dev/null
+   rmdir "${ED%/}/var" 2>/dev/null
 
# Make sure this one doesn't get in the portage db
-   rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
+   rm -fr "${ED%/}/usr/share/applications/mimeinfo.cache"
 
# Delete all .la files
if has ${EAPI:-0} 4; then
-- 
2.17.1




[gentoo-dev] [PATCH 05/10] xdg.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
Add dev-util/desktop-file-utils and x11-misc/shared-mime-info to BDEPEND
as a number of executables which will need to be executed on the build
host are included in them.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index 2a4e1f81abf..bd609f3a493 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -26,6 +26,7 @@ DEPEND="
dev-util/desktop-file-utils
x11-misc/shared-mime-info
 "
+has ${EAPI:-0} 7 && BDEPEND="${DEPEND}"
 fi
 
 # @FUNCTION: xdg_src_prepare
-- 
2.17.1




[gentoo-dev] [PATCH 04/10] gnome2-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
Use ${EROOT%/} whereever possible, as most of the directories and files
used in conjunction with it have a leading /; add missing leading /
where apropriate.

Drop EAPI 0-2 support as no in-tree ebuilds use it to simplify the
ROOT/EROOT/BROOT logic.

Use BROOT to specify path to executable files, setting that to EROOT
when not EAPI 7

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 78 +-
 1 file changed, 44 insertions(+), 34 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 1597ac4ad08..b2569ce11ed 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -76,9 +76,6 @@ esac
 # @DESCRIPTION:
 # List of gdk-pixbuf loaders provided by the package
 
-DEPEND=">=sys-apps/sed-4"
-
-
 # @FUNCTION: gnome2_environment_reset
 # @DESCRIPTION:
 # Reset various variables inherited from root's evironment to a reasonable
@@ -110,7 +107,6 @@ gnome2_environment_reset() {
 # in the GNOME2_ECLASS_SCHEMAS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_gconf_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name 
'*.schemas' 2> /dev/null)
popd > /dev/null || die
@@ -122,8 +118,8 @@ gnome2_gconf_savelist() {
 # using gconftool-2.
 # This function should be called from pkg_postinst.
 gnome2_gconf_install() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GCONFTOOL_BIN}"
+   has ${EAPI:-0} 7 || BROOT=${EROOT}
+   local updater="${BROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -143,9 +139,9 @@ gnome2_gconf_install() {
 
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
-   if [[ -e "${EROOT}${F}" ]]; then
+   if [[ -e "${EROOT%/}${F}" ]]; then
debug-print "Installing schema: ${F}"
-   "${updater}" --makefile-install-rule "${EROOT}${F}" 
1>/dev/null
+   "${updater}" --makefile-install-rule "${EROOT%/}${F}" 
1>/dev/null
fi
done
 
@@ -163,8 +159,8 @@ gnome2_gconf_install() {
 # Removes schema files previously installed by the current ebuild from Gconf's
 # database.
 gnome2_gconf_uninstall() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GCONFTOOL_BIN}"
+   has ${EAPI:-0} 7 || BROOT=${EROOT}
+   local updater="${BROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -183,9 +179,9 @@ gnome2_gconf_uninstall() {
 
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
-   if [[ -e "${EROOT}${F}" ]]; then
+   if [[ -e "${EROOT%/}${F}" ]]; then
debug-print "Uninstalling gconf schema: ${F}"
-   "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 
1>/dev/null
+   "${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 
1>/dev/null
fi
done
 
@@ -206,7 +202,6 @@ gnome2_gconf_uninstall() {
 # gnome2_icon_cache_update conditionally.
 # This function should be called from pkg_preinst.
 gnome2_icon_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 
-mindepth 1 -type d 2> /dev/null)
popd > /dev/null || die
@@ -277,7 +272,6 @@ gnome2_omf_fix() {
 # in the GNOME2_ECLASS_SCROLLS environment variable.
 # This function should be called from pkg_preinst.
 gnome2_scrollkeeper_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
pushd "${ED}" > /dev/null || die
export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name 
"*.omf" 2> /dev/null)
popd > /dev/null || die
@@ -288,8 +282,8 @@ gnome2_scrollkeeper_savelist() {
 # Updates the global scrollkeeper database.
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_scrollkeeper_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
+   has ${EAPI:-0} 7 || BROOT=${EROOT}
+   local updater="${BROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
if [[ ! -x "${updater}" ]] ; then
debug-print "${updater} is not executable"
@@ -302,7 +296,7 @@ gnome2_scrollkeeper_update() {
fi
 
ebegin "Updating scrollkeeper database ..."
-   "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
+   "${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
eend $?
 }
 
@@ -313,7 +307,6 @@ gnome2_scrollkeeper_update() {
 # implementations that call gnome2_schemas_update conditionally.
 # This function s

[gentoo-dev] [PATCH 02/10] gnome2.eclass: move icon handling code to xdg.eclass

2018-06-20 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2.eclass |  9 +
 eclass/xdg.eclass| 31 ---
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 6db6d08b14e..c4418df92bb 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: gnome2.eclass
@@ -315,7 +315,6 @@ gnome2_src_install() {
 gnome2_pkg_preinst() {
xdg_pkg_preinst
gnome2_gconf_savelist
-   gnome2_icon_savelist
gnome2_schemas_savelist
gnome2_scrollkeeper_savelist
gnome2_gdk_pixbuf_savelist
@@ -337,9 +336,6 @@ gnome2_pkg_preinst() {
 gnome2_pkg_postinst() {
xdg_pkg_postinst
gnome2_gconf_install
-   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
-   gnome2_icon_cache_update
-   fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
@@ -361,9 +357,6 @@ gnome2_pkg_postinst() {
 # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
 gnome2_pkg_postrm() {
xdg_pkg_postrm
-   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
-   gnome2_icon_cache_update
-   fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index fd4816b8447..2a4e1f81abf 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xdg.eclass
@@ -39,9 +39,9 @@ xdg_src_prepare() {
 
 # @FUNCTION: xdg_pkg_preinst
 # @DESCRIPTION:
-# Finds .desktop and mime info files for later handling in pkg_postinst.
-# Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES
-# respectively.
+# Finds .desktop, icon and mime info files for later handling in pkg_postinst.
+# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONFILES
+# and XDG_ECLASS_MIMEINFOFILES respectively.
 xdg_pkg_preinst() {
local f
 
@@ -50,17 +50,22 @@ xdg_pkg_preinst() {
XDG_ECLASS_DESKTOPFILES+=( ${f} )
done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 
2>/dev/null)
 
+   XDG_ECLASS_ICONFILES=()
+   while IFS= read -r '' f; do
+   XDG_ECLASS_ICONFILES+=( ${f} )
+   done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 
2>/dev/null)
+
XDG_ECLASS_MIMEINFOFILES=()
while IFS= read -r -d '' f; do
XDG_ECLASS_MIMEINFOFILES+=( ${f} )
done < <(cd "${D}" && find 'usr/share/mime' -type f -print0 2>/dev/null)
 
-   export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_MIMEINFOFILES
+   export XDG_ECLASS_DESKTOPFILES XDG_ECLASS_ICONFILES 
XDG_ECLASS_MIMEINFOFILES
 }
 
 # @FUNCTION: xdg_pkg_postinst
 # @DESCRIPTION:
-# Handle desktop and mime info database updates.
+# Handle desktop, icon and mime info database updates.
 xdg_pkg_postinst() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
xdg_desktop_database_update
@@ -68,6 +73,12 @@ xdg_pkg_postinst() {
debug-print "No .desktop files to add to database"
fi
 
+   if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
+   xdg_icon_cache_update
+   else
+   debug-print "No icon files to add to cache"
+   fi
+
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
xdg_mimeinfo_database_update
else
@@ -77,7 +88,7 @@ xdg_pkg_postinst() {
 
 # @FUNCTION: xdg_pkg_postrm
 # @DESCRIPTION:
-# Handle desktop and mime info database updates.
+# Handle desktop, icon and mime info database updates.
 xdg_pkg_postrm() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
xdg_desktop_database_update
@@ -85,6 +96,12 @@ xdg_pkg_postrm() {
debug-print "No .desktop files to add to database"
fi
 
+   if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
+   xdg_icon_cache_update
+   else
+   debug-print "No icon files to add to cache"
+   fi
+
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
xdg_mimeinfo_database_update
else
-- 
2.17.1




[gentoo-dev] [PATCH 03/10] xdg-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
Use ${EROOT%/} whereever possible, as the tools and directories which
are used with it are already prefixed with a /
Use BROOT to specify path to update-mime-database and friends, setting
that to EROOT when not EAPI 7

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index f9088d9c348..43c981251d9 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -72,7 +72,8 @@ xdg_environment_reset() {
 # Updates the .desktop files database.
 # Generates a list of mimetypes linked to applications that can handle them
 xdg_desktop_database_update() {
-   local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
+   has ${EAPI:-0} 7 || BROOT=${EROOT}
+   local updater="${BROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
 
if [[ ${EBUILD_PHASE} != post* ]] ; then
die "xdg_desktop_database_update must be used in pkg_post* 
phases."
@@ -84,7 +85,7 @@ xdg_desktop_database_update() {
fi
 
ebegin "Updating .desktop files database"
-   "${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
+   "${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
eend $?
 }
 
@@ -93,8 +94,8 @@ xdg_desktop_database_update() {
 # Updates Gtk+ icon cache files under /usr/share/icons.
 # This function should be called from pkg_postinst and pkg_postrm.
 xdg_icon_cache_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
+   has ${EAPI:-0} 7 || BROOT=${EROOT}
+   local updater="${BROOT%/}${GTK_UPDATE_ICON_CACHE}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -145,7 +146,8 @@ xdg_icon_cache_update() {
 # Update the mime database.
 # Creates a general list of mime types from several sources
 xdg_mimeinfo_database_update() {
-   local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
+   has ${EAPI:-0} 7 || BROOT=${EROOT}
+   local updater="${BROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
 
if [[ ${EBUILD_PHASE} != post* ]] ; then
die "xdg_mimeinfo_database_update must be used in pkg_post* 
phases."
@@ -157,6 +159,6 @@ xdg_mimeinfo_database_update() {
fi
 
ebegin "Updating shared mime info database"
-   "${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
+   "${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
eend $?
 }
-- 
2.17.1




[gentoo-dev] [PATCH 00/10] {gnome2,xdg}{,-utils}.eclass: EAPI 7 work

2018-06-20 Thread Marty E. Plummer
Round three, hopefully this covers all the bases and all the changes
asked for in the previous iterations.

Marty E. Plummer (10):
  gnome2-utils: move icon functions into xdg-utils
  gnome2.eclass: move icon handling code to xdg.eclass
  xdg-utils.eclass: make EAPI 7 ready
  gnome2-utils.eclass: make EAPI 7 ready
  xdg.eclass: make EAPI 7 ready
  gnome2.eclass: make EAPI 7 ready
  xdg-utils.eclass: enable EAPI 7
  gnome2-utils.eclass: enable EAPI 7
  xdg.eclass: enable EAPI 7
  gnome2.eclass: enable EAPI 7

 eclass/gnome2-utils.eclass | 138 +
 eclass/gnome2.eclass   |  23 +++
 eclass/xdg-utils.eclass|  72 +--
 eclass/xdg.eclass  |  36 +++---
 4 files changed, 150 insertions(+), 119 deletions(-)

-- 
2.17.1




[gentoo-dev] [PATCH 01/10] gnome2-utils: move icon functions into xdg-utils

2018-06-20 Thread Marty E. Plummer
Kept some dummy stub functions in place in order to maintain
functionality of existing ebuilds.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 56 ++-
 eclass/xdg-utils.eclass| 60 +-
 2 files changed, 62 insertions(+), 54 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 65076ae2d61..1597ac4ad08 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: gnome2-utils.eclass
@@ -40,12 +40,6 @@ esac
 # Path to scrollkeeper-update
 : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
 
-# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
-# @INTERNAL
-# @DESCRIPTION:
-# Path to gtk-update-icon-cache
-: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
-
 # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
 # @INTERNAL
 # @DESCRIPTION:
@@ -221,53 +215,9 @@ gnome2_icon_savelist() {
 # @FUNCTION: gnome2_icon_cache_update
 # @DESCRIPTION:
 # Updates Gtk+ icon cache files under /usr/share/icons.
-# This function should be called from pkg_postinst and pkg_postrm.
+# Deprecated. Please use xdg_icon_cache_update from xdg-utils.eclass
 gnome2_icon_cache_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
-
-   if [[ ! -x "${updater}" ]] ; then
-   debug-print "${updater} is not executable"
-   return
-   fi
-
-   ebegin "Updating icons cache"
-
-   local retval=0
-   local fails=( )
-
-   for dir in "${EROOT%/}"/usr/share/icons/*
-   do
-   if [[ -f "${dir}/index.theme" ]] ; then
-   local rv=0
-
-   "${updater}" -qf "${dir}"
-   rv=$?
-
-   if [[ ! $rv -eq 0 ]] ; then
-   debug-print "Updating cache failed on ${dir}"
-
-   # Add to the list of failures
-   fails+=( "${dir}" )
-
-   retval=2
-   fi
-   elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
-   # Clear stale cache files after theme uninstallation
-   rm "${dir}/icon-theme.cache"
-   fi
-
-   if [[ -z $(ls "${dir}") ]]; then
-   # Clear empty theme directories after theme 
uninstallation
-   rmdir "${dir}"
-   fi
-   done
-
-   eend ${retval}
-
-   for f in "${fails[@]}" ; do
-   eerror "Failed to update cache with icon $f"
-   done
+   xdg_icon_cache_update
 }
 
 # @FUNCTION: gnome2_omf_fix
diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index ac075185d8e..f9088d9c348 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xdg-utils.eclass
@@ -31,6 +31,12 @@ esac
 # Directory where .desktop files database is stored
 : ${DESKTOP_DATABASE_DIR="/usr/share/applications"}
 
+# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
+# @INTERNAL
+# @DESCRIPTION:
+# Path to gtk-update-icon-cache
+: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
+
 # @ECLASS-VARIABLE: MIMEINFO_DATABASE_UPDATE_BIN
 # @INTERNAL
 # @DESCRIPTION:
@@ -82,6 +88,58 @@ xdg_desktop_database_update() {
eend $?
 }
 
+# @FUNCTION: xdg_icon_cache_update
+# @DESCRIPTION:
+# Updates Gtk+ icon cache files under /usr/share/icons.
+# This function should be called from pkg_postinst and pkg_postrm.
+xdg_icon_cache_update() {
+   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
+   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
+
+   if [[ ! -x "${updater}" ]]; then
+   debug-print "${updater} is not executable"
+   return
+   fi
+
+   ebegin "Updating icons cache"
+
+   local retval=0
+   local fails=( )
+
+   for dir in "${EROOT%/}"/usr/share/icons/*
+   do
+   if [[ -f "${dir}/index.theme" ]] ; then
+   local rv=0
+
+   "${updater}" -qf "${dir}"
+   rv=$?
+
+   if [[ ! $rv -eq 0 ]] ; then
+   debug-print "Updating cache failed on ${dir}"
+
+   # Add to the list of failures
+   fails+=( "${dir}" )
+
+   retval=2
+   fi
+   elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
+   # Clear stale cache files after theme uninstallation
+

Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
On Thu, Jun 21, 2018 at 03:41:02AM +0100, M. J. Everitt wrote:
> On 21/06/18 03:38, Jason Zaman wrote:
> > On Wed, Jun 20, 2018 at 06:01:10PM -0500, Marty E. Plummer wrote:
> >> On Wed, Jun 20, 2018 at 11:33:53PM +0100, James Le Cuirot wrote:
> >>> On Wed, 20 Jun 2018 17:21:09 -0500
> >>> "Marty E. Plummer"  wrote:
> >>>
> >>>> On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
> >>>>> On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:  
> >>>>>> Use ${EROOT%/} whereever possible, as the tools and directories which
> >>>>>> are used with it are already prefixed with a /
> >>>>>>
> >>>>>> Package-Manager: Portage-2.3.40, Repoman-2.3.9
> >>>>>> ---
> >>>>>>  eclass/xdg-utils.eclass | 10 +-
> >>>>>>  1 file changed, 5 insertions(+), 5 deletions(-)
> >>>>>>
> >>>>>> diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> >>>>>> index ac075185d8e..8dba5ed6861 100644
> >>>>>> --- a/eclass/xdg-utils.eclass
> >>>>>> +++ b/eclass/xdg-utils.eclass
> >>>>>> @@ -66,7 +66,7 @@ xdg_environment_reset() {
> >>>>>>  # Updates the .desktop files database.
> >>>>>>  # Generates a list of mimetypes linked to applications that can 
> >>>>>> handle them
> >>>>>>  xdg_desktop_database_update() {
> >>>>>> -  local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> >>>>>> +  local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"  
> >>>>> Shouldn't things like this be $BROOT since they're being run? $EROOT
> >>>>> might be a different architecture that may or may not run at all on the
> >>>>> build machine.
> >>>>>   
> >>>> Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
> >>>> we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
> >>>> that may be a use case that got missed in the EAPI 7 discussions.
> >>> BROOT is already prefixed as BROOT without a prefix would just be /.
> >>>
> >> I don't follow. Its my understanding that BROOT ~= ROOT for most
> >> situations. But consider this setup:
> >> Ubuntu amd64 with Gentoo Prefix, emerging a native arm @system to
> >> /mnt/arm EPREFIX = /home/user/gentoo.
> >>
> >> In this situation, ROOT=/mnt/arm, EROOT=/mnt/arm, but what is BROOT? /,
> >> or /home/usr/gentoo?
> > https://dev.gentoo.org/~mgorny/articles/the-ultimate-guide-to-eapi-7.html#broot-variable-for-bdepend
> >
> > Basically BROOT already contains EPREFIX or BPREFIX or whatever it would
> > be called. There is like no need for an un-prefixed BROOT so its just
> > merged in. so you should just need "${BROOT}/usr/bin/update-mime-database"
> >
> > -- Jason
> >
> >>> -- 
> >>> James Le Cuirot (chewi)
> >>> Gentoo Linux Developer
> >>
> >>
> Obligatory n00b question .. how does this work in EAPI <= 6 ?! :D
> 
I would guess something like has eapi 7 || ROOT = BROOT or whatever. Use
BROOT by default and if the EAPI doesn't support it set ROOT to BROOT or
somat.





Re: [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
On Wed, Jun 20, 2018 at 09:25:30AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> Plummer napisał:
> > Use ${EROOT%/} whereever possible, as most of the directories and files
> > used in conjunction with it have a leading /; add missing leading /
> > where apropriate.
> > 
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/gnome2-utils.eclass | 41 ++
> >  1 file changed, 19 insertions(+), 22 deletions(-)
> > 
> > diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> > index 65076ae2d61..14fb9e7420c 100644
> > --- a/eclass/gnome2-utils.eclass
> > +++ b/eclass/gnome2-utils.eclass
> > @@ -18,7 +18,7 @@
> >  inherit eutils xdg-utils
> >  
> >  case "${EAPI:-0}" in
> > -   0|1|2|3|4|5|6) ;;
> > +   0|1|2|3|4|5|6|7) ;;
> > *) die "EAPI=${EAPI} is not supported" ;;
> >  esac
> >  
> > @@ -82,9 +82,6 @@ esac
> >  # @DESCRIPTION:
> >  # List of gdk-pixbuf loaders provided by the package
> >  
> > -DEPEND=">=sys-apps/sed-4"
> > -
> > -
> >  # @FUNCTION: gnome2_environment_reset
> >  # @DESCRIPTION:
> >  # Reset various variables inherited from root's evironment to a reasonable
> > @@ -101,7 +98,7 @@ gnome2_environment_reset() {
> > # Ensure we don't rely on dconf/gconf while building, bug #511946
> > export GSETTINGS_BACKEND="memory"
> >  
> > -   if has ${EAPI:-0} 6; then
> > +   if has ${EAPI:-0} 6 7; then
> > # Try to cover the packages honoring this variable, bug #508124
> > export GST_INSPECT="$(type -P true)"
> >  
> > @@ -129,7 +126,7 @@ gnome2_gconf_savelist() {
> >  # This function should be called from pkg_postinst.
> >  gnome2_gconf_install() {
> > has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -   local updater="${EROOT}${GCONFTOOL_BIN}"
> > +   local updater="${EROOT%/}${GCONFTOOL_BIN}"
> >  
> > if [[ ! -x "${updater}" ]]; then
> > debug-print "${updater} is not executable"
> > @@ -149,9 +146,9 @@ gnome2_gconf_install() {
> >  
> > local F
> > for F in ${GNOME2_ECLASS_SCHEMAS}; do
> > -   if [[ -e "${EROOT}${F}" ]]; then
> > +   if [[ -e "${EROOT%/}${F}" ]]; then
> > debug-print "Installing schema: ${F}"
> > -   "${updater}" --makefile-install-rule "${EROOT}${F}" 
> > 1>/dev/null
> > +   "${updater}" --makefile-install-rule "${EROOT%/}${F}" 
> > 1>/dev/null
> > fi
> > done
> >  
> > @@ -170,7 +167,7 @@ gnome2_gconf_install() {
> >  # database.
> >  gnome2_gconf_uninstall() {
> > has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -   local updater="${EROOT}${GCONFTOOL_BIN}"
> > +   local updater="${EROOT%/}${GCONFTOOL_BIN}"
> >  
> > if [[ ! -x "${updater}" ]]; then
> > debug-print "${updater} is not executable"
> > @@ -189,9 +186,9 @@ gnome2_gconf_uninstall() {
> >  
> > local F
> > for F in ${GNOME2_ECLASS_SCHEMAS}; do
> > -   if [[ -e "${EROOT}${F}" ]]; then
> > +   if [[ -e "${EROOT%/}${F}" ]]; then
> > debug-print "Uninstalling gconf schema: ${F}"
> > -   "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 
> > 1>/dev/null
> > +   "${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 
> > 1>/dev/null
> > fi
> > done
> >  
> > @@ -224,7 +221,7 @@ gnome2_icon_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_icon_cache_update() {
> > has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -   local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
> > +   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> >  
> > if [[ ! -x "${updater}" ]] ; then
> > debug-print "${updater} is not executable"
> > @@ -339,7 +336,7 @@ gnome2_scrollkeeper_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_scroll

Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
On Wed, Jun 20, 2018 at 11:33:53PM +0100, James Le Cuirot wrote:
> On Wed, 20 Jun 2018 17:21:09 -0500
> "Marty E. Plummer"  wrote:
> 
> > On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
> > > On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:  
> > > > Use ${EROOT%/} whereever possible, as the tools and directories which
> > > > are used with it are already prefixed with a /
> > > > 
> > > > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > > > ---
> > > >  eclass/xdg-utils.eclass | 10 +-
> > > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > > 
> > > > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> > > > index ac075185d8e..8dba5ed6861 100644
> > > > --- a/eclass/xdg-utils.eclass
> > > > +++ b/eclass/xdg-utils.eclass
> > > > @@ -66,7 +66,7 @@ xdg_environment_reset() {
> > > >  # Updates the .desktop files database.
> > > >  # Generates a list of mimetypes linked to applications that can handle 
> > > > them
> > > >  xdg_desktop_database_update() {
> > > > -   local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> > > > +   local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"  
> > > 
> > > Shouldn't things like this be $BROOT since they're being run? $EROOT
> > > might be a different architecture that may or may not run at all on the
> > > build machine.
> > >   
> > Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
> > we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
> > that may be a use case that got missed in the EAPI 7 discussions.
> 
> BROOT is already prefixed as BROOT without a prefix would just be /.
> 
I don't follow. Its my understanding that BROOT ~= ROOT for most
situations. But consider this setup:
Ubuntu amd64 with Gentoo Prefix, emerging a native arm @system to
/mnt/arm EPREFIX = /home/user/gentoo.

In this situation, ROOT=/mnt/arm, EROOT=/mnt/arm, but what is BROOT? /,
or /home/usr/gentoo?
> -- 
> James Le Cuirot (chewi)
> Gentoo Linux Developer





Re: [gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
On Wed, Jun 20, 2018 at 09:03:44PM +0800, Jason Zaman wrote:
> On Wed, Jun 20, 2018 at 02:10:50AM -0500, Marty E. Plummer wrote:
> > Use ${EROOT%/} whereever possible, as the tools and directories which
> > are used with it are already prefixed with a /
> > 
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/xdg-utils.eclass | 10 +-
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
> > index ac075185d8e..8dba5ed6861 100644
> > --- a/eclass/xdg-utils.eclass
> > +++ b/eclass/xdg-utils.eclass
> > @@ -15,7 +15,7 @@
> >  #  * XDG mime information database management
> >  
> >  case "${EAPI:-0}" in
> > -   0|1|2|3|4|5|6) ;;
> > +   0|1|2|3|4|5|6|7) ;;
> > *) die "EAPI=${EAPI} is not supported" ;;
> >  esac
> >  
> > @@ -66,7 +66,7 @@ xdg_environment_reset() {
> >  # Updates the .desktop files database.
> >  # Generates a list of mimetypes linked to applications that can handle them
> >  xdg_desktop_database_update() {
> > -   local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
> > +   local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
> 
> Shouldn't things like this be $BROOT since they're being run? $EROOT
> might be a different architecture that may or may not run at all on the
> build machine.
> 
Good point, but here's a question; if EROOT=${ROOT%/}${EPREFIX}, how do
we use BROOT here? EBROOT? Or longhand ${BROOT%/}${EPREFIX} ? I think
that may be a use case that got missed in the EAPI 7 discussions.
> -- Jason
> 
> > if [[ ${EBUILD_PHASE} != post* ]] ; then
> > die "xdg_desktop_database_update must be used in pkg_post* 
> > phases."
> > @@ -78,7 +78,7 @@ xdg_desktop_database_update() {
> > fi
> >  
> > ebegin "Updating .desktop files database"
> > -   "${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
> > +   "${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
> > eend $?
> >  }
> >  
> > @@ -87,7 +87,7 @@ xdg_desktop_database_update() {
> >  # Update the mime database.
> >  # Creates a general list of mime types from several sources
> >  xdg_mimeinfo_database_update() {
> > -   local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
> > +   local updater="${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
> >  
> > if [[ ${EBUILD_PHASE} != post* ]] ; then
> > die "xdg_mimeinfo_database_update must be used in pkg_post* 
> > phases."
> > @@ -99,6 +99,6 @@ xdg_mimeinfo_database_update() {
> > fi
> >  
> > ebegin "Updating shared mime info database"
> > -   "${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
> > +   "${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
> > eend $?
> >  }
> > -- 
> > 2.17.1
> > 
> > 



Re: [gentoo-dev] [PATCH 1/5] toolchain.eclass: ROOT->EROOT at looking for gcc specs file

2018-06-20 Thread Marty E. Plummer
On Wed, Jun 20, 2018 at 07:49:01PM +0200, Michael Haubenwallner wrote:
> ---
>  eclass/toolchain.eclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
> index 68e4ce15b37..fe41a80db28 100644
> --- a/eclass/toolchain.eclass
> +++ b/eclass/toolchain.eclass
> @@ -2207,7 +2207,7 @@ do_gcc_config() {
>   [[ -n ${current_specs} ]] && use_specs=-${current_specs}
>  
>   if [[ -n ${use_specs} ]] && \
> -[[ ! -e 
> ${ROOT}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]]
> +[[ ! -e 
> ${EROOT}etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]]
${EROOT%/}/etc... would be more portable, correct? Not all EAPI have no
trailing /.
>   then
>   ewarn "The currently selected specs-specific gcc 
> config,"
>   ewarn "${current_specs}, doesn't exist anymore. This is 
> usually"
> -- 
> 2.16.1
> 
> 



Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass

2018-06-20 Thread Marty E. Plummer
On Wed, Jun 20, 2018 at 11:19:29AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 04∶04 -0500, użytkownik Marty E.
> Plummer napisał:
> > On Wed, Jun 20, 2018 at 09:27:54AM +0200, Michał Górny wrote:
> > > W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> > > Plummer napisał:
> > > > ---
> > > >  eclass/gnome2.eclass |  7 ---
> > > >  eclass/xdg.eclass| 27 ++-
> > > >  2 files changed, 22 insertions(+), 12 deletions(-)
> > > > 
> > > > diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
> > > > index 6db6d08b14e..5b81cb4f01a 100644
> > > > --- a/eclass/gnome2.eclass
> > > > +++ b/eclass/gnome2.eclass
> > > > @@ -315,7 +315,6 @@ gnome2_src_install() {
> > > >  gnome2_pkg_preinst() {
> > > > xdg_pkg_preinst
> > > > gnome2_gconf_savelist
> > > > -   gnome2_icon_savelist
> > > > gnome2_schemas_savelist
> > > > gnome2_scrollkeeper_savelist
> > > > gnome2_gdk_pixbuf_savelist
> > > > @@ -337,9 +336,6 @@ gnome2_pkg_preinst() {
> > > >  gnome2_pkg_postinst() {
> > > > xdg_pkg_postinst
> > > > gnome2_gconf_install
> > > > -   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
> > > > -   gnome2_icon_cache_update
> > > > -   fi
> > > > if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
> > > > gnome2_schemas_update
> > > > fi
> > > > @@ -361,9 +357,6 @@ gnome2_pkg_postinst() {
> > > >  # Handle scrollkeeper, GSettings, Icons, desktop and mime database 
> > > > updates.
> > > >  gnome2_pkg_postrm() {
> > > > xdg_pkg_postrm
> > > > -   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
> > > > -   gnome2_icon_cache_update
> > > > -   fi
> > > > if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
> > > > gnome2_schemas_update
> > > > fi
> > > > diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
> > > > index fd4816b8447..29830a5ee15 100644
> > > > --- a/eclass/xdg.eclass
> > > > +++ b/eclass/xdg.eclass
> > > > @@ -39,9 +39,9 @@ xdg_src_prepare() {
> > > >  
> > > >  # @FUNCTION: xdg_pkg_preinst
> > > >  # @DESCRIPTION:
> > > > -# Finds .desktop and mime info files for later handling in 
> > > > pkg_postinst.
> > > > -# Locations are stored in XDG_ECLASS_DESKTOPFILES and 
> > > > XDG_ECLASS_MIMEINFOFILES
> > > > -# respectively.
> > > > +# Finds .desktop, icon, and mime info files for later handling in 
> > > > pkg_postinst.
> > > > +# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONS and
> > > > +# XDG_ECLASS_MIMEINFOFILES respectively.
> > > >  xdg_pkg_preinst() {
> > > > local f
> > > >  
> > > > @@ -50,6 +50,11 @@ xdg_pkg_preinst() {
> > > > XDG_ECLASS_DESKTOPFILES+=( ${f} )
> > > > done < <(cd "${D}" && find 'usr/share/applications' -type f 
> > > > -print0 2>/dev/null)
> > > >  
> > > > +   XDG_ECLASS_ICONS=()
> > > > +   while IFS= read -r -d '' f; do
> > > > +   XDG_ECLASS_ICONS+=( ${f} )
> > > > +   done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 
> > > > 2>/dev/null)
> > > 
> > > If you inline it anyway, why add xdg_*_savelist for it?
> > > 
> > 
> > Too keep a stub that still 'works' for ebuilds using
> > gnome2_icon_savelist from gnome2-utils.eclass.
> > > > +
> 
> But given it's unnecessary... you could also keep the stub in gnome2-
> utils and not introduce additional unnecessary stub.
>
Fair. Given that, should I allow the stub to keep working in EAPI 7,
then?
> -- 
> Best regards,
> Michał Górny





Re: [gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass

2018-06-20 Thread Marty E. Plummer
On Wed, Jun 20, 2018 at 09:27:54AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> Plummer napisał:
> > ---
> >  eclass/gnome2.eclass |  7 ---
> >  eclass/xdg.eclass| 27 ++-
> >  2 files changed, 22 insertions(+), 12 deletions(-)
> > 
> > diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
> > index 6db6d08b14e..5b81cb4f01a 100644
> > --- a/eclass/gnome2.eclass
> > +++ b/eclass/gnome2.eclass
> > @@ -315,7 +315,6 @@ gnome2_src_install() {
> >  gnome2_pkg_preinst() {
> > xdg_pkg_preinst
> > gnome2_gconf_savelist
> > -   gnome2_icon_savelist
> > gnome2_schemas_savelist
> > gnome2_scrollkeeper_savelist
> > gnome2_gdk_pixbuf_savelist
> > @@ -337,9 +336,6 @@ gnome2_pkg_preinst() {
> >  gnome2_pkg_postinst() {
> > xdg_pkg_postinst
> > gnome2_gconf_install
> > -   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
> > -   gnome2_icon_cache_update
> > -   fi
> > if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
> > gnome2_schemas_update
> > fi
> > @@ -361,9 +357,6 @@ gnome2_pkg_postinst() {
> >  # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
> >  gnome2_pkg_postrm() {
> > xdg_pkg_postrm
> > -   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
> > -   gnome2_icon_cache_update
> > -   fi
> > if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
> > gnome2_schemas_update
> > fi
> > diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
> > index fd4816b8447..29830a5ee15 100644
> > --- a/eclass/xdg.eclass
> > +++ b/eclass/xdg.eclass
> > @@ -39,9 +39,9 @@ xdg_src_prepare() {
> >  
> >  # @FUNCTION: xdg_pkg_preinst
> >  # @DESCRIPTION:
> > -# Finds .desktop and mime info files for later handling in pkg_postinst.
> > -# Locations are stored in XDG_ECLASS_DESKTOPFILES and 
> > XDG_ECLASS_MIMEINFOFILES
> > -# respectively.
> > +# Finds .desktop, icon, and mime info files for later handling in 
> > pkg_postinst.
> > +# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONS and
> > +# XDG_ECLASS_MIMEINFOFILES respectively.
> >  xdg_pkg_preinst() {
> > local f
> >  
> > @@ -50,6 +50,11 @@ xdg_pkg_preinst() {
> > XDG_ECLASS_DESKTOPFILES+=( ${f} )
> > done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 
> > 2>/dev/null)
> >  
> > +   XDG_ECLASS_ICONS=()
> > +   while IFS= read -r -d '' f; do
> > +   XDG_ECLASS_ICONS+=( ${f} )
> > +   done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 
> > 2>/dev/null)
> 
> If you inline it anyway, why add xdg_*_savelist for it?
> 
Too keep a stub that still 'works' for ebuilds using
gnome2_icon_savelist from gnome2-utils.eclass.
> > +
> > XDG_ECLASS_MIMEINFOFILES=()
> > while IFS= read -r -d '' f; do
> > XDG_ECLASS_MIMEINFOFILES+=( ${f} )
> > @@ -60,7 +65,7 @@ xdg_pkg_preinst() {
> >  
> >  # @FUNCTION: xdg_pkg_postinst
> >  # @DESCRIPTION:
> > -# Handle desktop and mime info database updates.
> > +# Handle desktop, icon and mime info database updates.
> >  xdg_pkg_postinst() {
> > if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
> > xdg_desktop_database_update
> > @@ -68,6 +73,12 @@ xdg_pkg_postinst() {
> > debug-print "No .desktop files to add to database"
> > fi
> >  
> > +   if [[ ${#XDG_ECLASS_ICONS[@]} -gt 0 ]]; then
> > +   xdg_icon_cache_update
> > +   else
> > +   debug-print "No icon files to add to database"
> > +   fi
> > +
> > if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
> > xdg_mimeinfo_database_update
> > else
> > @@ -77,7 +88,7 @@ xdg_pkg_postinst() {
> >  
> >  # @FUNCTION: xdg_pkg_postrm
> >  # @DESCRIPTION:
> > -# Handle desktop and mime info database updates.
> > +# Handle desktop, icon and mime info database updates.
> >  xdg_pkg_postrm() {
> > if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
> > xdg_desktop_database_update
> > @@ -85,6 +96,12 @@ xdg_pkg_postrm() {
> > debug-print "No .desktop files to add to database"
> > fi
> >  
> > +   if [[ ${#XDG_ECLASS_ICONS[@]} -gt 0 ]]; then
> > +   xdg_icon_cache_update
> > +   else
> > +   debug-print "No icon files to add to database"
> > +   fi
> > +
> > if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
> > xdg_mimeinfo_database_update
> > else
> 
> -- 
> Best regards,
> Michał Górny





Re: [gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils

2018-06-20 Thread Marty E. Plummer
On Wed, Jun 20, 2018 at 09:27:01AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> Plummer napisał:
> > Kept some dummy stub functions in place in order to maintain
> > functionality of existing ebuilds, along with a QA warning to migrate
> > from one eclass to the other.
> > ---
> >  eclass/gnome2-utils.eclass | 73 ++
> >  eclass/xdg-utils.eclass| 80 ++
> >  2 files changed, 91 insertions(+), 62 deletions(-)
> > 
> > diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> > index 14fb9e7420c..a355f0f4f13 100644
> > --- a/eclass/gnome2-utils.eclass
> > +++ b/eclass/gnome2-utils.eclass
> > @@ -40,12 +40,6 @@ esac
> >  # Path to scrollkeeper-update
> >  : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
> >  
> > -# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
> > -# @INTERNAL
> > -# @DESCRIPTION:
> > -# Path to gtk-update-icon-cache
> > -: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
> > -
> >  # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
> >  # @INTERNAL
> >  # @DESCRIPTION:
> > @@ -203,68 +197,23 @@ gnome2_gconf_uninstall() {
> >  
> >  # @FUNCTION: gnome2_icon_savelist
> >  # @DESCRIPTION:
> > -# Find the icons that are about to be installed and save their location
> > -# in the GNOME2_ECLASS_ICONS environment variable. This is only
> > -# necessary for eclass implementations that call
> > -# gnome2_icon_cache_update conditionally.
> > -# This function should be called from pkg_preinst.
> > +# Deprecated. Use xdg_icon_savelist from xdg-utils.eclass instead.
> >  gnome2_icon_savelist() {
> > -   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
> > -   pushd "${ED}" > /dev/null || die
> > -   export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 
> > -mindepth 1 -type d 2> /dev/null)
> > -   popd > /dev/null || die
> > +   eqawarn "QA warning: gnome2_icon_savelist has been moved to 
> > xdg-utils.eclass"
> > +   eqawarn "and is now called xdg_icon_savelist. Please migrate your 
> > ebuild and"
> > +   eqawarn "eclasses to use it"
> > +   xdg_icon_savelist
> > +   GNOME2_ECLASS_ICONS="${XDG_ECLASS_ICONS}"
> >  }
> >  
> >  # @FUNCTION: gnome2_icon_cache_update
> >  # @DESCRIPTION:
> > -# Updates Gtk+ icon cache files under /usr/share/icons.
> > -# This function should be called from pkg_postinst and pkg_postrm.
> > +# Deprecated. Use xdg_icon_cache_update from xdg-utils.eclass instead.
> >  gnome2_icon_cache_update() {
> > -   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> > -
> > -   if [[ ! -x "${updater}" ]] ; then
> > -   debug-print "${updater} is not executable"
> > -   return
> > -   fi
> > -
> > -   ebegin "Updating icons cache"
> > -
> > -   local retval=0
> > -   local fails=( )
> > -
> > -   for dir in "${EROOT%/}"/usr/share/icons/*
> > -   do
> > -   if [[ -f "${dir}/index.theme" ]] ; then
> > -   local rv=0
> > -
> > -   "${updater}" -qf "${dir}"
> > -   rv=$?
> > -
> > -   if [[ ! $rv -eq 0 ]] ; then
> > -   debug-print "Updating cache failed on ${dir}"
> > -
> > -   # Add to the list of failures
> > -   fails+=( "${dir}" )
> > -
> > -   retval=2
> > -   fi
> > -   elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
> > -   # Clear stale cache files after theme uninstallation
> > -   rm "${dir}/icon-theme.cache"
> > -   fi
> > -
> > -   if [[ -z $(ls "${dir}") ]]; then
> > -   # Clear empty theme directories after theme 
> > uninstallation
> > -   rmdir "${dir}"
> > -   fi
> > -   done
> > -
> > -   eend ${retval}
> > -
> > -   for f in "${fails[@]}" ; do
> > -   eerror "Failed to update cache with icon $f"
> > -   done
> > +   eqawarn &q

Re: [gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
On Wed, Jun 20, 2018 at 09:25:30AM +0200, Michał Górny wrote:
> W dniu śro, 20.06.2018 o godzinie 02∶10 -0500, użytkownik Marty E.
> Plummer napisał:
> > Use ${EROOT%/} whereever possible, as most of the directories and files
> > used in conjunction with it have a leading /; add missing leading /
> > where apropriate.
> > 
> > Package-Manager: Portage-2.3.40, Repoman-2.3.9
> > ---
> >  eclass/gnome2-utils.eclass | 41 ++
> >  1 file changed, 19 insertions(+), 22 deletions(-)
> > 
> > diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
> > index 65076ae2d61..14fb9e7420c 100644
> > --- a/eclass/gnome2-utils.eclass
> > +++ b/eclass/gnome2-utils.eclass
> > @@ -18,7 +18,7 @@
> >  inherit eutils xdg-utils
> >  
> >  case "${EAPI:-0}" in
> > -   0|1|2|3|4|5|6) ;;
> > +   0|1|2|3|4|5|6|7) ;;
> > *) die "EAPI=${EAPI} is not supported" ;;
> >  esac
> >  
> > @@ -82,9 +82,6 @@ esac
> >  # @DESCRIPTION:
> >  # List of gdk-pixbuf loaders provided by the package
> >  
> > -DEPEND=">=sys-apps/sed-4"
> > -
> > -
> >  # @FUNCTION: gnome2_environment_reset
> >  # @DESCRIPTION:
> >  # Reset various variables inherited from root's evironment to a reasonable
> > @@ -101,7 +98,7 @@ gnome2_environment_reset() {
> > # Ensure we don't rely on dconf/gconf while building, bug #511946
> > export GSETTINGS_BACKEND="memory"
> >  
> > -   if has ${EAPI:-0} 6; then
> > +   if has ${EAPI:-0} 6 7; then
> > # Try to cover the packages honoring this variable, bug #508124
> > export GST_INSPECT="$(type -P true)"
> >  
> > @@ -129,7 +126,7 @@ gnome2_gconf_savelist() {
> >  # This function should be called from pkg_postinst.
> >  gnome2_gconf_install() {
> > has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -   local updater="${EROOT}${GCONFTOOL_BIN}"
> > +   local updater="${EROOT%/}${GCONFTOOL_BIN}"
> >  
> > if [[ ! -x "${updater}" ]]; then
> > debug-print "${updater} is not executable"
> > @@ -149,9 +146,9 @@ gnome2_gconf_install() {
> >  
> > local F
> > for F in ${GNOME2_ECLASS_SCHEMAS}; do
> > -   if [[ -e "${EROOT}${F}" ]]; then
> > +   if [[ -e "${EROOT%/}${F}" ]]; then
> > debug-print "Installing schema: ${F}"
> > -   "${updater}" --makefile-install-rule "${EROOT}${F}" 
> > 1>/dev/null
> > +   "${updater}" --makefile-install-rule "${EROOT%/}${F}" 
> > 1>/dev/null
> > fi
> > done
> >  
> > @@ -170,7 +167,7 @@ gnome2_gconf_install() {
> >  # database.
> >  gnome2_gconf_uninstall() {
> > has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -   local updater="${EROOT}${GCONFTOOL_BIN}"
> > +   local updater="${EROOT%/}${GCONFTOOL_BIN}"
> >  
> > if [[ ! -x "${updater}" ]]; then
> > debug-print "${updater} is not executable"
> > @@ -189,9 +186,9 @@ gnome2_gconf_uninstall() {
> >  
> > local F
> > for F in ${GNOME2_ECLASS_SCHEMAS}; do
> > -   if [[ -e "${EROOT}${F}" ]]; then
> > +   if [[ -e "${EROOT%/}${F}" ]]; then
> > debug-print "Uninstalling gconf schema: ${F}"
> > -   "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 
> > 1>/dev/null
> > +   "${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 
> > 1>/dev/null
> > fi
> > done
> >  
> > @@ -224,7 +221,7 @@ gnome2_icon_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_icon_cache_update() {
> > has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > -   local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
> > +   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
> >  
> > if [[ ! -x "${updater}" ]] ; then
> > debug-print "${updater} is not executable"
> > @@ -339,7 +336,7 @@ gnome2_scrollkeeper_savelist() {
> >  # This function should be called from pkg_postinst and pkg_postrm.
> >  gnome2_scroll

[gentoo-dev] [PATCH 4/4] gnome2.eclass: move icon handling code to xdg.eclass

2018-06-20 Thread Marty E. Plummer
---
 eclass/gnome2.eclass |  7 ---
 eclass/xdg.eclass| 27 ++-
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 6db6d08b14e..5b81cb4f01a 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -315,7 +315,6 @@ gnome2_src_install() {
 gnome2_pkg_preinst() {
xdg_pkg_preinst
gnome2_gconf_savelist
-   gnome2_icon_savelist
gnome2_schemas_savelist
gnome2_scrollkeeper_savelist
gnome2_gdk_pixbuf_savelist
@@ -337,9 +336,6 @@ gnome2_pkg_preinst() {
 gnome2_pkg_postinst() {
xdg_pkg_postinst
gnome2_gconf_install
-   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
-   gnome2_icon_cache_update
-   fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
@@ -361,9 +357,6 @@ gnome2_pkg_postinst() {
 # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
 gnome2_pkg_postrm() {
xdg_pkg_postrm
-   if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
-   gnome2_icon_cache_update
-   fi
if [[ -n ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
gnome2_schemas_update
fi
diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index fd4816b8447..29830a5ee15 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -39,9 +39,9 @@ xdg_src_prepare() {
 
 # @FUNCTION: xdg_pkg_preinst
 # @DESCRIPTION:
-# Finds .desktop and mime info files for later handling in pkg_postinst.
-# Locations are stored in XDG_ECLASS_DESKTOPFILES and XDG_ECLASS_MIMEINFOFILES
-# respectively.
+# Finds .desktop, icon, and mime info files for later handling in pkg_postinst.
+# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONS and
+# XDG_ECLASS_MIMEINFOFILES respectively.
 xdg_pkg_preinst() {
local f
 
@@ -50,6 +50,11 @@ xdg_pkg_preinst() {
XDG_ECLASS_DESKTOPFILES+=( ${f} )
done < <(cd "${D}" && find 'usr/share/applications' -type f -print0 
2>/dev/null)
 
+   XDG_ECLASS_ICONS=()
+   while IFS= read -r -d '' f; do
+   XDG_ECLASS_ICONS+=( ${f} )
+   done < <(cd "${D}" && find 'usr/share/icons' -type f -print0 
2>/dev/null)
+
XDG_ECLASS_MIMEINFOFILES=()
while IFS= read -r -d '' f; do
XDG_ECLASS_MIMEINFOFILES+=( ${f} )
@@ -60,7 +65,7 @@ xdg_pkg_preinst() {
 
 # @FUNCTION: xdg_pkg_postinst
 # @DESCRIPTION:
-# Handle desktop and mime info database updates.
+# Handle desktop, icon and mime info database updates.
 xdg_pkg_postinst() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
xdg_desktop_database_update
@@ -68,6 +73,12 @@ xdg_pkg_postinst() {
debug-print "No .desktop files to add to database"
fi
 
+   if [[ ${#XDG_ECLASS_ICONS[@]} -gt 0 ]]; then
+   xdg_icon_cache_update
+   else
+   debug-print "No icon files to add to database"
+   fi
+
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
xdg_mimeinfo_database_update
else
@@ -77,7 +88,7 @@ xdg_pkg_postinst() {
 
 # @FUNCTION: xdg_pkg_postrm
 # @DESCRIPTION:
-# Handle desktop and mime info database updates.
+# Handle desktop, icon and mime info database updates.
 xdg_pkg_postrm() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
xdg_desktop_database_update
@@ -85,6 +96,12 @@ xdg_pkg_postrm() {
debug-print "No .desktop files to add to database"
fi
 
+   if [[ ${#XDG_ECLASS_ICONS[@]} -gt 0 ]]; then
+   xdg_icon_cache_update
+   else
+   debug-print "No icon files to add to database"
+   fi
+
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
xdg_mimeinfo_database_update
else
-- 
2.17.1




[gentoo-dev] [PATCH 3/4] gnome2-utils: move icon functions into xdg-utils

2018-06-20 Thread Marty E. Plummer
Kept some dummy stub functions in place in order to maintain
functionality of existing ebuilds, along with a QA warning to migrate
from one eclass to the other.
---
 eclass/gnome2-utils.eclass | 73 ++
 eclass/xdg-utils.eclass| 80 ++
 2 files changed, 91 insertions(+), 62 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 14fb9e7420c..a355f0f4f13 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -40,12 +40,6 @@ esac
 # Path to scrollkeeper-update
 : ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
 
-# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
-# @INTERNAL
-# @DESCRIPTION:
-# Path to gtk-update-icon-cache
-: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
-
 # @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
 # @INTERNAL
 # @DESCRIPTION:
@@ -203,68 +197,23 @@ gnome2_gconf_uninstall() {
 
 # @FUNCTION: gnome2_icon_savelist
 # @DESCRIPTION:
-# Find the icons that are about to be installed and save their location
-# in the GNOME2_ECLASS_ICONS environment variable. This is only
-# necessary for eclass implementations that call
-# gnome2_icon_cache_update conditionally.
-# This function should be called from pkg_preinst.
+# Deprecated. Use xdg_icon_savelist from xdg-utils.eclass instead.
 gnome2_icon_savelist() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
-   pushd "${ED}" > /dev/null || die
-   export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 
-mindepth 1 -type d 2> /dev/null)
-   popd > /dev/null || die
+   eqawarn "QA warning: gnome2_icon_savelist has been moved to 
xdg-utils.eclass"
+   eqawarn "and is now called xdg_icon_savelist. Please migrate your 
ebuild and"
+   eqawarn "eclasses to use it"
+   xdg_icon_savelist
+   GNOME2_ECLASS_ICONS="${XDG_ECLASS_ICONS}"
 }
 
 # @FUNCTION: gnome2_icon_cache_update
 # @DESCRIPTION:
-# Updates Gtk+ icon cache files under /usr/share/icons.
-# This function should be called from pkg_postinst and pkg_postrm.
+# Deprecated. Use xdg_icon_cache_update from xdg-utils.eclass instead.
 gnome2_icon_cache_update() {
-   has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
-
-   if [[ ! -x "${updater}" ]] ; then
-   debug-print "${updater} is not executable"
-   return
-   fi
-
-   ebegin "Updating icons cache"
-
-   local retval=0
-   local fails=( )
-
-   for dir in "${EROOT%/}"/usr/share/icons/*
-   do
-   if [[ -f "${dir}/index.theme" ]] ; then
-   local rv=0
-
-   "${updater}" -qf "${dir}"
-   rv=$?
-
-   if [[ ! $rv -eq 0 ]] ; then
-   debug-print "Updating cache failed on ${dir}"
-
-   # Add to the list of failures
-   fails+=( "${dir}" )
-
-   retval=2
-   fi
-   elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
-   # Clear stale cache files after theme uninstallation
-   rm "${dir}/icon-theme.cache"
-   fi
-
-   if [[ -z $(ls "${dir}") ]]; then
-   # Clear empty theme directories after theme 
uninstallation
-   rmdir "${dir}"
-   fi
-   done
-
-   eend ${retval}
-
-   for f in "${fails[@]}" ; do
-   eerror "Failed to update cache with icon $f"
-   done
+   eqawarn "QA warning: gnome2_icon_cache_update has been moved to 
xdg-utils.eclass"
+   eqawarn "and is now called xdg_icon_cache_update. Please migrate your 
ebuild and"
+   eqawarn "eclasses to use it"
+   xdg_icon_cache_update
 }
 
 # @FUNCTION: gnome2_omf_fix
diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index 8dba5ed6861..37e1893a701 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -31,6 +31,12 @@ esac
 # Directory where .desktop files database is stored
 : ${DESKTOP_DATABASE_DIR="/usr/share/applications"}
 
+# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
+# @INTERNAL
+# @DESCRIPTION:
+# Path to gtk-update-icon-cache
+: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
+
 # @ECLASS-VARIABLE: MIMEINFO_DATABASE_UPDATE_BIN
 # @INTERNAL
 # @DESCRIPTION:
@@ -43,6 +49,12 @@ esac
 # Directory where .desktop files database is stored
 : ${MIMEINFO_DATABASE_DIR:="/usr/share/mime"}
 
+# @ECLASS-VARIABLE: XDG_ECLASS_ICONS
+# @INTERNAL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# List of icons provided by the package
+
 # @FUNCTION: xdg_environment_reset
 # @DESCRIPTION:
 # Clean up environment for clean builds.
@@ -82,6 +94,74 @@ xdg_desktop_database_update() {
eend $?
 }
 
+# @FUNCTION: xdg_icon_savelist
+# @DESCRIPTION:
+# Find the icons that are about to be installed and 

[gentoo-dev] [PATCH 1/4] xdg-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
Use ${EROOT%/} whereever possible, as the tools and directories which
are used with it are already prefixed with a /

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index ac075185d8e..8dba5ed6861 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -15,7 +15,7 @@
 #  * XDG mime information database management
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6) ;;
+   0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -66,7 +66,7 @@ xdg_environment_reset() {
 # Updates the .desktop files database.
 # Generates a list of mimetypes linked to applications that can handle them
 xdg_desktop_database_update() {
-   local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
+   local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
 
if [[ ${EBUILD_PHASE} != post* ]] ; then
die "xdg_desktop_database_update must be used in pkg_post* 
phases."
@@ -78,7 +78,7 @@ xdg_desktop_database_update() {
fi
 
ebegin "Updating .desktop files database"
-   "${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
+   "${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
eend $?
 }
 
@@ -87,7 +87,7 @@ xdg_desktop_database_update() {
 # Update the mime database.
 # Creates a general list of mime types from several sources
 xdg_mimeinfo_database_update() {
-   local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
+   local updater="${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
 
if [[ ${EBUILD_PHASE} != post* ]] ; then
die "xdg_mimeinfo_database_update must be used in pkg_post* 
phases."
@@ -99,6 +99,6 @@ xdg_mimeinfo_database_update() {
fi
 
ebegin "Updating shared mime info database"
-   "${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
+   "${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
eend $?
 }
-- 
2.17.1




[gentoo-dev] [PATCH 2/4] gnome2-utils.eclass: make EAPI 7 ready

2018-06-20 Thread Marty E. Plummer
Use ${EROOT%/} whereever possible, as most of the directories and files
used in conjunction with it have a leading /; add missing leading /
where apropriate.

Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 41 ++
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 65076ae2d61..14fb9e7420c 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -18,7 +18,7 @@
 inherit eutils xdg-utils
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6) ;;
+   0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -82,9 +82,6 @@ esac
 # @DESCRIPTION:
 # List of gdk-pixbuf loaders provided by the package
 
-DEPEND=">=sys-apps/sed-4"
-
-
 # @FUNCTION: gnome2_environment_reset
 # @DESCRIPTION:
 # Reset various variables inherited from root's evironment to a reasonable
@@ -101,7 +98,7 @@ gnome2_environment_reset() {
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
 
-   if has ${EAPI:-0} 6; then
+   if has ${EAPI:-0} 6 7; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
 
@@ -129,7 +126,7 @@ gnome2_gconf_savelist() {
 # This function should be called from pkg_postinst.
 gnome2_gconf_install() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GCONFTOOL_BIN}"
+   local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -149,9 +146,9 @@ gnome2_gconf_install() {
 
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
-   if [[ -e "${EROOT}${F}" ]]; then
+   if [[ -e "${EROOT%/}${F}" ]]; then
debug-print "Installing schema: ${F}"
-   "${updater}" --makefile-install-rule "${EROOT}${F}" 
1>/dev/null
+   "${updater}" --makefile-install-rule "${EROOT%/}${F}" 
1>/dev/null
fi
done
 
@@ -170,7 +167,7 @@ gnome2_gconf_install() {
 # database.
 gnome2_gconf_uninstall() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GCONFTOOL_BIN}"
+   local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -189,9 +186,9 @@ gnome2_gconf_uninstall() {
 
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
-   if [[ -e "${EROOT}${F}" ]]; then
+   if [[ -e "${EROOT%/}${F}" ]]; then
debug-print "Uninstalling gconf schema: ${F}"
-   "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 
1>/dev/null
+   "${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 
1>/dev/null
fi
done
 
@@ -224,7 +221,7 @@ gnome2_icon_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_icon_cache_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
+   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
 
if [[ ! -x "${updater}" ]] ; then
debug-print "${updater} is not executable"
@@ -339,7 +336,7 @@ gnome2_scrollkeeper_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_scrollkeeper_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
+   local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
if [[ ! -x "${updater}" ]] ; then
debug-print "${updater} is not executable"
@@ -352,7 +349,7 @@ gnome2_scrollkeeper_update() {
fi
 
ebegin "Updating scrollkeeper database ..."
-   "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
+   "${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
eend $?
 }
 
@@ -376,7 +373,7 @@ gnome2_schemas_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_schemas_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
+   local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
 
if [[ ! -x ${updater} ]]; then
debug-print "${updater} is not executable"
@@ -407,10 +404,10 @@ gnome2_gdk_pixbuf_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_gdk_pixbuf_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
+   local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
 
if [[ ! -x ${updater} ]]; then
-  

Re: [gentoo-dev] xdg-utils.eclass and EAPI 7

2018-06-17 Thread Marty E. Plummer
On Fri, Jun 15, 2018 at 10:35:21AM +0700, gro...@gentoo.org wrote:
> Does anybody plan to add EAPI 7 support to this eclass anytime soon? It must
> be trivial.
> 
> There are 857 ebuilds inheriting this eclass in the tree, and they cannot be
> bumped to EAPI 7 now.
> 
> Andrey
>
Went ahead and did the work as best as I can figure; also hit
gnome2-utils as the two are often used in conjuction with it.
https://archives.gentoo.org/gentoo-dev/message/e362551bd2b0c284dc6e0e99047e6b26

Marty



[gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready

2018-06-17 Thread Marty E. Plummer
Use ${EROOT%/} whereever possible, as most of the directories and files
used in conjunction with it have a leading /; add missing leading /
where apropriate. Put sys-apps/sed into BDEPEND if EAPI 7, as it need to
be executable on CBUILD.

Signed-off-by: Marty E. Plummer 
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 43 +++---
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 65076ae2d61..4204dac2956 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -18,7 +18,7 @@
 inherit eutils xdg-utils
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6) ;;
+   0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -82,8 +82,9 @@ esac
 # @DESCRIPTION:
 # List of gdk-pixbuf loaders provided by the package
 
-DEPEND=">=sys-apps/sed-4"
-
+# sed needs to be executable on the build system
+BDEPEND=">=sys-apps/sed-4"
+[[ ${EAPI:-0} == [0123456] ]] && DEPEND="${BDEPEND}"
 
 # @FUNCTION: gnome2_environment_reset
 # @DESCRIPTION:
@@ -101,7 +102,7 @@ gnome2_environment_reset() {
# Ensure we don't rely on dconf/gconf while building, bug #511946
export GSETTINGS_BACKEND="memory"
 
-   if has ${EAPI:-0} 6; then
+   if has ${EAPI:-0} 6 7; then
# Try to cover the packages honoring this variable, bug #508124
export GST_INSPECT="$(type -P true)"
 
@@ -129,7 +130,7 @@ gnome2_gconf_savelist() {
 # This function should be called from pkg_postinst.
 gnome2_gconf_install() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GCONFTOOL_BIN}"
+   local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -149,9 +150,9 @@ gnome2_gconf_install() {
 
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
-   if [[ -e "${EROOT}${F}" ]]; then
+   if [[ -e "${EROOT%/}${F}" ]]; then
debug-print "Installing schema: ${F}"
-   "${updater}" --makefile-install-rule "${EROOT}${F}" 
1>/dev/null
+   "${updater}" --makefile-install-rule "${EROOT%/}${F}" 
1>/dev/null
fi
done
 
@@ -170,7 +171,7 @@ gnome2_gconf_install() {
 # database.
 gnome2_gconf_uninstall() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GCONFTOOL_BIN}"
+   local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
if [[ ! -x "${updater}" ]]; then
debug-print "${updater} is not executable"
@@ -189,9 +190,9 @@ gnome2_gconf_uninstall() {
 
local F
for F in ${GNOME2_ECLASS_SCHEMAS}; do
-   if [[ -e "${EROOT}${F}" ]]; then
+   if [[ -e "${EROOT%/}${F}" ]]; then
debug-print "Uninstalling gconf schema: ${F}"
-   "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 
1>/dev/null
+   "${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 
1>/dev/null
fi
done
 
@@ -224,7 +225,7 @@ gnome2_icon_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_icon_cache_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
+   local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
 
if [[ ! -x "${updater}" ]] ; then
debug-print "${updater} is not executable"
@@ -339,7 +340,7 @@ gnome2_scrollkeeper_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_scrollkeeper_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-   local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
+   local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
if [[ ! -x "${updater}" ]] ; then
debug-print "${updater} is not executable"
@@ -352,7 +353,7 @@ gnome2_scrollkeeper_update() {
fi
 
ebegin "Updating scrollkeeper database ..."
-   "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
+   "${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
eend $?
 }
 
@@ -376,7 +377,7 @@ gnome2_schemas_savelist() {
 # This function should be called from pkg_postinst an

[gentoo-dev] [PATCH 2/2] xdg-utils.eclass: make EAPI 7 ready

2018-06-17 Thread Marty E. Plummer
Use ${EROOT%/} whereever possible, as the tools and directories which
are used with it are already prefixed with a /

Signed-off-by: Marty E. Plummer 
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index ac075185d8e..8dba5ed6861 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -15,7 +15,7 @@
 #  * XDG mime information database management
 
 case "${EAPI:-0}" in
-   0|1|2|3|4|5|6) ;;
+   0|1|2|3|4|5|6|7) ;;
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -66,7 +66,7 @@ xdg_environment_reset() {
 # Updates the .desktop files database.
 # Generates a list of mimetypes linked to applications that can handle them
 xdg_desktop_database_update() {
-   local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
+   local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
 
if [[ ${EBUILD_PHASE} != post* ]] ; then
die "xdg_desktop_database_update must be used in pkg_post* 
phases."
@@ -78,7 +78,7 @@ xdg_desktop_database_update() {
fi
 
ebegin "Updating .desktop files database"
-   "${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
+   "${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
eend $?
 }
 
@@ -87,7 +87,7 @@ xdg_desktop_database_update() {
 # Update the mime database.
 # Creates a general list of mime types from several sources
 xdg_mimeinfo_database_update() {
-   local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
+   local updater="${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
 
if [[ ${EBUILD_PHASE} != post* ]] ; then
die "xdg_mimeinfo_database_update must be used in pkg_post* 
phases."
@@ -99,6 +99,6 @@ xdg_mimeinfo_database_update() {
fi
 
ebegin "Updating shared mime info database"
-   "${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
+   "${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
eend $?
 }
-- 
2.17.1




[gentoo-dev] [PATCH 0/2] xdg-utils && gnome2-utils EAPI 7 work

2018-06-17 Thread Marty E. Plummer
Just some simple changes to the eclasses to handle the fact that
${EROOT} no longer comes with a trailing / on EAPI 7 and use BDEPEND
where applicable. Better ideas and suggestions are greatly appreciated.

Marty E. Plummer (2):
  xdg-utils.eclass: make EAPI 7 ready
  gnome2-utils.eclass: make EAPI 7 ready

 eclass/xdg-utils.eclass| 10 -
 eclass/gnome2-utils.eclass | 43 +++---
 2 files changed, 27 insertions(+), 26 deletions(-)

-- 
2.17.1




Re: [gentoo-dev] xdg-utils.eclass and EAPI 7

2018-06-15 Thread Marty E. Plummer
On Fri, Jun 15, 2018 at 10:35:21AM +0700, gro...@gentoo.org wrote:
> Does anybody plan to add EAPI 7 support to this eclass anytime soon? It must
> be trivial.
> 
Yeah, it should be fairly simple; PDEPEND and BROOT stuff should be
simple enough.
> There are 857 ebuilds inheriting this eclass in the tree, and they cannot be
> bumped to EAPI 7 now.
> 
> Andrey
> 



[gentoo-dev] [PATCH] xfconf.eclass: remove git logic

2018-06-14 Thread Marty E. Plummer
There are currently no ebuilds using xfconf which are live, and the live
logic here is based around git-2 which has been deprecated since 20151113.

Signed-off-by: Marty E. Plummer 
---
 eclass/xfconf.eclass | 19 ++-
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/eclass/xfconf.eclass b/eclass/xfconf.eclass
index 496c42d5cf1..705324494a4 100644
--- a/eclass/xfconf.eclass
+++ b/eclass/xfconf.eclass
@@ -22,18 +22,11 @@ fi
 # @DESCRIPTION:
 # This should be an array defining arguments for econf
 
-unset _xfconf_live
-[[ $PV == ** ]] && _xfconf_live=git-2
-
-inherit ${_xfconf_live} autotools eutils gnome2-utils libtool xdg-utils
-
-EGIT_BOOTSTRAP=autogen.sh
-EGIT_REPO_URI="git://git.xfce.org/xfce/${MY_PN:-${PN}}"
+inherit autotools eutils gnome2-utils libtool xdg-utils
 
 _xfconf_deps=""
 _xfconf_m4=">=dev-util/xfce4-dev-tools-4.10"
 
-[[ -n $_xfconf_live ]] && _xfconf_deps+=" dev-util/gtk-doc ${_xfconf_m4}"
 [[ -n $EAUTORECONF ]] && _xfconf_deps+=" ${_xfconf_m4}"
 
 RDEPEND=""
@@ -47,9 +40,7 @@ case ${EAPI:-0} in
*) die "Unknown EAPI." ;;
 esac
 
-[[ -n $_xfconf_live ]] && _xfconf_live=src_unpack
-
-EXPORT_FUNCTIONS ${_xfconf_live} src_prepare src_configure src_install 
pkg_preinst pkg_postinst pkg_postrm
+EXPORT_FUNCTIONS src_prepare src_configure src_install pkg_preinst 
pkg_postinst pkg_postrm
 
 # @FUNCTION: xfconf_use_debug
 # @DESCRIPTION:
@@ -101,7 +92,6 @@ xfconf_src_prepare() {
 # Run econf with opts from the XFCONF array
 xfconf_src_configure() {
debug-print-function ${FUNCNAME} "$@"
-   [[ -n $_xfconf_live ]] && XFCONF+=( --enable-maintainer-mode )
econf "${XFCONF[@]}"
 }
 
@@ -112,11 +102,6 @@ xfconf_src_configure() {
 xfconf_src_install() {
debug-print-function ${FUNCNAME} "$@"
 
-   # FIXME
-   if [[ -n $_xfconf_live ]] && ! [[ -e ChangeLog ]]; then
-   touch ChangeLog
-   fi
-
emake DESTDIR="${D}" "$@" install
 
einstalldocs
-- 
2.17.1




[gentoo-dev] [PATCH] kernel-2.eclass: drop EAPI 0-1 support code

2018-06-13 Thread Marty E. Plummer
Also went ahead and dropped versionator in favor of eapi7-ver for EAPI 0-6,
and eutils for epatch. multilib dropped as unneeded. All ebuilds using it
tested with ebuild clean install clean.

See also https://github.com/gentoo/gentoo/pull/8825

Bug: https://bugs.gentoo.org/657926
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/kernel-2.eclass | 39 ++-
 1 file changed, 14 insertions(+), 25 deletions(-)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 94937b6630b..ea99bdf39a1 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -192,11 +192,10 @@
 
 PYTHON_COMPAT=( python{2_6,2_7} )
 
-inherit eutils toolchain-funcs versionator multilib python-any-r1
+inherit toolchain-funcs python-any-r1
+[[ ${EAPI:-0} == [012345] ]] && inherit epatch
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
 case ${EAPI:-0} in
-   0|1)
-   EXPORT_FUNCTIONS src_{unpack,compile,install,test} \
-   pkg_{setup,preinst,postinst,postrm} ;;
2|3|4|5|6)
EXPORT_FUNCTIONS src_{unpack,prepare,compile,install,test} \
pkg_{setup,preinst,postinst,postrm} ;;
@@ -216,8 +215,6 @@ fi
 HOMEPAGE="https://www.kernel.org/ https://www.gentoo.org/ ${HOMEPAGE}"
 : ${LICENSE:="GPL-2"}
 
-has "${EAPI:-0}" 0 1 2 && ED=${D} EPREFIX= EROOT=${ROOT}
-
 # This is the latest KV_PATCH of the deblob tool available from the
 # libre-sources upstream. If you bump this, you MUST regenerate the Manifests
 # for ALL kernel-2 consumer packages where deblob is available.
@@ -326,7 +323,7 @@ detect_version() {
OKV=${OKV/-r*}
OKV=${OKV/_p*}
 
-   KV_MAJOR=$(get_version_component_range 1 ${OKV})
+   KV_MAJOR=$(ver_cut 1 ${OKV})
# handle if OKV is X.Y or X.Y.Z (e.g. 3.0 or 3.0.1)
local OKV_ARRAY
IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
@@ -334,17 +331,17 @@ detect_version() {
# if KV_MAJOR >= 3, then we have no more KV_MINOR
#if [[ ${KV_MAJOR} -lt 3 ]]; then
if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
-   KV_MINOR=$(get_version_component_range 2 ${OKV})
-   KV_PATCH=$(get_version_component_range 3 ${OKV})
+   KV_MINOR=$(ver_cut 2 ${OKV})
+   KV_PATCH=$(ver_cut 3 ${OKV})
if [[ ${KV_MAJOR}${KV_MINOR}${KV_PATCH} -ge 269 ]]; then
-   KV_EXTRA=$(get_version_component_range 4- ${OKV})
+   KV_EXTRA=$(ver_cut 4- ${OKV})
KV_EXTRA=${KV_EXTRA/[-_]*}
else
-   KV_PATCH=$(get_version_component_range 3- ${OKV})
+   KV_PATCH=$(ver_cut 3- ${OKV})
fi
else
-   KV_PATCH=$(get_version_component_range 2 ${OKV})
-   KV_EXTRA=$(get_version_component_range 3- ${OKV})
+   KV_PATCH=$(ver_cut 2 ${OKV})
+   KV_EXTRA=$(ver_cut 3- ${OKV})
KV_EXTRA=${KV_EXTRA/[-_]*}
fi
 
@@ -645,11 +642,7 @@ if [[ ${ETYPE} == sources ]]; then
DEBLOB_CHECK_A="deblob-check-${DEBLOB_PV}"

DEBLOB_HOMEPAGE="http://www.fsfla.org/svn/fsfla/software/linux-libre/releases/tags";
DEBLOB_URI_PATH="${DEBLOB_PV}${K_DEBLOB_TAG}"
-   if ! has "${EAPI:-0}" 0 1 ; then
-   
DEBLOB_CHECK_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/deblob-check -> 
${DEBLOB_CHECK_A}"
-   else
-   
DEBLOB_CHECK_URI="mirror://gentoo/${DEBLOB_CHECK_A}"
-   fi
+   DEBLOB_CHECK_URI="mirror://gentoo/${DEBLOB_CHECK_A}"
 

DEBLOB_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/${DEBLOB_A}"
HOMEPAGE="${HOMEPAGE} ${DEBLOB_HOMEPAGE}"
@@ -1075,9 +1068,9 @@ postinst_sources() {
fi
 
# warn sparc users that they need to do cross-compiling with >= 
2.6.25(bug #214765)
-   KV_MAJOR=$(get_version_component_range 1 ${OKV})
-   KV_MINOR=$(get_version_component_range 2 ${OKV})
-   KV_PATCH=$(get_version_component_range 3 ${OKV})
+   KV_MAJOR=$(ver_cut 1 ${OKV})
+   KV_MINOR=$(ver_cut 2 ${OKV})
+   KV_PATCH=$(ver_cut 3 ${OKV})
if [[ "$(tc-arch)" = "sparc" ]]; then
if [[ $(gcc-major-version) -lt 4 && $(gcc-minor-version) -lt 4 
]]; then
if [[ ${KV_MAJOR} -ge 3 || 
${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.24 ]] ; then
@@ -1476,10 +1469,6 @@ kernel-2_src_unpack() {
# we run misc `make` functions below
[[ $(type -t kernel-2_hook_premake) == "function" ]] && 
kernel-2_hook_premake
 
-   case ${EAPI:-0} in
-   0|1) kernel-2_src_prepare ;;
-   esac
-
debug-print "Doing unpack_set_extraversion"
 
[[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
-- 
2.17.1




Re: [gentoo-dev] [PATCH 0/2] drop git logic from toolchain eclasses

2018-06-05 Thread Marty E. Plummer
On Tue, Jun 05, 2018 at 11:24:49PM +0200, Andreas K. Huettel wrote:
> Am Sonntag, 3. Juni 2018, 03:47:14 CEST schrieb Marty E. Plummer:
> > In the live ebuilds using this eclass, the git logic is handled in the
> > ebuild itself and not the eclass. Drop the git logic as it uses git-2
> > which has been deprecated for quite some time.
> > 
> > Marty E. Plummer (2):
> >   toolchain-binutils.eclass: drop git-2
> >   toolchain-glibc.eclass: remove git logic
> > 
> >  eclass/toolchain-binutils.eclass | 16 +---
> >  eclass/toolchain-glibc.eclass| 11 +--
> >  2 files changed, 2 insertions(+), 25 deletions(-)
> 
> As already discussed in private, this doesnt really make sense... 
> 
> Both eclasses are only used in old, stable ebuilds that are being phased out, 
> and are in freeze.
> 
> 
Reason I sent these patches is git-2 is deprecated in favor of git-r3,
and I assume (perhaps wrongly) git-2.eclass won't be removed from the
tree untill all its consumers are ported.

And in both eclasses the ebuilds which use them never enter the git
logic path, so its effectively dead code and even with the 'freeze' this
change will not change their behavior.
> -- 
> Andreas K. H?ttel
> dilfri...@gentoo.org
> Gentoo Linux developer 
> (council, toolchain, perl, libreoffice, comrel)





Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7

2018-06-04 Thread Marty E. Plummer
On Wed, May 23, 2018 at 08:18:48PM -0500, Marty E. Plummer wrote:
> 
> Should be the final iteration; added comments explaining why eclasses
> were inherited, again suggested by [Arfrever].
> 
Any thoughts?
> ---
>  eclass/java-utils-2.eclass | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
> index 25e35c33dd2..0ecc5eb5a94 100644
> --- a/eclass/java-utils-2.eclass
> +++ b/eclass/java-utils-2.eclass
> @@ -15,7 +15,12 @@
>  # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
> packages
>  # that have optional Java support. In addition you can inherit java-ant-2 for
>  # Ant-based packages.
> -inherit eutils versionator multilib
> +
> +# Inherit multlib.eclass for get_libdir()
> +[[ ${EAPI:-0} == [012345] ]] && inherit multilib
> +# Inherit eapi7-ver.eclass for ver_cut()
> +# Inherit eutils for eqawarn()
> +[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver eutils
>  
>  IUSE="elibc_FreeBSD"
>  
> @@ -1526,8 +1531,8 @@ java-pkg_is-vm-version-eq() {
>  
>   local vm_version="$(java-pkg_get-vm-version)"
>  
> - vm_version="$(get_version_component_range 1-2 "${vm_version}")"
> - needed_version="$(get_version_component_range 1-2 "${needed_version}")"
> + vm_version="$(ver_cut 1-2 "${vm_version}")"
> + needed_version="$(ver_cut 1-2 "${needed_version}")"
>  
>   if [[ -z "${vm_version}" ]]; then
>   debug-print "Could not get JDK version from DEPEND"
> -- 
> 2.17.0
> 



[gentoo-dev] [PATCH 2/2] toolchain-glibc.eclass: remove git logic

2018-06-02 Thread Marty E. Plummer
The git logic is handled in the live ebuild directly, and the only use
of this eclass is in non-live ebuilds. In fact, the two newest non-live
ebuilds do not make use of this eclass at all, and as far as I can see
nowhere in the history of this file does it inherit git-2 at all.
---
 eclass/toolchain-glibc.eclass | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/eclass/toolchain-glibc.eclass b/eclass/toolchain-glibc.eclass
index d75ca2eefdf..5f0e0cfd5cd 100644
--- a/eclass/toolchain-glibc.eclass
+++ b/eclass/toolchain-glibc.eclass
@@ -667,16 +667,7 @@ toolchain-glibc_do_src_unpack() {
# Check NPTL support _before_ we unpack things to save some time
want_nptl && check_nptl_support
 
-   if [[ -n ${EGIT_REPO_URIS} ]] ; then
-   local i d
-   for ((i=0; i<${#EGIT_REPO_URIS[@]}; ++i)) ; do
-   EGIT_REPO_URI=${EGIT_REPO_URIS[$i]}
-   EGIT_SOURCEDIR=${EGIT_SOURCEDIRS[$i]}
-   git-2_src_unpack
-   done
-   else
-   unpack_pkg
-   fi
+   unpack_pkg
 
cd "${S}"
touch locale/C-translit.h #185476 #218003
-- 
2.17.1




[gentoo-dev] [PATCH 1/2] toolchain-binutils.eclass: drop git-2

2018-06-02 Thread Marty E. Plummer
git-2.eclass is deprecated and the git logic is handled in the live
ebuild itself.
---
 eclass/toolchain-binutils.eclass | 16 +---
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass
index 0e532a8f201..a504a0f9a4e 100644
--- a/eclass/toolchain-binutils.eclass
+++ b/eclass/toolchain-binutils.eclass
@@ -15,7 +15,6 @@ if [[ -n ${BINUTILS_TYPE} ]] ; then
BTYPE=${BINUTILS_TYPE}
 else
case ${PV} in
-   )  BTYPE="git";;
_pre*) BTYPE="snap";;
*.*.90)BTYPE="snap";;
*.*.*.*.*) BTYPE="hjlu";;
@@ -24,11 +23,6 @@ else
 fi
 
 case ${BTYPE} in
-git)
-   BVER="git"
-   EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
-   inherit git-2
-   ;;
 snap)
BVER=${PV/_pre}
;;
@@ -58,7 +52,6 @@ DESCRIPTION="Tools necessary to build programs"
 HOMEPAGE="https://sourceware.org/binutils/";
 
 case ${BTYPE} in
-   git) SRC_URI="" ;;
snap)

SRC_URI="ftp://gcc.gnu.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2

ftp://sourceware.org/pub/binutils/snapshots/binutils-${BVER}.tar.bz2"; ;;
@@ -113,10 +106,6 @@ if is_cross ; then
 fi
 
 S=${WORKDIR}/binutils
-case ${BVER} in
-git) ;;
-*) S=${S}-${BVER} ;;
-esac
 
 LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
 INCPATH=${LIBPATH}/include
@@ -129,10 +118,7 @@ else
 fi
 
 tc-binutils_unpack() {
-   case ${BTYPE} in
-   git) git-2_src_unpack ;;
-   *)   unpacker ${A} ;;
-   esac
+   unpacker ${A}
mkdir -p "${MY_BUILDDIR}"
[[ -d ${WORKDIR}/patch ]] && mkdir "${WORKDIR}"/patch/skip
 }
-- 
2.17.1




[gentoo-dev] [PATCH 0/2] drop git logic from toolchain eclasses

2018-06-02 Thread Marty E. Plummer
In the live ebuilds using this eclass, the git logic is handled in the
ebuild itself and not the eclass. Drop the git logic as it uses git-2
which has been deprecated for quite some time.

Marty E. Plummer (2):
  toolchain-binutils.eclass: drop git-2
  toolchain-glibc.eclass: remove git logic

 eclass/toolchain-binutils.eclass | 16 +---
 eclass/toolchain-glibc.eclass| 11 +--
 2 files changed, 2 insertions(+), 25 deletions(-)

-- 
2.17.1




[gentoo-dev] [PATCH] enlightenment.eclass: git-2->git-r3 migration

2018-06-02 Thread Marty E. Plummer
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
Just a small patch to migrate from git-2->git-r3 for this eclass. I've
tested each live ebuild which uses this eclass, though I'd like to have
toralf tinderbox it a bit because there are quite a few more which
should be tested.

media-libs/elementary- simply cannot build due to
/usr/bin/eolian_gen being called improperly; I think this may be due to
the installed dev-libs/efl being too old or something.

See also: https://github.com/gentoo/gentoo/pull/8700

 eclass/enlightenment.eclass | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/eclass/enlightenment.eclass b/eclass/enlightenment.eclass
index a96ca4c266a..1682e0b6bae 100644
--- a/eclass/enlightenment.eclass
+++ b/eclass/enlightenment.eclass
@@ -52,11 +52,9 @@ if [[ ${PV} == ** ]] ; then
if [[ ${EGIT_URI_APPEND} ]] ; then
E_LIVE_SERVER=${E_LIVE_SERVER:-${E_LIVE_SERVER_DEFAULT_GIT}}
EGIT_URI_APPEND=${EGIT_URI_APPEND:-${PN}}
-   
EGIT_PROJECT="enlightenment/${EGIT_SUB_PROJECT}/${EGIT_URI_APPEND}"

EGIT_REPO_URI=${EGIT_SERVER:-${E_LIVE_SERVER_DEFAULT_GIT}}/${EGIT_SUB_PROJECT}/${EGIT_URI_APPEND}.git
-   E_S_APPEND=${EGIT_URI_APPEND}
E_LIVE_SOURCE="git"
-   inherit git-2
+   inherit git-r3
fi
E_STATE="live"
WANT_AUTOTOOLS="yes"
@@ -107,16 +105,10 @@ DEPEND="doc? ( app-doc/doxygen )
${E_CYTHON:+>=dev-python/cython-0.12.1}"
 RDEPEND="nls? ( sys-devel/gettext )"
 
-case ${EURI_STATE:-${E_STATE}} in
-   release) S=${WORKDIR}/${P};;
-   snap)S=${WORKDIR}/${P};;
-   live)S=${WORKDIR}/${E_S_APPEND};;
-esac
-
 enlightenment_src_unpack() {
if [[ ${E_STATE} == "live" ]] ; then
case ${E_LIVE_SOURCE} in
-   git) git-2_src_unpack;;
+   git) git-r3_src_unpack;;
*)   die "eek!";;
esac
else
-- 
2.17.1




Re: [gentoo-dev] [PATCH] ant-tasks.eclass: use eapi7-ver

2018-05-30 Thread Marty E. Plummer
On Wed, May 30, 2018 at 10:56:47AM +0200, Ulrich Mueller wrote:
> >>>>> On Wed, 30 May 2018, Marty E Plummer wrote:
> 
> > Clean resend for monsierp, as the prior one got mangled a bit.
> 
> Just a hint: If you write this after the separating line ("---"),
> then your patch can be applied with "git am" without this sentence
> being included in the commit message (unless you want that, of
> course).
> 
> >
> > Package-Manager: Portage-2.3.36, Repoman-2.3.9
> > ---
> 
> Here is where such additional comments should go.
> 
> Ulrich
> 
Ah, I knew there was something like that. Thanks for that.
> >  eclass/ant-tasks.eclass | 11 ++-
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> > diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
> > [...]





[gentoo-dev] [PATCH] ant-tasks.eclass: use eapi7-ver

2018-05-30 Thread Marty E. Plummer
Clean resend for monsierp, as the prior one got mangled a bit.

Package-Manager: Portage-2.3.36, Repoman-2.3.9
---
 eclass/ant-tasks.eclass | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
index e008e6eaea8..31683e68243 100644
--- a/eclass/ant-tasks.eclass
+++ b/eclass/ant-tasks.eclass
@@ -16,7 +16,8 @@
 JAVA_ANT_DISABLE_ANT_CORE_DEP=true
 # rewriting build.xml for are the testcases has no reason atm
 JAVA_PKG_BSFIX_ALL=no
-inherit versionator java-pkg-2 java-ant-2
+inherit java-pkg-2 java-ant-2
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
 
 EXPORT_FUNCTIONS src_unpack src_compile src_install
 
@@ -60,12 +61,12 @@ if [[ ${PV} == *beta2* ]]; then
MY_PV=${PV/_beta2/beta}
UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src";
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
-   ANT_TASK_PV=$(get_version_component_range 1-3)
+   ANT_TASK_PV=$(ver_cut 1-3)
 elif [[ ${PV} == *_rc* ]]; then
MY_PV=${PV/_rc/RC}
UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles";
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
-   ANT_TASK_PV=$(get_version_component_range 1-3)
+   ANT_TASK_PV=$(ver_cut 1-3)
 else
# default for final releases
MY_PV=${PV}
@@ -101,7 +102,7 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
 fi
 
 # we need direct blockers with old ant-tasks for file collisions - bug #252324
-if version_is_at_least 1.7.1 ; then
+if ver_test -ge 1.7.1; then
DEPEND+=" !dev-java/ant-tasks"
 fi
 
@@ -167,7 +168,7 @@ ant-tasks_src_install() {
java-pkg_register-ant-task --version "${ANT_TASK_PV}"
 
# create the compatibility symlink
-   if version_is_at_least 1.7.1_beta2; then
+   if ver_test -ge 1.7.1_beta2; then
dodir /usr/share/ant/lib
dosym /usr/share/${PN}/lib/${PN}.jar 
/usr/share/ant/lib/${PN}.jar
fi
-- 
2.17.1




Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7

2018-05-23 Thread Marty E. Plummer
On Tue, May 22, 2018 at 09:33:59PM -0500, Marty E. Plummer wrote:
> On Mon, May 21, 2018 at 05:13:18PM -0500, Marty E. Plummer wrote:
> > On Mon, May 21, 2018 at 04:47:03PM -0500, Marty E. Plummer wrote:
> > > On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
> > > > You could inherit eapi7-ver instead of versionator, which would save
> > > > the conditional below.
> > > > 
> > > I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
> > > will rework this and the other patch I sent in for that reason, then.
> > Here we go. The eapi != 7 conditional is needed as eapi7 is 'not
> > supported' by eapi7-ver because its contents are already there.
> 
> Once more, with changes suggested by [Arfrever] in #gentoo-java.

Should be the final iteration; added comments explaining why eclasses
were inherited, again suggested by [Arfrever].

---
 eclass/java-utils-2.eclass | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 25e35c33dd2..0ecc5eb5a94 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -15,7 +15,12 @@
 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
packages
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
-inherit eutils versionator multilib
+
+# Inherit multlib.eclass for get_libdir()
+[[ ${EAPI:-0} == [012345] ]] && inherit multilib
+# Inherit eapi7-ver.eclass for ver_cut()
+# Inherit eutils for eqawarn()
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver eutils
 
 IUSE="elibc_FreeBSD"
 
@@ -1526,8 +1531,8 @@ java-pkg_is-vm-version-eq() {
 
local vm_version="$(java-pkg_get-vm-version)"
 
-   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
-   needed_version="$(get_version_component_range 1-2 "${needed_version}")"
+   vm_version="$(ver_cut 1-2 "${vm_version}")"
+   needed_version="$(ver_cut 1-2 "${needed_version}")"
 
if [[ -z "${vm_version}" ]]; then
debug-print "Could not get JDK version from DEPEND"
-- 
2.17.0




Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7

2018-05-22 Thread Marty E. Plummer
On Mon, May 21, 2018 at 05:13:18PM -0500, Marty E. Plummer wrote:
> On Mon, May 21, 2018 at 04:47:03PM -0500, Marty E. Plummer wrote:
> > On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
> > > You could inherit eapi7-ver instead of versionator, which would save
> > > the conditional below.
> > > 
> > I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
> > will rework this and the other patch I sent in for that reason, then.
> Here we go. The eapi != 7 conditional is needed as eapi7 is 'not
> supported' by eapi7-ver because its contents are already there.

Once more, with changes suggested by [Arfrever] in #gentoo-java.
---
 eclass/java-utils-2.eclass | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 25e35c33dd2..f45b29c9e32 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -15,7 +15,8 @@
 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
packages
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
-inherit eutils versionator multilib
+[[ ${EAPI:-0} == [012345] ]] && inherit multilib
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver eutils
 
 IUSE="elibc_FreeBSD"
 
@@ -1526,8 +1527,8 @@ java-pkg_is-vm-version-eq() {
 
local vm_version="$(java-pkg_get-vm-version)"
 
-   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
-   needed_version="$(get_version_component_range 1-2 "${needed_version}")"
+   vm_version="$(ver_cut 1-2 "${vm_version}")"
+   needed_version="$(ver_cut 1-2 "${needed_version}")"
 
if [[ -z "${vm_version}" ]]; then
debug-print "Could not get JDK version from DEPEND"
-- 
2.17.0




Re: [gentoo-dev] Re: [PATCH] ant-tasks.eclass: use eapi7-ver

2018-05-22 Thread Marty E. Plummer
On Tue, May 22, 2018 at 01:59:51AM -0500, Marty E. Plummer wrote:
> On Tue, May 22, 2018 at 08:27:27AM +0200, Ulrich Mueller wrote:
> > >>>>> On Mon, 21 May 2018, Marty E Plummer wrote:
> > 
> > > On Tue, May 22, 2018 at 05:57:35AM +0200, Micha?? G??rny wrote:
> > 
> > [Please check you mailer configuration. It's sending MIME, but
> > charset=us-ascii cannot represent these chars.]
> > 
> > >> Always check for old EAPIs, instead of expecting people to keep updating
> > >> this forever.
> > >> 
> > > Would you prefer something like
> > > [[ ${EAPI} ~= [0-6] ]] && inherit eapi7-ver, then?
> > 
> > The regexp operator is =~ not ~=. Also it will match partial
> > expressions, so it will fail in EAPI 10.
> > 
> Fair, I knew it was something like that. Also, by the time EAPI 10 hits
> this section of code should have been long culled since eapi7-ver's
> functions are 'native' in EAPI 7.
> > Use this instead: [[ ${EAPI:-0} == [0123456] ]]
> > 
> Fair enough, that should do the trick and keep everyone happy in the
> long run.
> > Ulrich

How's this?
---
 eclass/ant-tasks.eclass | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
index e008e6eaea8..31683e68243 100644
--- a/eclass/ant-tasks.eclass
+++ b/eclass/ant-tasks.eclass
@@ -16,7 +16,8 @@
 JAVA_ANT_DISABLE_ANT_CORE_DEP=true
 # rewriting build.xml for are the testcases has no reason atm
 JAVA_PKG_BSFIX_ALL=no
-inherit versionator java-pkg-2 java-ant-2
+inherit java-pkg-2 java-ant-2
+[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
 
 EXPORT_FUNCTIONS src_unpack src_compile src_install
 
@@ -60,12 +61,12 @@ if [[ ${PV} == *beta2* ]]; then
MY_PV=${PV/_beta2/beta}
UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src";
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
-   ANT_TASK_PV=$(get_version_component_range 1-3)
+   ANT_TASK_PV=$(ver_cut 1-3)
 elif [[ ${PV} == *_rc* ]]; then
MY_PV=${PV/_rc/RC}
UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles";
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
-   ANT_TASK_PV=$(get_version_component_range 1-3)
+   ANT_TASK_PV=$(ver_cut 1-3)
 else
# default for final releases
MY_PV=${PV}
@@ -101,7 +102,7 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
 fi
 
 # we need direct blockers with old ant-tasks for file collisions - bug #252324
-if version_is_at_least 1.7.1 ; then
+if ver_test -ge 1.7.1; then
DEPEND+=" !dev-java/ant-tasks"
 fi
 
@@ -167,7 +168,7 @@ ant-tasks_src_install() {
java-pkg_register-ant-task --version "${ANT_TASK_PV}"
 
# create the compatibility symlink
-   if version_is_at_least 1.7.1_beta2; then
+   if ver_test -ge 1.7.1_beta2; then
dodir /usr/share/ant/lib
dosym /usr/share/${PN}/lib/${PN}.jar 
/usr/share/ant/lib/${PN}.jar
fi
-- 
2.17.0




Re: [gentoo-dev] Re: [PATCH] ant-tasks.eclass: use eapi7-ver

2018-05-22 Thread Marty E. Plummer
On Tue, May 22, 2018 at 08:27:27AM +0200, Ulrich Mueller wrote:
> >>>>> On Mon, 21 May 2018, Marty E Plummer wrote:
> 
> > On Tue, May 22, 2018 at 05:57:35AM +0200, Micha?? G??rny wrote:
> 
> [Please check you mailer configuration. It's sending MIME, but
> charset=us-ascii cannot represent these chars.]
> 
> >> Always check for old EAPIs, instead of expecting people to keep updating
> >> this forever.
> >> 
> > Would you prefer something like
> > [[ ${EAPI} ~= [0-6] ]] && inherit eapi7-ver, then?
> 
> The regexp operator is =~ not ~=. Also it will match partial
> expressions, so it will fail in EAPI 10.
> 
Fair, I knew it was something like that. Also, by the time EAPI 10 hits
this section of code should have been long culled since eapi7-ver's
functions are 'native' in EAPI 7.
> Use this instead: [[ ${EAPI:-0} == [0123456] ]]
> 
Fair enough, that should do the trick and keep everyone happy in the
long run.
> Ulrich





Re: [gentoo-dev] Re: [PATCH] ant-tasks.eclass: use eapi7-ver

2018-05-21 Thread Marty E. Plummer
On Tue, May 22, 2018 at 05:57:35AM +0200, Micha?? G??rny wrote:
> W dniu pon, 21.05.2018 o godzinie 17???03???-0500, u??ytkownik Marty E.
> Plummer napisa??:
> > Actually I just noticed that eapi7-ver can now be used for EAPI 0-6, so
> > just unconditionally use it if EAPI != 7
> > 
> > Package-Manager: Portage-2.3.36, Repoman-2.3.9
> > ---
> >  eclass/ant-tasks.eclass | 11 ++-
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
> > index e008e6eaea8..110344f712d 100644
> > --- a/eclass/ant-tasks.eclass
> > +++ b/eclass/ant-tasks.eclass
> > @@ -16,7 +16,8 @@
> >  JAVA_ANT_DISABLE_ANT_CORE_DEP=true
> >  # rewriting build.xml for are the testcases has no reason atm
> >  JAVA_PKG_BSFIX_ALL=no
> > -inherit versionator java-pkg-2 java-ant-2
> > +inherit java-pkg-2 java-ant-2
> > +[[ ${EAPI} == 7 ]] || inherit eapi7-ver
> 
> Always check for old EAPIs, instead of expecting people to keep updating
> this forever.
> 
Would you prefer something like
[[ ${EAPI} ~= [0-6] ]] && inherit eapi7-ver, then?
The way I see it, every consumer of ant-tasks is eapi 5 right now, 5 and
6 if my pull request is accepted. Once every consumer is eapi 7 or greater,
this line can be removed entirely and it won't be needing updates
'forever'.
> >  
> >  EXPORT_FUNCTIONS src_unpack src_compile src_install
> >  
> > @@ -60,12 +61,12 @@ if [[ ${PV} == *beta2* ]]; then
> > MY_PV=${PV/_beta2/beta}
> > UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src";
> > GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
> > -   ANT_TASK_PV=$(get_version_component_range 1-3)
> > +   ANT_TASK_PV=$(ver_cut 1-3)
> >  elif [[ ${PV} == *_rc* ]]; then
> > MY_PV=${PV/_rc/RC}
> > UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles";
> > GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
> > -   ANT_TASK_PV=$(get_version_component_range 1-3)
> > +   ANT_TASK_PV=$(ver_cut 1-3)
> >  else
> > # default for final releases
> > MY_PV=${PV}
> > @@ -101,7 +102,7 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
> >  fi
> >  
> >  # we need direct blockers with old ant-tasks for file collisions - bug 
> > #252324
> > -if version_is_at_least 1.7.1 ; then
> > +if ver_test -ge 1.7.1; then
> > DEPEND+=" !dev-java/ant-tasks"
> >  fi
> >  
> > @@ -167,7 +168,7 @@ ant-tasks_src_install() {
> > java-pkg_register-ant-task --version "${ANT_TASK_PV}"
> >  
> > # create the compatibility symlink
> > -   if version_is_at_least 1.7.1_beta2; then
> > +   if ver_test -ge 1.7.1_beta2; then
> > dodir /usr/share/ant/lib
> > dosym /usr/share/${PN}/lib/${PN}.jar 
> > /usr/share/ant/lib/${PN}.jar
> > fi
> 
> -- 
> Best regards,
> Micha?? G??rny
> 
> 



Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7

2018-05-21 Thread Marty E. Plummer
On Mon, May 21, 2018 at 04:47:03PM -0500, Marty E. Plummer wrote:
> On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
> > You could inherit eapi7-ver instead of versionator, which would save
> > the conditional below.
> > 
> I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
> will rework this and the other patch I sent in for that reason, then.
Here we go. The eapi != 7 conditional is needed as eapi7 is 'not
supported' by eapi7-ver because its contents are already there.
---
 eclass/java-utils-2.eclass | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 25e35c33dd2..198d8b511f3 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -15,7 +15,8 @@
 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
packages
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
-inherit eutils versionator multilib
+inherit eutils multilib
+[[ ${EAPI} == 7 ]] || inherit eapi7-ver
 
 IUSE="elibc_FreeBSD"
 
@@ -1526,8 +1527,8 @@ java-pkg_is-vm-version-eq() {
 
local vm_version="$(java-pkg_get-vm-version)"
 
-   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
-   needed_version="$(get_version_component_range 1-2 "${needed_version}")"
+   vm_version="$(ver_cut 1-2 "${vm_version}")"
+   needed_version="$(ver_cut 1-2 "${needed_version}")"
 
if [[ -z "${vm_version}" ]]; then
debug-print "Could not get JDK version from DEPEND"
-- 
2.17.0




[gentoo-dev] Re: [PATCH] ant-tasks.eclass: use eapi7-ver

2018-05-21 Thread Marty E. Plummer
Actually I just noticed that eapi7-ver can now be used for EAPI 0-6, so
just unconditionally use it if EAPI != 7

Package-Manager: Portage-2.3.36, Repoman-2.3.9
---
 eclass/ant-tasks.eclass | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
index e008e6eaea8..110344f712d 100644
--- a/eclass/ant-tasks.eclass
+++ b/eclass/ant-tasks.eclass
@@ -16,7 +16,8 @@
 JAVA_ANT_DISABLE_ANT_CORE_DEP=true
 # rewriting build.xml for are the testcases has no reason atm
 JAVA_PKG_BSFIX_ALL=no
-inherit versionator java-pkg-2 java-ant-2
+inherit java-pkg-2 java-ant-2
+[[ ${EAPI} == 7 ]] || inherit eapi7-ver
 
 EXPORT_FUNCTIONS src_unpack src_compile src_install
 
@@ -60,12 +61,12 @@ if [[ ${PV} == *beta2* ]]; then
MY_PV=${PV/_beta2/beta}
UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src";
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
-   ANT_TASK_PV=$(get_version_component_range 1-3)
+   ANT_TASK_PV=$(ver_cut 1-3)
 elif [[ ${PV} == *_rc* ]]; then
MY_PV=${PV/_rc/RC}
UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles";
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
-   ANT_TASK_PV=$(get_version_component_range 1-3)
+   ANT_TASK_PV=$(ver_cut 1-3)
 else
# default for final releases
MY_PV=${PV}
@@ -101,7 +102,7 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
 fi
 
 # we need direct blockers with old ant-tasks for file collisions - bug #252324
-if version_is_at_least 1.7.1 ; then
+if ver_test -ge 1.7.1; then
DEPEND+=" !dev-java/ant-tasks"
 fi
 
@@ -167,7 +168,7 @@ ant-tasks_src_install() {
java-pkg_register-ant-task --version "${ANT_TASK_PV}"
 
# create the compatibility symlink
-   if version_is_at_least 1.7.1_beta2; then
+   if ver_test -ge 1.7.1_beta2; then
dodir /usr/share/ant/lib
dosym /usr/share/${PN}/lib/${PN}.jar 
/usr/share/ant/lib/${PN}.jar
fi
-- 
2.17.0




Re: [gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7

2018-05-21 Thread Marty E. Plummer
On Tue, May 08, 2018 at 11:03:47AM +0200, Ulrich Mueller wrote:
> >>>>> On Tue, 8 May 2018, Marty E Plummer wrote:
> 
> > ---
> >  eclass/java-utils-2.eclass | 14 +++---
> >  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> > diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
> > index 25e35c33dd2..47bbb64ffd4 100644
> > --- a/eclass/java-utils-2.eclass
> > +++ b/eclass/java-utils-2.eclass
> > @@ -15,7 +15,7 @@
> >  # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
> > packages
> >  # that have optional Java support. In addition you can inherit java-ant-2 
> > for
> >  # Ant-based packages.
> > -inherit eutils versionator multilib
> > +has "${EAPI:-0}" 0 1 2 3 4 5 6 && inherit eutils versionator multilib
>  
> You could inherit eapi7-ver instead of versionator, which would save
> the conditional below.
> 
I didn't realize that eapi7-ver now supports 0-6 instead of just 6. I
will rework this and the other patch I sent in for that reason, then.
> >  IUSE="elibc_FreeBSD"
>  
> > @@ -1526,8 +1526,16 @@ java-pkg_is-vm-version-eq() {
>  
> > local vm_version="$(java-pkg_get-vm-version)"
>  
> > -   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
> > -   needed_version="$(get_version_component_range 1-2 "${needed_version}")"
> > +   case ${EAPI} in
> > +   0|1|2|3|4|5|6)
> > +   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
> > +   needed_version="$(get_version_component_range 1-2 
> > "${needed_version}")"
> > +   ;;
> > +   7)
> > +   vm_version="$(ver_cut 1-2 "${vm_version}")"
> > +   needed_version="$(ver_cut 1-2 "${needed_version}")"
> > +   ;;
> > +   esac
>  
> > if [[ -z "${vm_version}" ]]; then
> > debug-print "Could not get JDK version from DEPEND"
> > -- 
> > 2.17.0





[gentoo-dev] [PATCH] ant-tasks.eclass: use eapi7-ver

2018-05-21 Thread Marty E. Plummer
See also https://github.com/gentoo/gentoo/pull/8325
The above pr does a revbump and bumps EAPI to 6 for every ebuild which
uses this eclass. If we were to instead just in-place bump EAPI to 6 we
could do away with the conditional code entirely.

Package-Manager: Portage-2.3.36, Repoman-2.3.9
---
 eclass/ant-tasks.eclass | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
index e008e6eaea8..193d6af0c04 100644
--- a/eclass/ant-tasks.eclass
+++ b/eclass/ant-tasks.eclass
@@ -16,7 +16,19 @@
 JAVA_ANT_DISABLE_ANT_CORE_DEP=true
 # rewriting build.xml for are the testcases has no reason atm
 JAVA_PKG_BSFIX_ALL=no
-inherit versionator java-pkg-2 java-ant-2
+inherit java-pkg-2 java-ant-2
+if [[ ${EAPI:-0} == 6 ]]; then
+   inherit eapi7-ver
+elif [[ ${EAPI:-0} =~ [0-5] ]]; then
+   inherit versionator
+   ver_cut() {
+   get_version_component_range "$@"
+   }
+
+   ver_test() {
+   version_is_at_least "$2"
+   }
+fi
 
 EXPORT_FUNCTIONS src_unpack src_compile src_install
 
@@ -60,12 +72,12 @@ if [[ ${PV} == *beta2* ]]; then
MY_PV=${PV/_beta2/beta}
UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src";
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
-   ANT_TASK_PV=$(get_version_component_range 1-3)
+   ANT_TASK_PV=$(ver_cut 1-3)
 elif [[ ${PV} == *_rc* ]]; then
MY_PV=${PV/_rc/RC}
UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles";
GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles";
-   ANT_TASK_PV=$(get_version_component_range 1-3)
+   ANT_TASK_PV=$(ver_cut 1-3)
 else
# default for final releases
MY_PV=${PV}
@@ -101,7 +113,7 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
 fi
 
 # we need direct blockers with old ant-tasks for file collisions - bug #252324
-if version_is_at_least 1.7.1 ; then
+if ver_test -ge 1.7.1; then
DEPEND+=" !dev-java/ant-tasks"
 fi
 
@@ -167,7 +179,7 @@ ant-tasks_src_install() {
java-pkg_register-ant-task --version "${ANT_TASK_PV}"
 
# create the compatibility symlink
-   if version_is_at_least 1.7.1_beta2; then
+   if ver_test -ge 1.7.1_beta2; then
dodir /usr/share/ant/lib
dosym /usr/share/${PN}/lib/${PN}.jar 
/usr/share/ant/lib/${PN}.jar
fi
-- 
2.17.0




[gentoo-dev] [PATCH] java-utils-2.eclass: port to EAPI 7

2018-05-07 Thread Marty E. Plummer
---
 eclass/java-utils-2.eclass | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 25e35c33dd2..47bbb64ffd4 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -15,7 +15,7 @@
 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
packages
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
-inherit eutils versionator multilib
+has "${EAPI:-0}" 0 1 2 3 4 5 6 && inherit eutils versionator multilib
 
 IUSE="elibc_FreeBSD"
 
@@ -1526,8 +1526,16 @@ java-pkg_is-vm-version-eq() {
 
local vm_version="$(java-pkg_get-vm-version)"
 
-   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
-   needed_version="$(get_version_component_range 1-2 "${needed_version}")"
+   case ${EAPI} in
+   0|1|2|3|4|5|6)
+   vm_version="$(get_version_component_range 1-2 "${vm_version}")"
+   needed_version="$(get_version_component_range 1-2 
"${needed_version}")"
+   ;;
+   7)
+   vm_version="$(ver_cut 1-2 "${vm_version}")"
+   needed_version="$(ver_cut 1-2 "${needed_version}")"
+   ;;
+   esac
 
if [[ -z "${vm_version}" ]]; then
debug-print "Could not get JDK version from DEPEND"
-- 
2.17.0




Re: [gentoo-dev] [PATCH] freedict.eclass: rename dict.eclass, generalize

2018-04-25 Thread Marty E. Plummer
On Wed, Apr 25, 2018 at 08:47:16AM +0200, Ulrich Mueller wrote:
> >>>>> On Wed, 25 Apr 2018, Marty E Plummer wrote:
> 
> >> I don't see much code duplication there, so I think it would be
> >> cleaner to have a second eclass, rather than adding conditionals to
> >> the existing one.
> 
> > I mean if you take into account app-dicts/dictd-* and freedict.eclass;
> > without the above pr (which I did originally have with a new eclass,
> > until I realized that app-text/dictd's conf file hardcodes /usr/lib/dict
> > anyways so the freedict dictionaries get [at least on amd64 and other
> > targets which use/will use lib64] installed outside of the search path
> > anyways) they are all almost entirely identical with the contents of
> > freedict.eclass.
> 
> > Another thought I had was moving the src_install into dict.eclass and
> > have freedict inherit it, adding the differences.
> 
> $ egrep -v '^(#|$)' freedict.eclass | wc -l
> 18
> 
> IMHO not worth the effort for 18 lines of code. Keep it simple.
> 
> Ulrich

Still, optimization or no, if app-text/dictd is looking at /usr/lib/dict
unconditionally and the app-dict/freedict-* dict files are ending up in
/usr/lib64/dict conditionally, something needs to be fixed about that.



Re: [gentoo-dev] [PATCH] freedict.eclass: rename dict.eclass, generalize

2018-04-24 Thread Marty E. Plummer
On Wed, Apr 25, 2018 at 07:28:12AM +0200, Ulrich Mueller wrote:
> >>>>> On Tue, 24 Apr 2018, Marty E Plummer wrote:
> 
> > Reworked to be usable with app-dicts/dictd-* ebuilds to avoid code
> > duplication
> 
> I don't see much code duplication there, so I think it would be
> cleaner to have a second eclass, rather than adding conditionals to
> the existing one.
> 
I mean if you take into account app-dicts/dictd-* and freedict.eclass;
without the above pr (which I did originally have with a new eclass,
until I realized that app-text/dictd's conf file hardcodes /usr/lib/dict
anyways so the freedict dictionaries get [at least on amd64 and other
targets which use/will use lib64] installed outside of the search path
anyways) they are all almost entirely identical with the contents of
freedict.eclass.

Another thought I had was moving the src_install into dict.eclass and
have freedict inherit it, adding the differences.



Re: [gentoo-dev] [PATCH] freedict.eclass: rename dict.eclass, generalize

2018-04-24 Thread Marty E. Plummer
On Tue, Apr 24, 2018 at 11:03:44PM -0500, Marty E. Plummer wrote:
> Reworked to be usable with app-dicts/dictd-* ebuilds to avoid code
> duplication
> 
> You can reference this pull request to get an idea as to the usage.
> 
> https://github.com/gentoo/gentoo/pull/8106
> 
> Package-Manager: Portage-2.3.31, Repoman-2.3.9
Actually, looking into the dictd.confd it looks like that needs to be
modified a bit to be able to go ahead with this sort of change. Thoughts
and comments? Its my understanding that noarch flat data should go into
/lib & /usr/lib using the new abi which 17.1 uses... could be that
freedict.eclass as it exists right now is and has been wrong regarding
where the dictionaries get installed to...



[gentoo-dev] [PATCH] freedict.eclass: rename dict.eclass, generalize

2018-04-24 Thread Marty E. Plummer
Reworked to be usable with app-dicts/dictd-* ebuilds to avoid code
duplication

You can reference this pull request to get an idea as to the usage.

https://github.com/gentoo/gentoo/pull/8106

Package-Manager: Portage-2.3.31, Repoman-2.3.9
---
 eclass/dict.eclass | 75 ++
 eclass/freedict.eclass | 51 
 2 files changed, 75 insertions(+), 51 deletions(-)
 create mode 100644 eclass/dict.eclass
 delete mode 100644 eclass/freedict.eclass

diff --git a/eclass/dict.eclass b/eclass/dict.eclass
new file mode 100644
index 000..8d523e3863e
--- /dev/null
+++ b/eclass/dict.eclass
@@ -0,0 +1,75 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: dict.eclass
+# @MAINTAINER:
+# maintainer-nee...@gentoo.org
+# @AUTHOR:
+# Original author: Seemant Kulleen
+# @BLURB: Ease the installation of dict and freedict translation dictionaries
+# @DESCRIPTION:
+# This eclass exists to ease the installation of dictd and freedictd 
translation
+# dictionaries.  The only variables which need to be defined in the actual
+# ebuilds are FORLANG and TOLANG for the source and target languages,
+# respectively, and DICTS if the package ships more than one dictionary
+# and cannot be determined from ${PN}.
+
+# @ECLASS-VARIABLE: DICTS
+# @DESCRIPTION:
+# Array of dictionary files (foo.dict.dz and foo.index) to be installed during
+# dict_src_install.
+
+# @ECLASS-VARIABLE: FORLANG
+# @DESCRIPTION:
+# Please see above for a description.
+
+# @ECLASS-VARIABLE: TOLANG
+# @DESCRIPTION:
+# Please see above for a description.
+
+if [[ -z ${_DICT_ECLASS} ]]; then
+_DICT_ECLASS=1
+
+case ${EAPI:-0} in
+   6) ;;
+   *) die "${ECLASS}.eclass is banned in EAPI=${EAPI}" ;;
+esac
+
+if [[ ${PN} == *freedict-* ]]; then
+   MY_P=${PN/freedict-/}
+   DICTS=( ${MY_P} )
+
+   DESCRIPTION="Freedict for language translation from ${FORLANG} to 
${TOLANG}"
+   HOMEPAGE="http://freedict.sourceforge.net/";
+   SRC_URI="http://freedict.sourceforge.net/download/linux/${MY_P}.tar.gz";
+elif [[ ${PN} == *dictd-* ]]; then
+   MY_P=${PN/dictd-/}
+   DICTS=( ${MY_P} )
+
+   DESCRIPTION="${MY_P} dictionary for dictd"
+   HOMEPAGE="http://www.dict.org/";
+fi
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE=""
+
+RDEPEND="app-text/dictd"
+
+S="${WORKDIR}"
+
+# @FUNCTION: dict_src_install
+# @DESCRIPTION:
+# The freedict src_install function, which is exported
+dict_src_install() {
+   insinto /usr/$(get_libdir)/dict
+   for dict in "${DICTS[@]}"; do
+   doins ${dict}.dict.dz
+   doins ${dict}.index
+   done
+   einstalldocs
+}
+
+EXPORT_FUNCTIONS src_install
+
+fi
diff --git a/eclass/freedict.eclass b/eclass/freedict.eclass
deleted file mode 100644
index b795f53f954..000
--- a/eclass/freedict.eclass
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# @ECLASS: freedict.eclass
-# @MAINTAINER:
-# maintainer-nee...@gentoo.org
-# @AUTHOR:
-# Original author: Seemant Kulleen
-# @BLURB: Ease the installation of freedict translation dictionaries
-# @DESCRIPTION:
-# This eclass exists to ease the installation of freedict translation
-# dictionaries.  The only variables which need to be defined in the actual
-# ebuilds are FORLANG and TOLANG for the source and target languages,
-# respectively.
-
-# @ECLASS-VARIABLE: FORLANG
-# @DESCRIPTION:
-# Please see above for a description.
-
-# @ECLASS-VARIABLE: TOLANG
-# @DESCRIPTION:
-# Please see above for a description.
-
-case ${EAPI:-0} in
-   6) ;;
-   *) die "${ECLASS}.eclass is banned in EAPI=${EAPI}" ;;
-esac
-
-MY_P=${PN/freedict-/}
-
-DESCRIPTION="Freedict for language translation from ${FORLANG} to ${TOLANG}"
-HOMEPAGE="http://freedict.sourceforge.net/";
-SRC_URI="http://freedict.sourceforge.net/download/linux/${MY_P}.tar.gz";
-
-LICENSE="GPL-2+"
-SLOT="0"
-
-RDEPEND="app-text/dictd"
-
-S="${WORKDIR}"
-
-# @FUNCTION: freedict_src_install
-# @DESCRIPTION:
-# The freedict src_install function, which is exported
-freedict_src_install() {
-   insinto /usr/$(get_libdir)/dict
-   doins ${MY_P}.dict.dz
-   doins ${MY_P}.index
-}
-
-EXPORT_FUNCTIONS src_install
-- 
2.17.0




[gentoo-dev] [PATCH] eutils.eclass: split unique functions into eutils-r1

2018-04-08 Thread Marty E. Plummer
Split all functions unique to eutils into eutils-r1, and inherit it
from eutils. Issue a QA warning on EAPI=6 ebuilds using eutils directly
and suggest migrating to direct use of the needed eclass, with a list of
functions unique to eutils-r1.

With this we can start moving ebuilds which inherit eutils because they
need a function unique to the old eutils to eutils-r1, while being able
to single out ebuilds which used eutils to inherit other ebuilds lazily
or just cargo cult coding of always inheriting eutils.

Package-Manager: Portage-2.3.28, Repoman-2.3.9
---
 eclass/eutils-r1.eclass | 265 
 eclass/eutils.eclass| 253 ++
 2 files changed, 278 insertions(+), 240 deletions(-)
 create mode 100644 eclass/eutils-r1.eclass

diff --git a/eclass/eutils-r1.eclass b/eclass/eutils-r1.eclass
new file mode 100644
index 000..93fd0be7928
--- /dev/null
+++ b/eclass/eutils-r1.eclass
@@ -0,0 +1,265 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: eutils-r1.eclass
+# @MAINTAINER:
+# base-sys...@gentoo.org
+# @BLURB: many extra (but common) functions that are used in ebuilds
+# @DESCRIPTION:
+# The eutils eclass contains a suite of functions that complement
+# the ones that ebuild.sh already contain.  The idea is that the functions
+# are not required in all ebuilds but enough utilize them to have a common
+# home rather than having multiple ebuilds implementing the same thing.
+#
+# Due to the nature of this eclass, some functions may have maintainers
+# different from the overall eclass!
+
+if [[ -z ${_EUTILS_R1_ECLASS} ]]; then
+_EUTILS_R1_ECLASS=1
+
+case ${EAPI:-0} in
+   6) ;;
+   *) [[ ${_EUTILS_ECLASS} == 1 ]] || die "${ECLASS}.eclass is banned n 
EAPI=${EAPI}" ;;
+esac
+
+# @FUNCTION: eqawarn
+# @USAGE: [message]
+# @DESCRIPTION:
+# Proxy to ewarn for package managers that don't provide eqawarn and use the PM
+# implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev
+# profile.
+if ! declare -F eqawarn >/dev/null ; then
+   eqawarn() {
+   has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@"
+   :
+   }
+fi
+
+# @FUNCTION: emktemp
+# @USAGE: [temp dir]
+# @DESCRIPTION:
+# Cheap replacement for when debianutils (and thus mktemp)
+# does not exist on the users system.
+emktemp() {
+   local exe="touch"
+   [[ $1 == -d ]] && exe="mkdir" && shift
+   local topdir=$1
+
+   if [[ -z ${topdir} ]] ; then
+   [[ -z ${T} ]] \
+   && topdir="/tmp" \
+   || topdir=${T}
+   fi
+
+   if ! type -P mktemp > /dev/null ; then
+   # system lacks `mktemp` so we have to fake it
+   local tmp=/
+   while [[ -e ${tmp} ]] ; do
+   tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}
+   done
+   ${exe} "${tmp}" || ${exe} -p "${tmp}"
+   echo "${tmp}"
+   else
+   # the args here will give slightly wierd names on BSD,
+   # but should produce a usable file on all userlands
+   if [[ ${exe} == "touch" ]] ; then
+   TMPDIR="${topdir}" mktemp -t tmp.XX
+   else
+   TMPDIR="${topdir}" mktemp -dt tmp.XX
+   fi
+   fi
+}
+
+# @FUNCTION: edos2unix
+# @USAGE:  [more files ...]
+# @DESCRIPTION:
+# A handy replacement for dos2unix, recode, fixdos, etc...  This allows you
+# to remove all of these text utilities from DEPEND variables because this
+# is a script based solution.  Just give it a list of files to convert and
+# they will all be changed from the DOS CRLF format to the UNIX LF format.
+edos2unix() {
+   [[ $# -eq 0 ]] && return 0
+   sed -i 's/\r$//' -- "$@" || die
+}
+
+# @FUNCTION: strip-linguas
+# @USAGE: [|<-i|-u> ]
+# @DESCRIPTION:
+# Make sure that LINGUAS only contains languages that
+# a package can support.  The first form allows you to
+# specify a list of LINGUAS.  The -i builds a list of po
+# files found in all the directories and uses the
+# intersection of the lists.  The -u builds a list of po
+# files found in all the directories and uses the union
+# of the lists.
+strip-linguas() {
+   local ls newls nols
+   if [[ $1 == "-i" ]] || [[ $1 == "-u" ]] ; then
+   local op=$1; shift
+   ls=$(find "$1" -name '*.po' -exec basename {} .po ';'); shift
+   local d f
+   for d in "$@" ; do
+   if [[ ${op} == "-u" ]] ; then
+   newls=${ls}
+   else
+   newls=""
+   fi
+   for f in $(find "$d" -name '*.po' -exec basename {} .po 
';') ; do
+   if [[ ${op} == "-i" ]] ; then
+   has $

[gentoo-dev] [PATCH] java-vm-2.eclass: fdo-mime->xdg-utils migration

2018-04-08 Thread Marty E. Plummer
This is the only eclass left which uses it. Switch over.

Package-Manager: Portage-2.3.28, Repoman 2.3.9
---
 eclass/java-vm-2.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass
index 9deef1c8eed..82cfe4d3e3e 100644
--- a/eclass/java-vm-2.eclass
+++ b/eclass/java-vm-2.eclass
@@ -14,7 +14,7 @@ case ${EAPI:-0} in
*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-inherit fdo-mime multilib pax-utils prefix
+inherit multilib pax-utils prefix xdg-utils
 
 EXPORT_FUNCTIONS pkg_setup pkg_postinst pkg_prerm pkg_postrm
 
@@ -86,7 +86,7 @@ java-vm-2_pkg_postinst() {
fi
fi
 
-   fdo-mime_desktop_database_update
+   xdg_desktop_database_update
 }
 
 
@@ -112,7 +112,7 @@ java-vm-2_pkg_prerm() {
 # Update mime database.
 
 java-vm-2_pkg_postrm() {
-   fdo-mime_desktop_database_update
+   xdg_desktop_database_update
 }
 
 
-- 
2.17.0




Re: [gentoo-dev] [PATCH] eclass: freedict: require EAPI=6

2018-04-04 Thread Marty E. Plummer
On Wed, Apr 04, 2018 at 02:20:13PM +0200, Ulrich Mueller wrote:
> > On Wed, 04 Apr 2018, Aaron Bauman wrote:
> 
> > Marty, I will get this merged today. I apologize for the delay.
> 
> Already done. :) One tiny change, namely I've added a trailing slash
> to the URL of the homepage.
> 
> Thanks,
> Ulrich

Many thanks, now to continue my war against deprecated code!



Re: [gentoo-dev] [PATCH] eclass: freedict: require EAPI=6

2018-04-04 Thread Marty E. Plummer
Any action on this?

On Wed, Mar 28, 2018 at 10:52:40AM +0200, Ulrich Mueller wrote:
> >>>>> On Wed, 28 Mar 2018, Marty E Plummer wrote:
> 
> > How's this:
> 
> Looks good to me.
> 
> > ---
> >  eclass/freedict.eclass | 18 ++
> >  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> > diff --git a/eclass/freedict.eclass b/eclass/freedict.eclass
> > index 06419626d34..7c598aa6eaf 100644
> > --- a/eclass/freedict.eclass
> > +++ b/eclass/freedict.eclass
> > @@ -1,4 +1,4 @@
> > -# Copyright 1999-2014 Gentoo Foundation
> > +# Copyright 1999-2018 Gentoo Foundation
> >  # Distributed under the terms of the GNU General Public License v2
>  
> >  # @ECLASS: freedict.eclass
> > @@ -21,21 +21,23 @@
> >  # @DESCRIPTION:
> >  # Please see above for a description.
>  
> > -inherit eutils multilib
> > -
> > -IUSE=""
> > +case ${EAPI:-0} in
> > +   6) ;;
> > +   *) die "${ECLASS}.eclass is banned in EAPI=${EAPI}" ;;
> > +esac
>  
> >  MY_P=${PN/freedict-/}
>  
> > -S="${WORKDIR}"
> >  DESCRIPTION="Freedict for language translation from ${FORLANG} to 
> > ${TOLANG}"
> > -HOMEPAGE="http://www.freedict.de";
> > +HOMEPAGE="http://freedict.sourceforge.net";
> >  SRC_URI="http://freedict.sourceforge.net/download/linux/${MY_P}.tar.gz";
>  
> > +LICENSE="GPL-2+"
> >  SLOT="0"
> > -LICENSE="GPL-2"
>  
> > -DEPEND="app-text/dictd"
> > +RDEPEND="app-text/dictd"
> > +
> > +S="${WORKDIR}"
>  
> >  # @FUNCTION: freedict_src_install
> >  # @DESCRIPTION:
> > -- 
> > 2.16.3
> 
> 
> 



Re: [gentoo-dev] [PATCH] eclass: freedict: require EAPI=6

2018-03-28 Thread Marty E. Plummer
On Tue, Mar 27, 2018 at 11:20:08AM +0200, Ulrich Mueller wrote:
> While at it:
> - Drop the IUSE="" assignment, it is useless (pun intended :)
> - Update HOMEPAGE, freedict.de is dead
> - LICENSE should be "GPL-2+" (sources say "GNU General Public License
>   ver. 2.0 and any later version")
> - DEPEND is not needed (should be RDEPEND instead, I guess)
> - Use canonical ordering of variables (DESCRIPTION, HOMEPAGE, SRC_URI
>   in first block; LICENSE, SLOT in second; then dependencies; then S)
> 
> Ulrich
>
How's this:

---
 eclass/freedict.eclass | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/eclass/freedict.eclass b/eclass/freedict.eclass
index 06419626d34..7c598aa6eaf 100644
--- a/eclass/freedict.eclass
+++ b/eclass/freedict.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: freedict.eclass
@@ -21,21 +21,23 @@
 # @DESCRIPTION:
 # Please see above for a description.
 
-inherit eutils multilib
-
-IUSE=""
+case ${EAPI:-0} in
+   6) ;;
+   *) die "${ECLASS}.eclass is banned in EAPI=${EAPI}" ;;
+esac
 
 MY_P=${PN/freedict-/}
 
-S="${WORKDIR}"
 DESCRIPTION="Freedict for language translation from ${FORLANG} to ${TOLANG}"
-HOMEPAGE="http://www.freedict.de";
+HOMEPAGE="http://freedict.sourceforge.net";
 SRC_URI="http://freedict.sourceforge.net/download/linux/${MY_P}.tar.gz";
 
+LICENSE="GPL-2+"
 SLOT="0"
-LICENSE="GPL-2"
 
-DEPEND="app-text/dictd"
+RDEPEND="app-text/dictd"
+
+S="${WORKDIR}"
 
 # @FUNCTION: freedict_src_install
 # @DESCRIPTION:
-- 
2.16.3




  1   2   >