Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Ulrich Mueller
Maybe this is a stupid question, but what is USE=deblob doing these days
anyway? I thought that all nonfree firmware had been removed from the
kernel tree (with version 4.14) and was provided separately by the
sys-kernel/linux-firmware package?

Also, if I grep for K_DEBLOB_AVAILABLE in sys-kernel, I see it only in
rt-sources but nowhere else.

Ulrich


signature.asc
Description: PGP signature


Re: [gentoo-dev] [PATCH] eclass/vim-plugin.eclass: delete if has_version condition.

2021-07-22 Thread Sam James


> On 22 Jul 2021, at 09:32, Patrice Clement  wrote:
> 
> Thursday 22 Jul 2021 04:44:39, Sam James wrote :
>> 
>>> [snip]
>> 
>> The patch itself seems fine, but I have some suggestions while we're
>> working on the eclass:
>> 
>> [snip]

>> Let me know if you need any assistance, etc.
>> 
>> thanks,
>> sam
>> 

> Thanks for the suggestions. If you don't mind, I'd like to stick to the
> original changes for now and address your suggestions later in a follow up
> patch.

It's preferred [0] where, if we know more changes are coming, to batch them up,
unless this is really critical. This is because of needless cache regeneration.

It's generally not a reason to block fixing something if no other issues exist, 
but it
is a reason to stop and pause/reflect if there are any other low-hanging fruit 
we could fix while there.

A lot of this is straightforward tidying. I don't mind if you're sure you will 
be able to return
to it shortly, but then I figure, why not just do it now?

[0] 
https://devmanual.gentoo.org/eclass-writing/index.html#adding-and-updating-eclasses
 (see the "Note")

thanks,
sam


signature.asc
Description: Message signed with OpenPGP


Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread David Seifert
On Fri, 2021-07-23 at 03:23 +0900, Alice wrote:
> On 7/23/21 3:08 AM, David Seifert wrote:
> > On Fri, 2021-07-23 at 02:56 +0900, Alice wrote:
> > > On 7/23/21 2:29 AM, Michał Górny wrote:
> > > > I'm saying that instead of printing ewarn for old kernels you
> > > > should
> > > > just disable the whole logic in eclass for old kernels.
> > > Disabling everything by K_DEBLOB_AVAILABLE = 0 is what I did at
> > > first,
> > > but I still prefer to warn the user until old ebuild get removed
> > > of
> > > the
> > > deblob USE flag.
> > 
> > This is confusing and not how we do things in Gentoo normally.
> > 
> > 
> 
> what do you suggest as the Gentoo normal way ?

Just unset the var in the eclass as mgorny suggested?




[gentoo-dev] [PATCH] eclass/postgres.eclass: migrate to GLEP 81

2021-07-22 Thread Conrad Kostecki
This update drops the function 'postgres_new_user', which was used to
create the 'postgres' user and group.

Additionally, this function accepted an argument to create a specified
user, which will be added to the 'postgres' group. This function is used
by exactly one package: dev-db/pgpool2.

With GLEP 81, such function is not needed anymore, as this can be easily
handled by the acct-* packages for dev-db/pgpool2.

Since many other packages depend on the 'postgres' and 'postgres-multi'
eclass, adding the core acct-*/postgres packages here to [R]DEPEND.

Before merging this eclass patch, acct-* packages will be added to
the tree. Afterwards, dev-db/pgpool2 will be migrated away from
'postgres_new_user'. After the eclass patch has been applied,
dev-db/postgres can be revbumped, so all users will get the acct-*
packages.

Signed-off-by: Conrad Kostecki 
---
 eclass/postgres.eclass | 31 +--
 1 file changed, 5 insertions(+), 26 deletions(-)

diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
index 7652a862518..9b4097e0052 100644
--- a/eclass/postgres.eclass
+++ b/eclass/postgres.eclass
@@ -1,7 +1,6 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-inherit user
 EXPORT_FUNCTIONS pkg_setup
 
 # @ECLASS: postgres.eclass
@@ -119,31 +118,11 @@ postgres_check_slot() {
fi
 }
 
-# @FUNCTION: postgres_new_user
-# @USAGE: [user [(uid|-1) [(shell|-1) [(homedir|-1) [groups]
-# @DESCRIPTION:
-# Creates the "postgres" system group and user -- which is separate from
-# the database user -- and, optionally, the developer defined user. There
-# are no required parameters.
-#
-# When given a user to create, it'll be created with the next available
-# uid, default shell set to /bin/false, default homedir is /dev/null,
-# and added to the "postgres" system group. You can use "-1" to skip any
-# parameter except user or groups.
-postgres_new_user() {
-   enewgroup postgres 70
-   enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
-
-   if [[ $# -gt 0 ]] ; then
-   if [[ "$1" = "postgres" ]] ; then
-   ewarn "Username 'postgres' implied, skipping"
-   else
-   local groups=$5
-   [[ -n "${groups}" ]] && groups+=",postgres" || 
groups="postgres"
-   enewuser "$1" "${2:--1}" "${3:--1}" "${4:--1}" 
"${groups}"
-   fi
-   fi
-}
+RDEPEND="
+   acct-group/postgres
+   acct-user/postgres
+"
+DEPEND="${RDEPEND}"
 
 # @FUNCTION: postgres_pkg_setup
 # @DESCRIPTION:
-- 
2.32.0




Re: [gentoo-dev] [PATCH] eclass/postgres.eclass: migrate to GLEP 81

2021-07-22 Thread Michael Orlitzky
On Fri, 2021-07-23 at 00:20 +0200, Conrad Kostecki wrote:
> This update drops the function 'postgres_new_user', which was used to
> create the 'postgres' user and group.
> 
> ...
> 
> Since many other packages depend on the 'postgres' and 'postgres-multi'
> eclass, adding the core acct-*/postgres packages here to [R]DEPEND.

Not all packages using the eclass necessarily need the "postgres"
user/group to build/run. You should only add (R)DEPEND in the packages
that actually call postgres_new_user, I think?


> 
> Before merging this eclass patch, acct-* packages will be added to
> the tree.

Before doing this, please double-check that SHELL=/bin/bash and
HOME=/var/lib/postgres are needed. It's likely that the default HOME
can be used, and that dev-db/postgresql (which actually *uses*
/var/lib/postgres) should control its permissions.

You should also get an ACK from titanofold, since he's been maintaining
postgresql essentially by himself forever (and may have some insight
into the SHELL/HOME items).





[gentoo-dev] [PATCH] eclass/vim-plugin.eclass: delete if has_version condition.

2021-07-22 Thread Patrice Clement
... and replace it with a test against the REPLACING_VERSIONS variable.

See https://projects.gentoo.org/pms/8/pms.html#x1-10900011.1.

This is an updated version of the same patch discussed previously on this ML.

Suggested by Arfrever.
---
 eclass/vim-plugin.eclass | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index 6b72d66111d..460edcce3eb 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -126,31 +126,31 @@ update_vim_afterscripts() {
 display_vim_plugin_help() {
local h
 
-   if ! has_version ${CATEGORY}/${PN} ; then
-   if [[ -n "${VIM_PLUGIN_HELPFILES}" ]] ; then
+   if [[ -z ${REPLACING_VERSIONS} ]]; then
+   if [[ -n ${VIM_PLUGIN_HELPFILES} ]]; then
elog " "
elog "This plugin provides documentation via vim's help 
system. To"
elog "view it, use:"
-   for h in ${VIM_PLUGIN_HELPFILES} ; do
+   for h in ${VIM_PLUGIN_HELPFILES}; do
elog ":help ${h}"
done
elog " "
 
-   elif [[ -n "${VIM_PLUGIN_HELPTEXT}" ]] ; then
+   elif [[ -n ${VIM_PLUGIN_HELPTEXT} ]]; then
elog " "
while read h ; do
elog "$h"
done <<<"${VIM_PLUGIN_HELPTEXT}"
elog " "
 
-   elif [[ -n "${VIM_PLUGIN_HELPURI}" ]] ; then
+   elif [[ -n ${VIM_PLUGIN_HELPURI} ]]; then
elog " "
elog "Documentation for this plugin is available online 
at:"
elog "${VIM_PLUGIN_HELPURI}"
elog " "
fi
 
-   if has "filetype" "${VIM_PLUGIN_MESSAGES}" ; then
+   if has filetype ${VIM_PLUGIN_MESSAGES}; then
elog "This plugin makes use of filetype settings. To 
enable these,"
elog "add lines like:"
elog "filetype plugin on"
-- 
2.31.1




Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Alice

On 7/23/21 12:02 AM, Michał Górny wrote:

use deblob

was already there I'm not adding it


OpenPGP_0x1D6802D75C10FEF6.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature


Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Alice

On 7/23/21 12:43 AM, Michał Górny wrote:

On Fri, 2021-07-23 at 00:24 +0900, Alice wrote:

On 7/23/21 12:02 AM, Michał Górny wrote:

Why are you adding the USE flag for these kernels then?  It's misleading
at best.


ah I just understand what are you asking.
that's right the USE flag on such kernel should be removed,
but I think is something that we can do in a next release of such kernel
and after removing this part from the eclass.


Why not just unset the var in eclass?



Because deblob works with python3 for kernel that are more recent than 
5.4 excluded. so I'm deprecating old kernel deblob that still use python 
2.7 and keep it for most recent one that can use python3.


OpenPGP_0x1D6802D75C10FEF6.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature


[gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Alice


Signed-off-by: Alice Ferrazzi 
---
 eclass/kernel-2.eclass | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index f94dd9c..05f8161 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -605,7 +605,7 @@ if [[ ${ETYPE} == sources ]]; then
kernel_is le 2 6 ${DEBLOB_MAX_VERSION} && \
K_DEBLOB_AVAILABLE=1
if [[ ${K_DEBLOB_AVAILABLE} == 1 ]]; then
-   PYTHON_COMPAT=( python2_7 )
+   PYTHON_COMPAT=( python3_{7..10} )

inherit python-any-r1

@@ -1489,9 +1489,14 @@ kernel-2_src_compile() {
[[ ${ETYPE} == headers ]] && compile_headers

if [[ ${K_DEBLOB_AVAILABLE} == 1 ]] && use deblob; then
-   einfo ">>> Running deblob script ..."
-   python_setup
-   sh "${T}/${DEBLOB_A}" --force || die "Deblob script 
failed to run!!!"

+   # deblob less than 5.10 require python 2.7
+   if kernel_is lt 5 10; then
+   ewarn "we don't support deblob for kernel less 
then 5.10"

+   else
+   einfo ">>> Running deblob script ..."
+   python_setup
+   sh "${T}/${DEBLOB_A}" --force || die "Deblob 
script failed to run!!!"

+   fi
fi
 }

--
2.25.3


OpenPGP_0x1D6802D75C10FEF6.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature


Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Michał Górny
On Fri, 2021-07-23 at 00:00 +0900, Alice wrote:
> Signed-off-by: Alice Ferrazzi 
> ---
>   eclass/kernel-2.eclass | 13 +
>   1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
> index f94dd9c..05f8161 100644
> --- a/eclass/kernel-2.eclass
> +++ b/eclass/kernel-2.eclass
> @@ -605,7 +605,7 @@ if [[ ${ETYPE} == sources ]]; then
>  kernel_is le 2 6 ${DEBLOB_MAX_VERSION} && \
>  K_DEBLOB_AVAILABLE=1
>  if [[ ${K_DEBLOB_AVAILABLE} == 1 ]]; then
> -   PYTHON_COMPAT=( python2_7 )
> +   PYTHON_COMPAT=( python3_{7..10} )
> 
>  inherit python-any-r1
> 
> @@ -1489,9 +1489,14 @@ kernel-2_src_compile() {
>  [[ ${ETYPE} == headers ]] && compile_headers
> 
>  if [[ ${K_DEBLOB_AVAILABLE} == 1 ]] && use deblob; then
> -   einfo ">>> Running deblob script ..."
> -   python_setup
> -   sh "${T}/${DEBLOB_A}" --force || die "Deblob script 
> failed to run!!!"
> +   # deblob less than 5.10 require python 2.7
> +   if kernel_is lt 5 10; then
> +   ewarn "we don't support deblob for kernel less 
> then 5.10"

Why are you adding the USE flag for these kernels then?  It's misleading
at best.

> +   else
> +   einfo ">>> Running deblob script ..."
> +   python_setup
> +   sh "${T}/${DEBLOB_A}" --force || die "Deblob 
> script failed to run!!!"
> +   fi
>  fi
>   }
> 

-- 
Best regards,
Michał Górny





Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Alice

On 7/23/21 12:21 AM, Alice wrote:

On 7/23/21 12:02 AM, Michał Górny wrote:

use deblob

was already there I'm not adding it

please ignore this


OpenPGP_0x1D6802D75C10FEF6.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature


Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Alice

On 7/23/21 12:02 AM, Michał Górny wrote:

Why are you adding the USE flag for these kernels then?  It's misleading
at best.


ah I just understand what are you asking.
that's right the USE flag on such kernel should be removed,
but I think is something that we can do in a next release of such kernel 
and after removing this part from the eclass.


OpenPGP_0x1D6802D75C10FEF6.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature


Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Michał Górny
On Fri, 2021-07-23 at 00:24 +0900, Alice wrote:
> On 7/23/21 12:02 AM, Michał Górny wrote:
> > Why are you adding the USE flag for these kernels then?  It's misleading
> > at best.
> 
> ah I just understand what are you asking.
> that's right the USE flag on such kernel should be removed,
> but I think is something that we can do in a next release of such kernel 
> and after removing this part from the eclass.

Why not just unset the var in eclass?

-- 
Best regards,
Michał Górny





Re: [gentoo-dev] [PATCH] eclass/vim-plugin.eclass: delete if has_version condition.

2021-07-22 Thread Patrice Clement
Wednesday 21 Jul 2021 19:16:36, Ulrich Mueller wrote :
> > On Wed, 21 Jul 2021, Patrice Clement wrote:
> 
> > +   if [[ -n "${VIM_PLUGIN_HELPFILES}" ]]; then
> 
> Quotation marks are not necessary here (and three more times below,
> in the elif lines).

Thanks, this has been mended.




Re: [gentoo-dev] [PATCH] eclass/vim-plugin.eclass: delete if has_version condition.

2021-07-22 Thread Patrice Clement
Thursday 22 Jul 2021 04:44:39, Sam James wrote :
> 
> 
> > On 21 Jul 2021, at 17:47, Patrice Clement  wrote:
> > 
> > ... and replace it with a test against the REPLACING_VERSIONS variable.
> > 
> > See https://projects.gentoo.org/pms/8/pms.html#x1-10900011.1.
> > 
> > Patch courtesy of Arfrever.
> > 
> 
> Ideally, we'd use Arfrever's sign off, but this is kind of a grey
> area, so it's not a blocker at all right now.
> 
> > Closes: https://github.com/gentoo/gentoo/pull/21733
> > Signed-off-by: Patrice Clement 
> > ---
> > eclass/vim-plugin.eclass | 12 ++--
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
> > index 6b72d66111d..460edcce3eb 100644
> > --- a/eclass/vim-plugin.eclass
> > +++ b/eclass/vim-plugin.eclass
> > [snip]
> 
> The patch itself seems fine, but I have some suggestions while we're
> working on the eclass:
> 
> - Add EAPI 8 support
> 
> - Please drop obsolete EAPI compatibility hacks like:
> >has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
> 
> This is unnecessary because we're only declaring support for EAPI 6 and 7 
> right now.
> 
> - Could you please convert POSIX tests to Bash tests? [0]
> 
> - In update_vim_afterscripts, the einfo seems (at first glance) to be 
> misleading. Should
> it be printing ${afterdir} instead?
> 
> - Ideally, we'd add the standard inherit guard if possible (see e.g. 
> gnuconfig.eclass for a simple example).
> 
> [0] 
> https://devmanual.gentoo.org/tools-reference/bash/#single-versus-double-brackets-in-bash
> 
> Let me know if you need any assistance, etc.
> 
> thanks,
> sam
> 
> 
> 
> 

Thanks for the suggestions. If you don't mind, I'd like to stick to the
original changes for now and address your suggestions later in a follow up
patch.

Best,




Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Alice

On 7/23/21 3:08 AM, David Seifert wrote:

On Fri, 2021-07-23 at 02:56 +0900, Alice wrote:

On 7/23/21 2:29 AM, Michał Górny wrote:

I'm saying that instead of printing ewarn for old kernels you should
just disable the whole logic in eclass for old kernels.

Disabling everything by K_DEBLOB_AVAILABLE = 0 is what I did at first,
but I still prefer to warn the user until old ebuild get removed of
the
deblob USE flag.


This is confusing and not how we do things in Gentoo normally.




what do you suggest as the Gentoo normal way ?


OpenPGP_0x1D6802D75C10FEF6.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature


Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Michał Górny
On Fri, 2021-07-23 at 00:47 +0900, Alice wrote:
> On 7/23/21 12:43 AM, Michał Górny wrote:
> > On Fri, 2021-07-23 at 00:24 +0900, Alice wrote:
> > > On 7/23/21 12:02 AM, Michał Górny wrote:
> > > > Why are you adding the USE flag for these kernels then?  It's misleading
> > > > at best.
> > > 
> > > ah I just understand what are you asking.
> > > that's right the USE flag on such kernel should be removed,
> > > but I think is something that we can do in a next release of such kernel
> > > and after removing this part from the eclass.
> > 
> > Why not just unset the var in eclass?
> > 
> 
> Because deblob works with python3 for kernel that are more recent than 
> 5.4 excluded. so I'm deprecating old kernel deblob that still use python 
> 2.7 and keep it for most recent one that can use python3.

I'm saying that instead of printing ewarn for old kernels you should
just disable the whole logic in eclass for old kernels.

-- 
Best regards,
Michał Górny





Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread David Seifert
On Fri, 2021-07-23 at 02:56 +0900, Alice wrote:
> On 7/23/21 2:29 AM, Michał Górny wrote:
> > I'm saying that instead of printing ewarn for old kernels you should
> > just disable the whole logic in eclass for old kernels.
> Disabling everything by K_DEBLOB_AVAILABLE = 0 is what I did at first,
> but I still prefer to warn the user until old ebuild get removed of
> the 
> deblob USE flag.

This is confusing and not how we do things in Gentoo normally.




Re: [gentoo-dev] [PATCH] Add deblob support only for python3

2021-07-22 Thread Alice

On 7/23/21 2:29 AM, Michał Górny wrote:

I'm saying that instead of printing ewarn for old kernels you should
just disable the whole logic in eclass for old kernels.
Disabling everything by K_DEBLOB_AVAILABLE = 0 is what I did at first, 
but I still prefer to warn the user until old ebuild get removed of the 
deblob USE flag.


OpenPGP_0x1D6802D75C10FEF6.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature


Re: [gentoo-dev] Packages up for grab

2021-07-22 Thread Peter Stuge
Marco Scardovi wrote:
> mail-filter/bogofilter

I'd like to proxy-maintain this.


//Peter



Re: [gentoo-dev] [PATCH] eclass/vim-plugin.eclass: delete if has_version condition.

2021-07-22 Thread Patrice Clement
Thursday 22 Jul 2021 10:54:02, Patrice Clement wrote :
> ... and replace it with a test against the REPLACING_VERSIONS variable.
> 
> See https://projects.gentoo.org/pms/8/pms.html#x1-10900011.1.
> 
> This is an updated version of the same patch discussed previously on this ML.
> 
> Suggested by Arfrever.
> ---
>  eclass/vim-plugin.eclass | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
> index 6b72d66111d..460edcce3eb 100644
> --- a/eclass/vim-plugin.eclass
> +++ b/eclass/vim-plugin.eclass
> @@ -126,31 +126,31 @@ update_vim_afterscripts() {
>  display_vim_plugin_help() {
>   local h
>  
> - if ! has_version ${CATEGORY}/${PN} ; then
> - if [[ -n "${VIM_PLUGIN_HELPFILES}" ]] ; then
> + if [[ -z ${REPLACING_VERSIONS} ]]; then
> + if [[ -n ${VIM_PLUGIN_HELPFILES} ]]; then
>   elog " "
>   elog "This plugin provides documentation via vim's help 
> system. To"
>   elog "view it, use:"
> - for h in ${VIM_PLUGIN_HELPFILES} ; do
> + for h in ${VIM_PLUGIN_HELPFILES}; do
>   elog ":help ${h}"
>   done
>   elog " "
>  
> - elif [[ -n "${VIM_PLUGIN_HELPTEXT}" ]] ; then
> + elif [[ -n ${VIM_PLUGIN_HELPTEXT} ]]; then
>   elog " "
>   while read h ; do
>   elog "$h"
>   done <<<"${VIM_PLUGIN_HELPTEXT}"
>   elog " "
>  
> - elif [[ -n "${VIM_PLUGIN_HELPURI}" ]] ; then
> + elif [[ -n ${VIM_PLUGIN_HELPURI} ]]; then
>   elog " "
>   elog "Documentation for this plugin is available online 
> at:"
>   elog "${VIM_PLUGIN_HELPURI}"
>   elog " "
>   fi
>  
> - if has "filetype" "${VIM_PLUGIN_MESSAGES}" ; then
> + if has filetype ${VIM_PLUGIN_MESSAGES}; then
>   elog "This plugin makes use of filetype settings. To 
> enable these,"
>   elog "add lines like:"
>   elog "filetype plugin on"
> -- 
> 2.31.1
> 
> 

Merged. Thanks ulm for the review!