dev-python/pyxattr: передос для поддержки python2.7

mhiretskiy
parent 69440404da
commit 65df2f480b

@ -0,0 +1 @@
DIST pyxattr-0.6.0.tar.gz 31057 BLAKE2B cf6e99c499dbcc74305970413803e5cf59508e7ee1bf247afe42e576c2dfaf118a374ad6f8721b9d9c482f8be0c222d26b82997dc1ccc79248d5f52b2064ed8d SHA512 c56bf57729b5f8c8e3e19e29fd903b7365c6644abe3dcebf57ffc2f97a1e92d0e22cdc0a967c5abee3a74ba61a2a379e31a1734f45449095bdb7895b8357a9bb

@ -0,0 +1,53 @@
From cc0bc63b291ee1a831f07c81946149dbe8c8146d Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Wed, 10 Jan 2018 11:45:35 +0100
Subject: [PATCH] xattr.c: There is no more attr/xattr.h with >=attr-2.4.48
See also:
http://git.savannah.nongnu.org/cgit/attr.git/commit/?id=7921157890d07858d092f4003ca4c6bae9fd2c38
---
xattr.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/xattr.c b/xattr.c
index 111cec1..c82ee32 100644
--- a/xattr.c
+++ b/xattr.c
@@ -23,10 +23,8 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#if defined(__APPLE__)
+#if defined(__APPLE__) || defined(__linux__)
#include <sys/xattr.h>
-#elif defined(__linux__)
-#include <attr/xattr.h>
#endif
#include <stdio.h>
@@ -642,11 +640,7 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds)
/* Now retrieve the attribute value */
nval = _generic_get(_get_obj, &tgt, s, &buf_val, &nalloc, &io_errno);
if (nval == -1) {
- if (
-#ifdef ENODATA
- io_errno == ENODATA ||
-#endif
- io_errno == ENOATTR) {
+ if (io_errno == ENODATA) {
PyErr_Clear();
continue;
} else {
@@ -1173,8 +1167,7 @@ static char __xattr_doc__[] = \
" a :exc:`EnvironmentError`; under\n"
" Linux, the following ``errno`` values are used:\n"
"\n"
- " - ``ENOATTR`` and ``ENODATA`` mean that the attribute name is\n"
- " invalid\n"
+ " - ``ENODATA`` means that the attribute name is\n invalid\n"
" - ``ENOTSUP`` and ``EOPNOTSUPP`` mean that the filesystem does not\n"
" support extended attributes, or that the namespace is invalid\n"
" - ``E2BIG`` mean that the attribute value is too big\n"
--
2.16.0.rc1

@ -0,0 +1,70 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{6,7} )
inherit distutils-r1 eutils
DESCRIPTION="Python interface to xattr"
HOMEPAGE="https://pyxattr.k1024.org/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
https://pyxattr.k1024.org/downloads/${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="doc test"
RESTRICT="!test? ( test )"
RDEPEND="sys-apps/attr"
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
doc? ( >=dev-python/sphinx-1.3.1[${PYTHON_USEDEP}] )
test? ( dev-python/nose[${PYTHON_USEDEP}] )"
PATCHES=(
"${FILESDIR}/${PN}-0.6.0-xattr_header.patch"
)
python_prepare_all() {
sed -i -e 's:, "-Werror"::' setup.py || die
# Bug 548486
sed -e "s:html_theme = 'default':html_theme = 'classic':" \
-i doc/conf.py || die
distutils-r1_python_prepare_all
}
python_compile_all() {
use doc && emake doc
}
src_test() {
# Perform the tests in /var/tmp; that location is more likely
# to have xattr support than /tmp which is often tmpfs.
local -x TEST_DIR="${TEST_DIR:-/var/tmp}"
# Ignore selinux attributes by default, bug #503946.
local -x TEST_IGNORE_XATTRS="${TEST_IGNORE_XATTRS:-security.selinux}"
einfo "Please note that the tests fail if xattrs are not supported"
einfo "by the filesystem used for ${TEST_DIR}."
einfo
einfo "The location for tests can be overriden using TEST_DIR variable:"
einfo " $ export TEST_DIR=/my/test/place"
einfo
einfo "Additionally, TEST_IGNORE_XATTRS can be set to control which"
einfo "external attributes are ignored by the tests."
einfo "See https://bugs.gentoo.org/503946 for details."
einfo
distutils-r1_src_test
}
python_test() {
nosetests -v || die "Tests fail with ${EPYTHON}"
}
python_install_all() {
use doc && local HTML_DOCS=( doc/html/. )
distutils-r1_python_install_all
}
Loading…
Cancel
Save