Re: [gentoo-portage-dev] [PATCH] Drop Python 2 comatibility in extension modules

2020-12-24 Thread Matt Turner
Typo in commit title: comatibility



Re: [gentoo-portage-dev] [PATCH] Drop Python 2 comatibility in extension modules

2020-12-24 Thread Zac Medico
On 12/24/20 10:14 AM, Mike Gilbert wrote:
> Signed-off-by: Mike Gilbert 
> ---
>  src/portage_util_file_copy_reflink_linux.c | 10 +-
>  src/portage_util_libc.c| 10 +-
>  2 files changed, 2 insertions(+), 18 deletions(-)

Looks good. Please merge.
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


[gentoo-portage-dev] [PATCH] Drop Python 2 comatibility in extension modules

2020-12-24 Thread Mike Gilbert
Signed-off-by: Mike Gilbert 
---
 src/portage_util_file_copy_reflink_linux.c | 10 +-
 src/portage_util_libc.c| 10 +-
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/src/portage_util_file_copy_reflink_linux.c 
b/src/portage_util_file_copy_reflink_linux.c
index 352342c06..c6affe57a 100644
--- a/src/portage_util_file_copy_reflink_linux.c
+++ b/src/portage_util_file_copy_reflink_linux.c
@@ -1,4 +1,4 @@
-/* Copyright 2017 Gentoo Foundation
+/* Copyright 2017-2020 Gentoo Authors
  * Distributed under the terms of the GNU General Public License v2
  */
 
@@ -25,7 +25,6 @@ static PyMethodDef reflink_linuxMethods[] = {
 {NULL, NULL, 0, NULL}
 };
 
-#if PY_MAJOR_VERSION >= 3
 static struct PyModuleDef moduledef = {
 PyModuleDef_HEAD_INIT,
 "reflink_linux",/* m_name */
@@ -45,13 +44,6 @@ PyInit_reflink_linux(void)
 m = PyModule_Create();
 return m;
 }
-#else
-PyMODINIT_FUNC
-initreflink_linux(void)
-{
-Py_InitModule("reflink_linux", reflink_linuxMethods);
-}
-#endif
 
 
 /**
diff --git a/src/portage_util_libc.c b/src/portage_util_libc.c
index 977b95474..2a3e624dc 100644
--- a/src/portage_util_libc.c
+++ b/src/portage_util_libc.c
@@ -1,4 +1,4 @@
-/* Copyright 2005-2016 Gentoo Foundation
+/* Copyright 2005-2020 Gentoo Authors
  * Distributed under the terms of the GNU General Public License v2
  */
 
@@ -15,7 +15,6 @@ static PyMethodDef LibcMethods[] = {
{NULL, NULL, 0, NULL}
 };
 
-#if PY_MAJOR_VERSION >= 3
 static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"libc", /* 
m_name */
@@ -35,13 +34,6 @@ PyInit_libc(void)
m = PyModule_Create();
return m;
 }
-#else
-PyMODINIT_FUNC
-initlibc(void)
-{
-   Py_InitModule("libc", LibcMethods);
-}
-#endif
 
 
 static PyObject *
-- 
2.30.0.rc1




Re: [gentoo-portage-dev] [PATCH] Adjust mangling of "arch" value from scanelf output

2020-12-24 Thread Mike Gilbert
On Thu, Dec 24, 2020 at 1:31 AM Zac Medico  wrote:
>
> On 12/23/20 7:34 PM, Mike Gilbert wrote:
> > scanelf may generate output that looks like this:
> >
> > ```
> > UNKNOWN_TYPE;lib/firmware/ath10k/WCN3990/hw1.0/wlanmdsp.mbn;;  -  ;
> > EM_ARM;lib/firmware/mediatek/mt8183/scp.img;;  -  ;
> > ...
> > ```
> >
> > Previously, we removed the first 3 characters of the first field and
> > stored this as the "arch" in NEEDED.ELF.2. This unintentionally
> > changes "UNKNOWN_TYPE" to "NOWN_TYPE".
> >
> > Instead, let's just remove the string "EM_" from the front.
> >
> > Signed-off-by: Mike Gilbert 
> > ---
> >  bin/misc-functions.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
> > index c2a16cbe0..d7009d7eb 100755
> > --- a/bin/misc-functions.sh
> > +++ b/bin/misc-functions.sh
> > @@ -194,7 +194,7 @@ install_qa_check() {
> >   fi
> >
> >   echo "${obj} ${needed}" >> 
> > "${PORTAGE_BUILDDIR}"/build-info/NEEDED
> > - echo "${arch:3};${obj};${soname};${rpath};${needed}" 
> > >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
> > + echo 
> > "${arch#EM_};${obj};${soname};${rpath};${needed}" >> 
> > "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
> >   done }
> >
> >   [ -n "${QA_SONAME_NO_SYMLINK}" ] && \
> >
>
> Look good. This won't cause any problems for portage since these files
> are outside of the known multilib categories.

Thanks, pushed.