[gentoo-dev] [PATCH v2 5/5] check-reqs.eclass: Repl. I_KNOW_WHAT_I_AM_DOING w/ CHECKREQS_DONOTHING

2021-07-22 Thread Andreas Sturmlechner
Signed-off-by: Andreas Sturmlechner 
---
 eclass/check-reqs.eclass | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index 39e4bad1363..836dd0d4a1f 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -68,6 +68,13 @@ _CHECK_REQS_ECLASS=1
 # @DESCRIPTION:
 # How much space is needed in /var? Eg.: CHECKREQS_DISK_VAR=3000M
 
+# @ECLASS-VARIABLE: CHECKREQS_DONOTHING
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Do not error out in _check-reqs_output if requirements are not met.
+# This is a user flag and should under _no circumstances_ be set in the ebuild.
+
 # @FUNCTION: check-reqs_pkg_setup
 # @DESCRIPTION:
 # Exported function running the resources checks in pkg_setup phase.
@@ -276,7 +283,7 @@ _check-reqs_output() {
 
local msg="ewarn"
 
-   [[ ${EBUILD_PHASE} == "pretend" && -z ${I_KNOW_WHAT_I_AM_DOING} ]] && 
msg="eerror"
+   [[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && 
msg="eerror"
if [[ -n ${CHECKREQS_FAILED} ]]; then
${msg}
${msg} "Space constraints set in the ebuild were not met!"
@@ -284,7 +291,7 @@ _check-reqs_output() {
${msg} "as per failed tests."
${msg}
 
-   [[ ${EBUILD_PHASE} == "pretend" && -z ${I_KNOW_WHAT_I_AM_DOING} 
]] && \
+   [[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] 
&& \
die "Build requirements not met!"
fi
 }
@@ -446,7 +453,7 @@ _check-reqs_unsatisfied() {
local location=${2}
local sizeunit="$(_check-reqs_get_number ${size}) 
$(_check-reqs_get_unit ${size})"
 
-   [[ ${EBUILD_PHASE} == "pretend" && -z ${I_KNOW_WHAT_I_AM_DOING} ]] && 
msg="eerror"
+   [[ ${EBUILD_PHASE} == "pretend" && -z ${CHECKREQS_DONOTHING} ]] && 
msg="eerror"
${msg} "There is NOT at least ${sizeunit} ${location}"
 
# @ECLASS-VARIABLE: CHECKREQS_FAILED
-- 
2.32.0



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


[gentoo-dev] [PATCH v2 4/5] check-reqs.eclass: Prefix internal functions w/ underscore

2021-07-22 Thread Andreas Sturmlechner
Signed-off-by: Andreas Sturmlechner 
---
 eclass/check-reqs.eclass | 140 
++-
 1 file changed, 123 insertions(+), 17 deletions(-)

diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index 6b11794fbb2..39e4bad1363 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -76,9 +76,9 @@ _CHECK_REQS_ECLASS=1
 check-reqs_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
 
-   check-reqs_prepare
-   check-reqs_run
-   check-reqs_output
+   _check-reqs_prepare
+   _check-reqs_run
+   _check-reqs_output
 }
 
 # @FUNCTION: check-reqs_pkg_pretend
@@ -95,6 +95,16 @@ check-reqs_pkg_pretend() {
 # @DESCRIPTION:
 # Internal function that checks the variables that should be defined.
 check-reqs_prepare() {
+   [[ ${EAPI} == [67] ]] ||
+   die "Internal function ${FUNCNAME} is not available in EAPI 
${EAPI}."
+   _check-reqs_prepare "$@"
+}
+
+# @FUNCTION: _check-reqs_prepare
+# @INTERNAL
+# @DESCRIPTION:
+# Internal function that checks the variables that should be defined.
+_check-reqs_prepare() {
debug-print-function ${FUNCNAME} "$@"
 
if [[ -z ${CHECKREQS_MEMORY} &&
@@ -112,6 +122,16 @@ check-reqs_prepare() {
 # @DESCRIPTION:
 # Internal function that runs the check based on variable settings.
 check-reqs_run() {
+   [[ ${EAPI} == [67] ]] ||
+   die "Internal function ${FUNCNAME} is not available in EAPI 
${EAPI}."
+   _check-reqs_run "$@"
+}
+
+# @FUNCTION: _check-reqs_run
+# @INTERNAL
+# @DESCRIPTION:
+# Internal function that runs the check based on variable settings.
+_check-reqs_run() {
debug-print-function ${FUNCNAME} "$@"
 
# some people are *censored*
@@ -119,23 +139,23 @@ check-reqs_run() {
 
if [[ ${MERGE_TYPE} != binary ]]; then
[[ -n ${CHECKREQS_MEMORY} ]] && \
-   check-reqs_memory \
+   _check-reqs_memory \
${CHECKREQS_MEMORY}
 
[[ -n ${CHECKREQS_DISK_BUILD} ]] && \
-   check-reqs_disk \
+   _check-reqs_disk \
"${T}" \
"${CHECKREQS_DISK_BUILD}"
fi
 
if [[ ${MERGE_TYPE} != buildonly ]]; then
[[ -n ${CHECKREQS_DISK_USR} ]] && \
-   check-reqs_disk \
+   _check-reqs_disk \
"${EROOT%/}/usr" \
"${CHECKREQS_DISK_USR}"
 
[[ -n ${CHECKREQS_DISK_VAR} ]] && \
-   check-reqs_disk \
+   _check-reqs_disk \
"${EROOT%/}/var" \
"${CHECKREQS_DISK_VAR}"
fi
@@ -147,6 +167,17 @@ check-reqs_run() {
 # Internal function that returns number in KiB.
 # Returns 1024**2 for 1G or 1024**3 for 1T.
 check-reqs_get_kibibytes() {
+   [[ ${EAPI} == [67] ]] ||
+   die "Internal function ${FUNCNAME} is not available in EAPI 
${EAPI}."
+   _check-reqs_get_kibibytes "$@"
+}
+
+# @FUNCTION: _check-reqs_get_kibibytes
+# @INTERNAL
+# @DESCRIPTION:
+# Internal function that returns number in KiB.
+# Returns 1024**2 for 1G or 1024**3 for 1T.
+_check-reqs_get_kibibytes() {
debug-print-function ${FUNCNAME} "$@"
 
[[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]"
@@ -170,6 +201,17 @@ check-reqs_get_kibibytes() {
 # Internal function that returns the numerical value without the unit.
 # Returns "1" for "1G" or "150" for "150T".
 check-reqs_get_number() {
+   [[ ${EAPI} == [67] ]] ||
+   die "Internal function ${FUNCNAME} is not available in EAPI 
${EAPI}."
+   _check-reqs_get_number "$@"
+}
+
+# @FUNCTION: _check-reqs_get_number
+# @INTERNAL
+# @DESCRIPTION:
+# Internal function that returns the numerical value without the unit.
+# Returns "1" for "1G" or "150" for "150T".
+_check-reqs_get_number() {
debug-print-function ${FUNCNAME} "$@"
 
[[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]"
@@ -186,6 +228,17 @@ check-reqs_get_number() {
 # Internal function that returns the unit without the numerical value.
 # Returns "GiB" for "1G" or "TiB" for "150T".
 check-reqs_get_unit() {
+   [[ ${EAPI} == [67] ]] ||
+   die "Internal function ${FUNCNAME} is not available in EAPI 
${EAPI}."
+   _check-reqs_get_unit "$@"
+}
+
+# @FUNCTION: _check-reqs_get_unit
+# @INTERNAL
+# @DESCRIPTION:
+# Internal function that returns the unit without the numerical value.
+# Returns "GiB" for "1G" or "TiB" for "150T".
+_check-reqs_get_unit() {
debug-print-function ${FUNCNAME} "$@"
 
[[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]"
@@ -208,6 +261,17 @@ check-reqs_get_unit() {
 # Internal function that prints the warning and dies if requir

[gentoo-dev] [PATCH v2 3/5] check-reqs.eclass: Drop obsolete check_reqs(), errored out for >3yrs

2021-07-22 Thread Andreas Sturmlechner
Signed-off-by: Andreas Sturmlechner 
---
 eclass/check-reqs.eclass | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index c95ee0192c5..6b11794fbb2 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -68,13 +68,6 @@ _CHECK_REQS_ECLASS=1
 # @DESCRIPTION:
 # How much space is needed in /var? Eg.: CHECKREQS_DISK_VAR=3000M
 
-# Obsolete function executing all the checks and printing out results
-check_reqs() {
-   eerror "Package calling old ${FUNCNAME} function."
-   eerror "It should call check-reqs_pkg_pretend and check-reqs_pkg_setup."
-   die "${FUNCNAME} is banned"
-}
-
 # @FUNCTION: check-reqs_pkg_setup
 # @DESCRIPTION:
 # Exported function running the resources checks in pkg_setup phase.
-- 
2.32.0



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


[gentoo-dev] [PATCH v2 2/5] check-reqs.eclass: Drop EAPI-4 and EAPI-5 support

2021-07-22 Thread Andreas Sturmlechner
Signed-off-by: Andreas Sturmlechner 
---
 eclass/check-reqs.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index 27ab1513aab..c95ee0192c5 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -7,7 +7,7 @@
 # @AUTHOR:
 # Bo Ørsted Andresen 
 # Original Author: Ciaran McCreesh 
-# @SUPPORTED_EAPIS: 4 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: Provides a uniform way of handling ebuilds with very high build 
requirements
 # @DESCRIPTION:
 # This eclass provides a uniform way of handling ebuilds which have very high
@@ -39,7 +39,7 @@
 # probably degrade gracefully if they don't. Probably.
 
 case ${EAPI} in
-   4|5|6|7|8) ;;
+   6|7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
 esac
 
-- 
2.32.0



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


[gentoo-dev] [PATCH v2 1/5] check-reqs.eclass: Support EAPI-8

2021-07-22 Thread Andreas Sturmlechner
Move EAPI check and EXPORT_FUNCTIONS on top, before include guard.
Standardise include guard.

Signed-off-by: Andreas Sturmlechner 
---
 eclass/check-reqs.eclass | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index 5c4a420ee06..27ab1513aab 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -7,8 +7,8 @@
 # @AUTHOR:
 # Bo Ørsted Andresen 
 # Original Author: Ciaran McCreesh 
-# @SUPPORTED_EAPIS: 4 5 6 7
-# @BLURB: Provides a uniform way of handling ebuild which have very high build 
requirements
+# @SUPPORTED_EAPIS: 4 5 6 7 8
+# @BLURB: Provides a uniform way of handling ebuilds with very high build 
requirements
 # @DESCRIPTION:
 # This eclass provides a uniform way of handling ebuilds which have very high
 # build requirements in terms of memory or disk space. It provides a function
@@ -38,14 +38,22 @@
 # These checks should probably mostly work on non-Linux, and they should
 # probably degrade gracefully if they don't. Probably.
 
-if [[ ! ${_CHECK_REQS_ECLASS_} ]]; then
+case ${EAPI} in
+   4|5|6|7|8) ;;
+   *) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
+esac
+
+EXPORT_FUNCTIONS pkg_pretend pkg_setup
+
+if [[ ! ${_CHECK_REQS_ECLASS} ]]; then
+_CHECK_REQS_ECLASS=1
 
 # @ECLASS-VARIABLE: CHECKREQS_MEMORY
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # How much RAM is needed? Eg.: CHECKREQS_MEMORY=15M
 
-# @ECLASS-VARIABLE:  CHECKREQS_DISK_BUILD
+# @ECLASS-VARIABLE: CHECKREQS_DISK_BUILD
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # How much diskspace is needed to build the package? Eg.: 
CHECKREQS_DISK_BUILD=2T
@@ -60,13 +68,6 @@ if [[ ! ${_CHECK_REQS_ECLASS_} ]]; then
 # @DESCRIPTION:
 # How much space is needed in /var? Eg.: CHECKREQS_DISK_VAR=3000M
 
-case ${EAPI:-0} in
-   4|5|6|7) ;;
-   *) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
-esac
-
-EXPORT_FUNCTIONS pkg_pretend pkg_setup
-
 # Obsolete function executing all the checks and printing out results
 check_reqs() {
eerror "Package calling old ${FUNCNAME} function."
@@ -357,5 +358,4 @@ check-reqs_unsatisfied() {
CHECKREQS_FAILED="true"
 }
 
-_CHECK_REQS_ECLASS_=1
 fi
-- 
2.32.0



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


[gentoo-dev] [PATCH] optfeature.eclass: Drop support for EAPIs 0,1,2,3,4,5

2021-07-22 Thread Andreas Sturmlechner
Signed-off-by: Andreas Sturmlechner 
---
 eclass/optfeature.eclass | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/optfeature.eclass b/eclass/optfeature.eclass
index b853f61be32..f9870e04732 100644
--- a/eclass/optfeature.eclass
+++ b/eclass/optfeature.eclass
@@ -4,12 +4,12 @@
 # @ECLASS: optfeature.eclass
 # @MAINTAINER:
 # base-sys...@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 8
+# @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: Advertise optional functionality that might be useful to users
 
-case ${EAPI:-0} in
-   [0-8]) ;;
-   *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
+case ${EAPI} in
+   6|7|8) ;;
+   *) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;;
 esac
 
 if [[ -z ${_OPTFEATURE_ECLASS} ]]; then
-- 
2.32.0


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


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!




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/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/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/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 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] 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?




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 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] [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 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


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] 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 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 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





[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


[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] 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] 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.