Re: [gentoo-dev] [PATCH v2 1/2] kernel-2.eclass: Replace bit-shift arithmetic by ver_test

2021-08-27 Thread Ulrich Müller
> + ver_test \
> + "${KV_MAJOR:-0}.${KV_MINOR:-0}.${KV_PATCH:-0}" \
> + "${operator}" \
> + "${1:-${KV_MAJOR:-0}}.${2:-${KV_MINOR:-0}}.${3:-${KV_PATCH:-0}}"

I've added fallbacks to 0, because it turns out that these components
can be empty.

There may also be a problem in detect_version().
For gentoo-sources-5.10.52 I get: 

   KV_MAJOR=5
   KV_MINOR=10
   KV_PATCH=52

but for git-sources-5.14_rc7:

   KV_MAJOR=5
   KV_MINOR=   # empty
   KV_PATCH=14

According to a comment in detect_version() the intended behaviour is
"if KV_MAJOR >= 3, then we have no more KV_MINOR" but looks like that
isn't always happening.

Ulrich


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH v2 2/2] linux-info.eclass: Replace bit-shift arithmetic by ver_test

2021-08-27 Thread Ulrich Müller
There are kernel versions like 4.9.280, therefore shifting version
components by 8 bits in kernel_is() may fail.

Signed-off-by: Ulrich Müller 
---
v2: Protect against empty KV_{MAJOR,MINOR,PATCH}

 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 124fb70e78ad..8edd17c317d4 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -395,7 +395,7 @@ kernel_is() {
linux-info_get_any_version
 
# Now we can continue
-   local operator test value
+   local operator
 
case ${1#-} in
  lt) operator="-lt"; shift;;
@@ -407,9 +407,10 @@ kernel_is() {
esac
[[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many 
parameters"
 
-   : $(( test = (KV_MAJOR << 16) + (KV_MINOR << 8) + KV_PATCH ))
-   : $(( value = (${1:-${KV_MAJOR}} << 16) + (${2:-${KV_MINOR}} << 8) + 
${3:-${KV_PATCH}} ))
-   [ ${test} ${operator} ${value} ]
+   ver_test \
+   "${KV_MAJOR:-0}.${KV_MINOR:-0}.${KV_PATCH:-0}" \
+   "${operator}" \
+   "${1:-${KV_MAJOR:-0}}.${2:-${KV_MINOR:-0}}.${3:-${KV_PATCH:-0}}"
 }
 
 get_localversion() {
-- 
2.33.0




[gentoo-dev] [PATCH v2 1/2] kernel-2.eclass: Replace bit-shift arithmetic by ver_test

2021-08-27 Thread Ulrich Müller
There are kernel versions like 4.9.280, therefore shifting version
components by 8 bits in kernel_is() may fail.

Signed-off-by: Ulrich Müller 
---
v2: Protect against empty KV_{MAJOR,MINOR,PATCH}

 eclass/kernel-2.eclass | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 8c1740998272..05c07c4d153e 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -560,7 +560,7 @@ kernel_is() {
[[ ${n} -eq 1 ]] && detect_version
 
# Now we can continue
-   local operator test value
+   local operator
 
case ${1#-} in
  lt) operator="-lt"; shift;;
@@ -572,9 +572,10 @@ kernel_is() {
esac
[[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many 
parameters"
 
-   : $(( test = (KV_MAJOR << 16) + (KV_MINOR << 8) + KV_PATCH ))
-   : $(( value = (${1:-${KV_MAJOR}} << 16) + (${2:-${KV_MINOR}} << 8) + 
${3:-${KV_PATCH}} ))
-   [ ${test} ${operator} ${value} ]
+   ver_test \
+   "${KV_MAJOR:-0}.${KV_MINOR:-0}.${KV_PATCH:-0}" \
+   "${operator}" \
+   "${1:-${KV_MAJOR:-0}}.${2:-${KV_MINOR:-0}}.${3:-${KV_PATCH:-0}}"
 }
 
 # Capture the sources type and set DEPENDs
-- 
2.33.0




[gentoo-dev] Re: [PATCH 1/3] meson.eclass: introduce meson_install helper function

2021-08-27 Thread Matt Turner
Thanks, all three patches LGTM.



[gentoo-dev] [PATCH 3/3] meson-multilib.eclass: fix MAINTAINER and AUTHOR tags

2021-08-27 Thread Mike Gilbert
Signed-off-by: Mike Gilbert 
---
 eclass/meson-multilib.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/meson-multilib.eclass b/eclass/meson-multilib.eclass
index 83c5202d069..1ed95f99fa1 100644
--- a/eclass/meson-multilib.eclass
+++ b/eclass/meson-multilib.eclass
@@ -3,10 +3,10 @@
 
 # @ECLASS: meson-multilib.eclass
 # @MAINTAINER:
-# Author: Matt Turner 
+# Matt Turner 
 # @AUTHOR:
-# Author: Michał Górny 
-# Author: Matt Turner 
+# Michał Górny 
+# Matt Turner 
 # @SUPPORTED_EAPIS: 7 8
 # @BLURB: meson wrapper for multilib builds
 # @DESCRIPTION:
-- 
2.33.0




[gentoo-dev] [PATCH 2/3] meson-multilib.eclass: use meson_install helper function

2021-08-27 Thread Mike Gilbert
Use meson_install to avoid calling einstalldocs more than once.
multilib-minimal_src_install already handles it.

Signed-off-by: Mike Gilbert 
---
 eclass/meson-multilib.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/meson-multilib.eclass b/eclass/meson-multilib.eclass
index fc1ef5802f9..83c5202d069 100644
--- a/eclass/meson-multilib.eclass
+++ b/eclass/meson-multilib.eclass
@@ -125,7 +125,7 @@ meson-multilib_src_install() {
 }
 
 multilib_src_install() {
-   meson_src_install "${_meson_args[@]}"
+   meson_install "${_meson_args[@]}"
 }
 
 fi
-- 
2.33.0




[gentoo-dev] [PATCH 1/3] meson.eclass: introduce meson_install helper function

2021-08-27 Thread Mike Gilbert
This will be called from meson.eclass and meson-multilib.eclass.

Signed-off-by: Mike Gilbert 
---
 eclass/meson.eclass | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 8b22797da71..a3cf8740b26 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -404,11 +404,11 @@ meson_src_test() {
"$@" || die "tests failed"
 }
 
-# @FUNCTION: meson_src_install
+# @FUNCTION: meson_install
 # @USAGE: [extra meson install arguments]
 # @DESCRIPTION:
-# This is the meson_src_install function.
-meson_src_install() {
+# Calls meson install with suitable arguments
+meson_install() {
debug-print-function ${FUNCNAME} "$@"
 
local mesoninstallargs=(
@@ -420,10 +420,17 @@ meson_src_install() {
set -- meson install "${mesoninstallargs[@]}"
echo "$@" >&2
"$@" || die "install failed"
+}
+
+# @FUNCTION: meson_src_install
+# @USAGE: [extra meson install arguments]
+# @DESCRIPTION:
+# This is the meson_src_install function.
+meson_src_install() {
+   debug-print-function ${FUNCNAME} "$@"
 
-   pushd "${S}" > /dev/null || die
+   meson_install "$@"
einstalldocs
-   popd > /dev/null || die
 }
 
 fi
-- 
2.33.0




[gentoo-dev] [PATCH v2] unpacker.eclass: enable EAPI 8

2021-08-27 Thread Stephan Hartmann
Add support for 7z, RAR and LHA/LZH.

Signed-off-by: Stephan Hartmann 
---
 eclass/unpacker.eclass | 59 --
 1 file changed, 57 insertions(+), 2 deletions(-)

diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
index c9dab4345c9..74899fd77b7 100644
--- a/eclass/unpacker.eclass
+++ b/eclass/unpacker.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: unpacker.eclass
 # @MAINTAINER:
 # base-sys...@gentoo.org
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: helpers for extraneous file formats and consistent behavior across 
EAPIs
 # @DESCRIPTION:
 # Some extraneous file formats are not part of PMS, or are only in certain
@@ -16,7 +16,7 @@
 #  - support partial unpacks?
 
 case ${EAPI:-0} in
-   [567]) ;;
+   [5678]) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
@@ -335,6 +335,47 @@ unpack_zip() {
[[ $? -le 1 ]] || die "unpacking ${zip} failed (arch=unpack_zip)"
 }
 
+# @FUNCTION: unpack_7z
+# @USAGE: <7z file>
+# @DESCRIPTION:
+# Unpack 7z archives.
+unpack_7z() {
+   [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} "
+
+   local p7z=$(find_unpackable_file "$1")
+   unpack_banner "${p7z}"
+   local output="$(7z x -y "${p7z}")"
+
+   if [ $? -ne 0 ]; then
+   echo "${output}" >&2
+   die "unpacking ${p7z} failed (arch=unpack_7z)"
+   fi
+}
+
+# @FUNCTION: unpack_rar
+# @USAGE: 
+# @DESCRIPTION:
+# Unpack RAR archives.
+unpack_rar() {
+   [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} "
+
+   local rar=$(find_unpackable_file "$1")
+   unpack_banner "${rar}"
+   unrar x -idq -o+ "${rar}" || die "unpacking ${rar} failed 
(arch=unpack_rar)"
+}
+
+# @FUNCTION: unpack_lha
+# @USAGE: 
+# @DESCRIPTION:
+# Unpack LHA/LZH archives.
+unpack_lha() {
+   [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} "
+
+   local lha=$(find_unpackable_file "$1")
+   unpack_banner "${lha}"
+   lha xfq "${lha}" || die "unpacking ${lha} failed (arch=unpack_lha)"
+}
+
 # @FUNCTION: _unpacker
 # @USAGE: 
 # @INTERNAL
@@ -395,6 +436,18 @@ _unpacker() {
arch="unpack_zip" ;;
esac
 
+   # 7z, rar and lha/lzh are handled by package manager in EAPI < 8
+   if [[ ${EAPI} != [567] ]]; then
+   case ${m} in
+   *.7z)
+   arch="unpack_7z" ;;
+   *.rar|*.RAR)
+   arch="unpack_rar" ;;
+   *.LHA|*.LHa|*.lha|*.lzh)
+   arch="unpack_lha" ;;
+   esac
+   fi
+
# finally do the unpack
if [[ -z ${arch}${comp} ]] ; then
unpack "$1"
@@ -471,6 +524,8 @@ unpacker_src_uri_depends() {
d="|| ( app-arch/plzip app-arch/pdlzip app-arch/lzip )" 
;;
*.zst)
d="app-arch/zstd" ;;
+   *.LHA|*.LHa|*.lha|*.lzh)
+   d="app-arch/lha" ;;
esac
deps+=" ${d}"
done
-- 
2.31.1




[gentoo-dev] Git conversions of gentoo-x86 and gentoo CVS repositories

2021-08-27 Thread Ulrich Mueller
As some of you may already know, I have worked on a new conversion
of the Gentoo ebuild repository (aka gentoo-x86 in CVS) to Git, using
cvs-fast-export. This is now available on Gentoo infrastructure:

   https://gitweb.gentoo.org/archive/repo/gentoo-2.git/

A description of the conversion process can be found in the
gentoo-x86-conversion branch of my developer repo:
https://gitweb.gentoo.org/dev/ulm.git/tree/?h=gentoo-x86-conversion

The previous conversion (by rich0) is still available in
repo/gentoo/historical.git. It has been suggested to move it to
archive/repo/gentoo-1.git so the two conversions would in the same
category. The only problem I see with a move is that people have the
old location as a remote. Then again, there should be no reason to pull
from that repo after the initial clone.

I have also converted the gentoo CVS repository (i.e. former website,
patchsets, and random other stuff). It can be found here:

   https://gitweb.gentoo.org/archive/proj/gentoo.git/


signature.asc
Description: PGP signature


Re: [gentoo-dev] Stabilization Detached from Security Bugs

2021-08-27 Thread John Helmert III
On Fri, Aug 27, 2021 at 08:58:35AM +0200, Michał Górny wrote:
> On Thu, 2021-08-26 at 19:11 -0500, John Helmert III wrote:
> > In the past, stabilization for security bugs would be handled directly
> > in that security bug. After some discussion on the gentoo-dev mailing
> > list [1], there was some consensus on modifying this workflow to
> > separate stabilization from security bugs. Going forward, separate bugs
> > should be filed for security stabilizations and then the security bug
> > will have a dependency on its stabilization bug.
> 
> Great!  I can make the field invisible on security bugs when you've
> confirmed that all pending stabilizations are finished.  Or without
> that, if you prefer ;-).

Sure! But let's at least wait until we're done with the pending security
bugs which have CC-ARCHES [1], just to keep churn (and work for us)
a bit lower.

[1] 
https://bugs.gentoo.org/buglist.cgi?email1=security%40gentoo.org&emailassigned_to1=1&emailtype1=substring&f1=keywords&list_id=5758333&o1=substring&query_format=advanced&resolution=---&v1=CC-ARCHES


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH] linux-mod.eclass : Fix eclassdoc problems

2021-08-27 Thread Mike Pagano

linux-mod.eclass : Fix eclassdoc problems

Bug: https://bugs.gentoo.org/637782

Signed-off-by: Mike Pagano 
---
 eclass/linux-mod.eclass | 13 +
 1 file changed, 13 insertions(+)

diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
index 7e47a2e20..eda5e9aee 100644
--- a/eclass/linux-mod.eclass
+++ b/eclass/linux-mod.eclass
@@ -20,12 +20,14 @@
 
 # @ECLASS-VARIABLE: MODULES_OPTIONAL_USE

 # @PRE_INHERIT
+# @DEFAULT_UNSET
 # @DESCRIPTION:Cc: mpag...@gentoo.org

 # A string containing the USE flag to use for making this eclass optional
 # The recommended non-empty value is 'modules'
 
 # @ECLASS-VARIABLE: MODULES_OPTIONAL_USE_IUSE_DEFAULT

 # @PRE_INHERIT
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # A boolean to control the IUSE default state for the MODULES_OPTIONAL_USE USE
 # flag. Default value is unset (false). True represented by 1 or 'on', other
@@ -35,21 +37,26 @@
 # @DESCRIPTION:
 # A string containing the directory of the target kernel sources. The default 
value is
 # "/usr/src/linux"
+: ${KERNEL_DIR:=/usr/src/linux}
 
 # @ECLASS-VARIABLE: ECONF_PARAMS

+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # It's a string containing the parameters to pass to econf.
 # If this is not set, then econf isn't run.
 
 # @ECLASS-VARIABLE: BUILD_PARAMS

+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # It's a string with the parameters to pass to emake.
 
 # @ECLASS-VARIABLE: BUILD_TARGETS

 # @DESCRIPTION:
 # It's a string with the build targets to pass to make. The default value is "clean 
module"
+: ${BUILD_TARGETS:=clean module}
 
 # @ECLASS-VARIABLE: MODULE_NAMES

+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # It's a string containing the modules to be built automatically using the 
default
 # src_compile/src_install. It will only make ${BUILD_TARGETS} once in any 
directory.
@@ -94,12 +101,14 @@
 # This can be explicitly enabled by setting any of the following variables.
 
 # @ECLASS-VARIABLE: MODULESD__ENABLED

+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # This is used to disable the modprobe.d file generation otherwise the file 
will be
 # always generated (unless no MODULESD__* variable is provided). Set to 
"no" to disable
 # the generation of the file and the installation of the documentation.
 
 # @ECLASS-VARIABLE: MODULESD__EXAMPLES

+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # This is a bash array containing a list of examples which should
 # be used. If you want us to try and take a guess set this to "guess".
@@ -111,6 +120,7 @@
 # where array_component is " options" (see modprobe.conf(5))
 
 # @ECLASS-VARIABLE: MODULESD__ALIASES

+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # This is a bash array containing a list of associated aliases.
 #
@@ -121,17 +131,20 @@
 # where array_component is "wildcard " (see modprobe.conf(5))
 
 # @ECLASS-VARIABLE: MODULESD__ADDITIONS

+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # This is a bash array containing a list of additional things to
 # add to the bottom of the file. This can be absolutely anything.
 # Each entry is a new line.
 
 # @ECLASS-VARIABLE: MODULESD__DOCS

+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # This is a string list which contains the full path to any associated
 # documents for . These files are installed in the live tree.
 
 # @ECLASS-VARIABLE: KV_OBJ

+# @INTERNAL
 # @DESCRIPTION:
 # It's a read-only variable. It contains the extension of the kernel modules.
 
--

2.31.1