Re: [gentoo-portage-dev] [PATCH] isolated-functions.sh: eliminate loop in has()

2016-05-14 Thread Anthony G. Basile
ift > + local IFS=$'\a' > + local haystack=$'\a'"$@"$'\a' you want "$*" here not "$@" > > - local x > - for x in "$@"; do > - [ "${x}" = "${needle}" ] && return 0 > - done > - return 1 > + [[ "${haystack}" == *"${needle}"* ]] > } > > __repo_attr() { > -- > 2.7.3 > -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197

[gentoo-portage-dev] [PATCH] pym/portage/util/locale.py: add a C module to check locale

2016-05-17 Thread Anthony G. Basile
From: "Anthony G. Basile" The current method to check for the system locale is to use python's ctype.util.find_library() to construct a full library path to the system libc.so which is then passed to ctypes.CDLL(). However, this gets bogged down in implementation dependant de

Re: [gentoo-portage-dev] [PATCH] pym/portage/util/locale.py: add a C module to check locale

2016-05-17 Thread Anthony G. Basile
On 5/17/16 8:47 AM, Anthony G. Basile wrote: > From: "Anthony G. Basile" > > The current method to check for the system locale is to use python's > ctype.util.find_library() to construct a full library path to the > system libc.so which is then passed to ctypes

Re: [gentoo-portage-dev] [PATCH] pym/portage/util/locale.py: add a C module to check locale

2016-05-17 Thread Anthony G. Basile
On 5/17/16 9:38 AM, Brian Dolbec wrote: > On Tue, 17 May 2016 09:02:55 -0400 > "Anthony G. Basile" wrote: > >> On 5/17/16 8:47 AM, Anthony G. Basile wrote: >>> From: "Anthony G. Basile" >>> >>> The current method to check for the sys

Re: [gentoo-portage-dev] [PATCH] pym/portage/util/locale.py: add a C module to check locale

2016-05-17 Thread Anthony G. Basile
On 5/17/16 8:47 AM, Anthony G. Basile wrote: > + > + try: > + from portage_c_check_locale import _c_check_locale > + (ret, msg) = _c_check_locale() > + except ImportError: > + writemsg_level("!!! Unable to import p

Re: [gentoo-portage-dev] [PATCH] pym/portage/util/locale.py: add a C module to check locale

2016-05-18 Thread Anthony G. Basile
On 5/18/16 2:50 AM, Alexander Berntsen wrote: > On 17/05/16 14:47, Anthony G. Basile wrote: >> Since this is the first python module written in C included in >> portage, as a side effect, we introduce the machinary for future >> modules in setup.py. > Split it into two c

Re: [gentoo-portage-dev] [PATCH] pym/portage/util/locale.py: add a C module to check locale

2016-05-18 Thread Anthony G. Basile
lf._interpolate_some(option, L, rawval, section, vars, 1) File "/usr/lib64/python2.7/ConfigParser.py", line 723, in _interpolate_some option, section, rest, var) InterpolationMissingOptionError: Bad value substitution: section: [usersets] option : directory key: portage_configroot rawval : etc/portage/sets -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197

Re: [gentoo-portage-dev] [PATCH] pym/portage/util/locale.py: add a C module to check locale

2016-05-18 Thread Anthony G. Basile
On 5/18/16 10:26 AM, Brian Dolbec wrote: > On Wed, 18 May 2016 06:08:20 -0400 > "Anthony G. Basile" wrote: > >> On 5/18/16 2:50 AM, Alexander Berntsen wrote: >>> On 17/05/16 14:47, Anthony G. Basile wrote: >>>> Since this is the first python modu

Re: [gentoo-portage-dev] [PATCH] pym/portage/util/locale.py: add a C module to check locale

2016-05-18 Thread Anthony G. Basile
On 5/18/16 10:51 AM, Anthony G. Basile wrote: > On 5/18/16 10:26 AM, Brian Dolbec wrote: >> On Wed, 18 May 2016 06:08:20 -0400 >> "Anthony G. Basile" wrote: >> >>> On 5/18/16 2:50 AM, Alexander Berntsen wrote: >>>> On 17/05/16 14:47, Anthony G.

[gentoo-portage-dev] [PATCH 2/2] pym/portage/util/locale.py: add a C module to check locale

2016-05-19 Thread Anthony G. Basile
From: "Anthony G. Basile" The current method to check for the system locale is to use python's ctypes.util.find_library() to construct a full library path to the system libc.so which is then passed to ctypes.CDLL(). However, this gets bogged down in implementation dependant de

[gentoo-portage-dev] [PATCH 1/2] setup.py: add stub for building custom modules in C/C++

2016-05-19 Thread Anthony G. Basile
From: "Anthony G. Basile" Currently portage doesn't include any custom modules written in C/C++. This commit introduces stub code for building such modules in setup.py. Signed-off-by: Anthony G. Basile --- setup.py | 11 ++- 1 file changed, 10 insertions(+), 1 deletion

Re: [gentoo-portage-dev] [PATCH 2/2] pym/portage/util/locale.py: add a C module to check locale

2016-05-19 Thread Anthony G. Basile
On 5/19/16 8:43 AM, Anthony G. Basile wrote: > From: "Anthony G. Basile" > > This has been tested on glibc, uClibc and musl systems. To be clear here, I needed the patch from bug #583412 to fix an independent bug in portage + python2.7 + turkish (and possibly other) locale.

Re: [gentoo-portage-dev] [PATCH 2/2] pym/portage/util/locale.py: add a C module to check locale

2016-05-20 Thread Anthony G. Basile
On 5/19/16 9:38 AM, Michał Górny wrote: > Dnia 19 maja 2016 14:43:38 CEST, "Anthony G. Basile" > napisał(a): >> From: "Anthony G. Basile" >> >> The current method to check for the system locale is to use python's >> ctypes.util.find_libr

[gentoo-portage-dev] [PATCH 2/2] pym/portage/util/locale.py: add a C module to help check locale

2016-05-22 Thread Anthony G. Basile
From: "Anthony G. Basile" The current method to check for a sane system locale is to use python's ctypes.util.find_library() to construct a full library path to the system libc.so and pass that path to ctypes.CDLL() so we can call toupper() and tolower() directly. However, this g

[gentoo-portage-dev] [PATCH 1/2] setup.py: add stub for building custom modules in C/C++

2016-05-22 Thread Anthony G. Basile
From: "Anthony G. Basile" Currently portage doesn't include any custom modules written in C/C++. This commit introduces stub code for building such modules in setup.py. Signed-off-by: Anthony G. Basile --- setup.py | 11 ++- 1 file changed, 10 insertions(+), 1 deletion

Re: [gentoo-portage-dev] [PATCH 2/2] pym/portage/util/locale.py: add a C module to help check locale

2016-05-23 Thread Anthony G. Basile
On 5/23/16 2:44 AM, Michał Górny wrote: > On Sun, 22 May 2016 13:04:40 -0400 > "Anthony G. Basile" wrote: > >> From: "Anthony G. Basile" >> >> The current method to check for a sane system locale is to use python's >> ctypes.util.find_l

[gentoo-portage-dev] [PATCH 1/3] pym/portage/util/locale.py: fix decoding for python2 with some locales

2016-05-27 Thread Anthony G. Basile
From: "Anthony G. Basile" When using python2 with some locales, like turkish, chr() is passed values not in range(128) which cannot be decoded as ASCII, thus throwing a UnicodeDecodeError exception. We use _unicode_decode() from portage.util to address this. Signed-off-by: Anthony

[gentoo-portage-dev] [PATCH 3/3] pym/portage/util/locale.py: add a C module to help check locale

2016-05-27 Thread Anthony G. Basile
From: "Anthony G. Basile" The current method to check for a sane system locale is to use python's ctypes.util.find_library() to construct a full library path to the system libc.so and pass that path to ctypes.CDLL() so we can call toupper() and tolower() directly. However, this g

[gentoo-portage-dev] [PATCH 2/3] setup.py: add stub for building custom modules in C/C++

2016-05-27 Thread Anthony G. Basile
From: "Anthony G. Basile" Currently portage doesn't include any custom modules written in C/C++. This commit introduces stub code for building such modules in setup.py. Signed-off-by: Anthony G. Basile --- setup.py | 11 ++- 1 file changed, 10 insertions(+), 1 deletion

Re: [gentoo-portage-dev] [PATCH 2/2] pym/portage/util/locale.py: add a C module to help check locale

2016-05-27 Thread Anthony G. Basile
On 5/23/16 10:25 AM, Michał Górny wrote: > On Mon, 23 May 2016 08:08:18 -0400 > "Anthony G. Basile" wrote: > >> On 5/23/16 2:44 AM, Michał Górny wrote: >>> On Sun, 22 May 2016 13:04:40 -0400 >>> "Anthony G. Basile" wrote: >>> &

Re: [gentoo-portage-dev] [PATCH 3/3] pym/portage/util/locale.py: add a C module to help check locale

2016-05-28 Thread Anthony G. Basile
On 5/29/16 2:30 AM, Michał Górny wrote: > On Fri, 27 May 2016 10:26:44 -0400 > "Anthony G. Basile" wrote: > >> From: "Anthony G. Basile" >> >> The current method to check for a sane system locale is to use python's >> ctypes.util.find_l

[gentoo-portage-dev] [PATCH 3/3] pym/portage/util/locale.py: add a C module to help check locale

2016-05-30 Thread Anthony G. Basile
From: "Anthony G. Basile" The current method to check for a sane system locale is to use python's ctypes.util.find_library() to construct a full library path to the system libc.so and pass that path to ctypes.CDLL() so we can call toupper() and tolower() directly. However, this g

[gentoo-portage-dev] Resending patchset for C module to help check locale

2016-09-14 Thread Anthony G. Basile
As per Brian's request on IRC, here's the patchset for adding a C module to help check locales. -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197 From 76131d44e1731c876840e7925ccff2468ea157a7 Mon Sep 17 00:00:00 2001 F

Re: [gentoo-portage-dev] [PATCH] file_copy: replace loff_t with off_t for portability (bug 617778)

2017-05-08 Thread Anthony G. Basile
ssize_t buf_bytes, buf_offset, copyfunc_ret; > struct stat stat_in, stat_out; > char* buf; > -ssize_t (*copyfunc)(int, int, loff_t *, size_t); > +ssize_t (*copyfunc)(int, int, off_t *, size_t); > > if (!PyArg_ParseTuple(args, "ii", &fd_in, &fd_

[gentoo-portage-dev] xattr wrapper for install, bug #465000

2014-01-26 Thread Anthony G. Basile
need to get that integrated into portage. 1) I'm not 100% sure how to do that. 2) We may want to install it at /usr/bin/install-xattr because I'm sure it will be useful for more than just portage. Comments? -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youv

Re: [gentoo-portage-dev] xattr wrapper for install, bug #465000

2014-01-29 Thread Anthony G. Basile
On 01/27/2014 09:02 AM, viv...@gmail.com wrote: On 01/26/14 23:53, Anthony G. Basile wrote: Hi everyone, A while back, I wrote a python wrapper for install to preserve xattrs. Its installed in LIBDIR/portage/bin/install.py. It is *painfully* slow. For a package like moodle with 16650 .php

Re: [gentoo-portage-dev] [PATCH] ebuild-helpers/xattr/install: use install-xattr

2014-06-04 Thread Anthony G. Basile
On 06/02/14 12:13, Alec Warner wrote: On Sat, May 31, 2014 at 4:36 PM, wrote: From: "Anthony G. Basile" Currently bin/ebuild-helpers/xattr/install uses ${PORTAGE_BIN_PATH}/install.py as a wrapper to coreutils' install to preserve a file's extended attributes when instal

Re: [gentoo-portage-dev] Next team meeting

2014-06-14 Thread Anthony G. Basile
be invited to discuss xattrs + portage. I want to co-ordinate with the team on how to best integrate this since some of the machinary is unnecessarily complex. I will take about 5 mins. -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197

Re: [gentoo-portage-dev] [PATCH] Generate soname dependency metadata (282639)

2015-01-29 Thread Anthony G. Basile
turn ord(data[0:1]) + (ord(data[1:2]) << 8) + +def decode_uint32_be(data): + """ + Decode an unsigned 32-bit integer with big-endian encoding. + + @param data: string of bytes of length 4 + @type data: bytes + @rtype: int + @return: unsigned integer value of the decoded data + """ + return ( + (ord(data[0:1]) << 24) + + (ord(data[1:2]) << 16) + + (ord(data[2:3]) << 8) + + ord(data[3:4]) + ) + +def decode_uint32_le(data): + """ + Decode an unsigned 32-bit integer with little-endian encoding. + + @param data: string of bytes of length 4 + @type data: bytes + @rtype: int + @return: unsigned integer value of the decoded data + """ + return ( + ord(data[0:1]) + + (ord(data[1:2]) << 8) + + (ord(data[2:3]) << 16) + + (ord(data[3:4]) << 24) + ) Endian fun. -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197

Re: [gentoo-portage-dev] [PATCH] Generate soname dependency metadata (282639)

2015-01-30 Thread Anthony G. Basile
we're far afield. I might install freebsd later in a vm just to have one handy and check. -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197

Re: [gentoo-portage-dev] [PATCH] Generate soname dependency metadata (282639)

2015-01-31 Thread Anthony G. Basile
On 01/30/15 18:19, Zac Medico wrote: On 01/30/2015 03:01 PM, Anthony G. Basile wrote: On 01/29/15 21:02, Zac Medico wrote: +#hppa_{32,64} +#ia_{32,64} +#m68k_{32,64} +#mips_{eabi32,eabi64,n32,n64,o32,o64} +#ppc_{32,64} +#s390_{32,64} +#sh_{32,64} +#sparc_{32,64

Re: [gentoo-portage-dev] [PATCH] Generate soname dependency metadata (282639)

2015-02-01 Thread Anthony G. Basile
On 02/01/15 15:00, Zac Medico wrote: On 01/31/2015 08:04 AM, Anthony G. Basile wrote: Yeah I just confirmed that. I installed amd64 fbsd 10.1. I've used obsd for years and noticed the "UNIX - System V" and just thought it was the same for all *bsd systems. This is the only t

Re: [gentoo-portage-dev] Does temp need g+w?

2015-02-14 Thread Anthony G. Basile
. -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197

[gentoo-portage-dev] Pre RFC on RFC: Add compiler information to exported a Package Manger's Cached Information.

2015-02-21 Thread Anthony G. Basile
" The same incompatibilities may be introduced by clang as well. -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197

Re: [gentoo-portage-dev] Pre RFC on RFC: Add compiler information to exported a Package Manger's Cached Information.

2015-02-25 Thread Anthony G. Basile
t need it in the elf's rpath which would make me feel better. -- Anthony G. Basile, Ph. D. Chair of Information Technology D'Youville College Buffalo, NY 14201 (716) 829-8197

Re: [gentoo-portage-dev] Pre RFC on RFC: Add compiler information to exported a Package Manger's Cached Information.

2015-02-25 Thread Anthony G. Basile
On 02/25/15 14:51, Anthony G. Basile wrote: On 02/22/15 01:30, Zac Medico wrote: On 02/21/2015 10:22 PM, Zac Medico wrote: If we put the real/canonical libstdc++.so path in the DT_NEEDED section, then it will automatically work with existing soname dependency support. Actually, we'd

Re: [gentoo-portage-dev] Pre RFC on RFC: Add compiler information to exported a Package Manger's Cached Information.

2015-02-25 Thread Anthony G. Basile
On 02/25/15 15:38, Zac Medico wrote: On 02/25/2015 12:01 PM, Anthony G. Basile wrote: On 02/25/15 14:51, Anthony G. Basile wrote: On 02/22/15 01:30, Zac Medico wrote: On 02/21/2015 10:22 PM, Zac Medico wrote: If we put the real/canonical libstdc++.so path in the DT_NEEDED section, then it