Skip to content

Commit

Permalink
devel/py-bsd: Update version 1.0.20170329=>1.0.20220425
Browse files Browse the repository at this point in the history
UNBREAK for 13.X and MAIN.

As the upstream do not maintain a proper versioning mechanism we will
continue versioning as per dates with TAG release.

Relnotes: https://github.com/truenas/py-bsd/releases/tag/TN-13.0-RELEASE
  • Loading branch information
5u623l20 committed Jun 6, 2022
1 parent c24f18d commit 9b6b694
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 17 deletions.
10 changes: 3 additions & 7 deletions devel/py-bsd/Makefile
@@ -1,5 +1,5 @@
PORTNAME= bsd
PORTVERSION= 1.0.20170329
PORTVERSION= 1.0.20220425
CATEGORIES= devel python
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

Expand All @@ -8,18 +8,14 @@ COMMENT= Python wrappers for various BSD libc and system calls

LICENSE= BSD3CLAUSE

BROKEN_FreeBSD_13= does not build: use of undeclared identifier 'PS_FST_TYPE_CRYPTO'
BROKEN_FreeBSD_14= does not build: use of undeclared identifier 'PS_FST_TYPE_CRYPTO'

BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR}

USES= python:3.6+
USE_PYTHON= autoplist distutils cython

USE_GITHUB= yes
GH_ACCOUNT= freenas
GH_PROJECT= py-bsd
GH_TAGNAME= 6d148fa
GH_TAGNAME= 63d3ee5
USE_PYTHON= autoplist distutils cython

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions devel/py-bsd/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1497784988
SHA256 (freenas-py-bsd-1.0.20170329-6d148fa_GH0.tar.gz) = 3398de5028f197572ed4bc2c8952283a2462cf1b38477d5a2a38ce26ce689b4a
SIZE (freenas-py-bsd-1.0.20170329-6d148fa_GH0.tar.gz) = 44561
TIMESTAMP = 1654521583
SHA256 (freenas-py-bsd-1.0.20220425-63d3ee5_GH0.tar.gz) = 67ecc88117e7b7a8ab4f26da434f8acc8007597cb2848b24246754d1b8bc559c
SIZE (freenas-py-bsd-1.0.20220425-63d3ee5_GH0.tar.gz) = 48846
87 changes: 80 additions & 7 deletions devel/py-bsd/files/patch-bsd__extattr.pyx
@@ -1,11 +1,84 @@
--- bsd/extattr.pyx.orig 2017-03-30 01:24:59 UTC
--- bsd/extattr.pyx.orig 2022-04-25 12:03:03 UTC
+++ bsd/extattr.pyx
@@ -335,7 +335,7 @@ def _list(fobj, namespace = Namespaces.U
@@ -71,7 +71,7 @@ def get_namespace(*args):
raise ValueError("%s is not a valid extattr namespace" % n)
retval[n] = _namespace_mapping[n]
return retval
-
+
def get(fobj, namespace = Namespaces.USER, attrname = None, follow = True):
"""Wrapper for extattr_get(3) API.
@@ -215,7 +215,7 @@ def set(fobj, namespace = Namespaces.USER, attr = None
def set(fobj, namespace = Namespaces.USER, attr = None, follow = True):
"""Wrapper for the extattr_set(3) API.
-
+
:Parameters:
- fobj (file, str, int): the file object upon which to operate.
If a string, this is the path; if a file, the file object
@@ -241,7 +241,7 @@ def set(fobj, namespace = Namespaces.USER, attr = None
char *attr_data
size_t data_len
ssize_t kr
-
+
pname = NULL
data_buffer = NULL
data_len = 0
@@ -261,11 +261,11 @@ def set(fobj, namespace = Namespaces.USER, attr = None
attr_name = k
attr_data = v
data_len = len(v)
-
+
if isinstance(fobj, file_types):
- kr = defs.exattr_set_fd(fobj.fileno(), namespace, attr_name, attr_data, data_len)
+ kr = defs.extattr_set_fd(fobj.fileno(), namespace, attr_name, attr_data, data_len)
elif type(fobj) is int:
- kr = defs.exattr_set_fd(fobj, namespace, attr_name, attr_data, data_len)
+ kr = defs.extattr_set_fd(fobj, namespace, attr_name, attr_data, data_len)
elif type(fobj) is str:
if follow:
kr = defs.extattr_set_file(fobj, namespace, attr_name, attr_data, data_len)
@@ -304,11 +304,11 @@ def _list(fobj, namespace = Namespaces.USER, follow =
size_t nbytes
ssize_t kr
unsigned char *ptr
-
+
retval = []
pname = NULL
data_buffer = NULL
-
+
try:
if isinstance(fobj, file_types):
kr = defs.extattr_list_fd(fobj.fileno(), namespace, data_buffer, 0)
@@ -322,7 +322,7 @@ def _list(fobj, namespace = Namespaces.USER, follow =
kr = defs.extattr_list_link(pname, namespace, NULL, 0)
else:
raise ValueError("Unknown file type")
-
+
if kr == -1:
raise OSError(errno, os.strerror(errno))

@@ -331,7 +331,7 @@ def _list(fobj, namespace = Namespaces.USER, follow =
data_buffer = <char*>malloc(nbytes)
if not data_buffer:
raise MemoryError()
-
+
if isinstance(fobj, file_types):
kr = defs.extattr_list_file(fobj.fileno(), namespace, data_buffer, nbytes)
elif type(fobj) is int:
- kr = defs.exattr_list_file(fobj, namespace, data_buffer, nbytes)
+ kr = defs.extattr_list_file(fobj, namespace, data_buffer, nbytes)
elif type(fobj) is str:
if follow:
kr = defs.extattr_list_file(pname, namespace, data_buffer, nbytes)
@@ -358,6 +358,5 @@ def _list(fobj, namespace = Namespaces.USER, follow =
finally:
if data_buffer:
free(data_buffer)
-
-list = _list

+list = _list

0 comments on commit 9b6b694

Please sign in to comment.