Upgrade to 0.5.6 (#1603242)

To fix compilation issues in Rawhide.
https://bugzilla.redhat.com/show_bug.cgi?id=1603242
This commit is contained in:
Marcin Zajączkowski 2018-07-19 23:17:44 +02:00
parent 3e584e38e1
commit fa669d3e04
4 changed files with 10 additions and 134 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/pyxattr-0.5.1.tar.gz
/pyxattr-0.5.3.tar.gz
/pyxattr-0.5.6.tar.gz

View File

@ -1,127 +0,0 @@
From 50f7c251523f6be3be3426aa6499e5495a18b442 Mon Sep 17 00:00:00 2001
From: Mark Hamzy <hamzy@us.ibm.com>
Date: Wed, 6 Aug 2014 14:06:45 -0500
Subject: [PATCH] use Py_ssize_t
>Starting with Python 2.5 the type of the length argument can be controlled by
>defining the macro PY_SSIZE_T_CLEAN before including Python.h. If the macro is
>defined, length is a Py_ssize_t rather than an int.
dmalcolm@redhat.com says:
"and IIRC that *does* in fact affect "et#" and the other hash-suffixed codes
i.e. PyArg_ParseTupleAndKeywords was expecting bufsize to be a Py_ssize_t, not an int."
So, changing size_t to Py_ssize_t and ints used as sizes to Py_ssize_t.
---
xattr.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/xattr.c b/xattr.c
index cc1fa44..2529e90 100644
--- a/xattr.c
+++ b/xattr.c
@@ -193,7 +193,7 @@ static int merge_ns(const char *ns, const char *name,
return 0;
}
-static ssize_t _list_obj(target_t *tgt, char *list, size_t size) {
+static Py_ssize_t _list_obj(target_t *tgt, char *list, Py_ssize_t size) {
if(tgt->type == T_FD)
return flistxattr(tgt->fd, list, size);
else if (tgt->type == T_LINK)
@@ -202,8 +202,8 @@ static ssize_t _list_obj(target_t *tgt, char *list, size_t size) {
return listxattr(tgt->name, list, size);
}
-static ssize_t _get_obj(target_t *tgt, const char *name, void *value,
- size_t size) {
+static Py_ssize_t _get_obj(target_t *tgt, const char *name, void *value,
+ Py_ssize_t size) {
if(tgt->type == T_FD)
return fgetxattr(tgt->fd, name, value, size);
else if (tgt->type == T_LINK)
@@ -213,7 +213,7 @@ static ssize_t _get_obj(target_t *tgt, const char *name, void *value,
}
static int _set_obj(target_t *tgt, const char *name,
- const void *value, size_t size, int flags) {
+ const void *value, Py_ssize_t size, int flags) {
if(tgt->type == T_FD)
return fsetxattr(tgt->fd, name, value, size, flags);
else if (tgt->type == T_LINK)
@@ -242,7 +242,7 @@ static int _remove_obj(target_t *tgt, const char *name) {
*/
const char *matches_ns(const char *ns, const char *name) {
- size_t ns_size;
+ Py_ssize_t ns_size;
if (ns == NULL || *ns == '\0')
return name;
ns_size = strlen(ns);
@@ -275,7 +275,7 @@ pygetxattr(PyObject *self, PyObject *args)
int nofollow = 0;
char *attrname = NULL;
char *buf;
- ssize_t nalloc, nret;
+ Py_ssize_t nalloc, nret;
PyObject *res;
/* Parse the arguments */
@@ -352,7 +352,7 @@ xattr_get(PyObject *self, PyObject *args, PyObject *keywds)
const char *fullname;
char *buf;
const char *ns = NULL;
- ssize_t nalloc, nret;
+ Py_ssize_t nalloc, nret;
PyObject *res;
static char *kwlist[] = {"item", "name", "nofollow", "namespace", NULL};
@@ -451,7 +451,7 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds)
const char *ns = NULL;
char *buf_list, *buf_val;
const char *s;
- ssize_t nalloc, nlist, nval;
+ Py_ssize_t nalloc, nlist, nval;
PyObject *mylist;
target_t tgt;
static char *kwlist[] = {"item", "nofollow", "namespace", NULL};
@@ -604,7 +604,7 @@ pysetxattr(PyObject *self, PyObject *args)
int nofollow = 0;
char *attrname = NULL;
char *buf = NULL;
- int bufsize;
+ Py_ssize_t bufsize;
int nret;
int flags = 0;
target_t tgt;
@@ -670,7 +670,7 @@ xattr_set(PyObject *self, PyObject *args, PyObject *keywds)
int nofollow = 0;
char *attrname = NULL;
char *buf = NULL;
- int bufsize;
+ Py_ssize_t bufsize;
int nret;
int flags = 0;
target_t tgt;
@@ -856,7 +856,7 @@ pylistxattr(PyObject *self, PyObject *args)
{
char *buf;
int nofollow=0;
- ssize_t nalloc, nret;
+ Py_ssize_t nalloc, nret;
PyObject *myarg;
PyObject *mylist;
Py_ssize_t nattrs;
@@ -956,7 +956,7 @@ xattr_list(PyObject *self, PyObject *args, PyObject *keywds)
{
char *buf;
int nofollow = 0;
- ssize_t nalloc, nret;
+ Py_ssize_t nalloc, nret;
PyObject *myarg;
PyObject *res;
const char *ns = NULL;
--
2.0.0

View File

@ -1,13 +1,12 @@
%global with_python3 1
Name: pyxattr
Summary: Extended attributes library wrapper for Python
Version: 0.5.3
Release: 18%{?dist}
Version: 0.5.6
Release: 1%{?dist}
License: LGPLv2+
Group: Development/Libraries
URL: http://pyxattr.k1024.org/
Source: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
Patch0: 0001-use-Py_ssize_t.patch
BuildRequires: gcc
BuildRequires: libattr-devel
BuildRequires: python2-devel, python2-setuptools
@ -44,7 +43,6 @@ Python 3 version.
%prep
%setup -q
%patch0 -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
@ -86,7 +84,7 @@ popd
%{python2_sitearch}/*egg-info
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc NEWS README
%doc NEWS README.rst
%if %{?with_python3}
%files -n python3-%{name}
@ -94,10 +92,14 @@ popd
%{python3_sitearch}/*egg-info
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc NEWS README
%doc NEWS README.rst
%endif # with_python3
%changelog
* Thu Jul 19 2018 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.5.6-1
- Upgrade version to fix issues with Fedora 29 compilation erros on ENODATA (#1603242)
- Drop Py_ssize_t patch applied upstream
* Thu Jul 12 2018 Marcin Zajaczkowski <mszpak ATT wp DOTT pl> - 0.5.3-18
- Add gcc to BuildRequires - https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot

View File

@ -1 +1 @@
579cf6ccccd70916f7eb5304ffd9e837 pyxattr-0.5.3.tar.gz
SHA512 (pyxattr-0.5.6.tar.gz) = 100df863a42c35036dc8d105be3bbc84c5567489b1bbc09ec2a139e71f2413fd2fc18df0a67df8504a624ff0cab2a10417491a21670207651da77bf54717aa3b