From nobody Mon Mar 11 08:18:57 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TtV6T6B8fz5Dxdl; Mon, 11 Mar 2024 08:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TtV6T55Tsz4cYf; Mon, 11 Mar 2024 08:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710145137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rBkONzJ+Tonl9m1SdL0VybuWc8yBuuxHd/7drAURUbY=; b=dJ60aIbMjq6J93OC9OZ98Ett7Y3hhECnM1KgTV23UYEIZE0w+Mno054J2himVzEGWK1exg +Vfo+iANvcZ9HpP1rlQ67EXzdTQTtMTzTHdhf//l07S2jbUsw8R3FXwHCw4CQHlQwKLIWM ETm3IhmeLbEJWbYcISWt5S95FXTRjRJbsZsPtQrEN+0FJ33afvh0KgMLRLNbfpLMNKer7a bYOT2NpNIrwxM1SeZ186DpJF6APL9ncYTsp9H1eHflizG+ihc5B8AO3gik+pxt091KtU00 2pYkZlEpLltDWvWX5UWXG6r+omRyPLat1BNyPGV1pQlwz8Gcx8jzrKi51F+clw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710145137; a=rsa-sha256; cv=none; b=FK2UGgudZUhgzBY46snzssx8t0tgmajTUJ9RVR3rr9Ao4YlXm9SvqTJ6lkGOsYPM3AJdgN cmeCs1SnsCowG6X0fIvaNVcO8QfLxiPgxeL8uEaUOiXQF+e1CTGDDLHyi8g7VVKR3cdQSV 7v29DvMBM+5EroiGS3mJaFcODOxW24ms32rNAQGQOsGpetLTglczzyrytAkjyobgt5OYUW 4jBhKXSlnXHxnbOCKlplDEnft/RyeOr4Fu6LQHMb/0e5/X+Ag+pSYgMZQc+FORZWKwb3Jx qj0TcgoN5hlObWToOgSQF/IjJdEfYjllQAEMJbMeNdEgBj1nL4zmtwCXd1cCCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710145137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rBkONzJ+Tonl9m1SdL0VybuWc8yBuuxHd/7drAURUbY=; b=sVDONGN9/PYMu2kmlJPrnLLBYQxWKnScDATCu9VMCL4lLofXlNjFnaqOKjdNi3C6QEpfTN if0XT77iqWz+uMy7fUvl7FRa3q9oSMUIBYNIndTfsAxz75Xc1K0RP50LYQbHObcvoJzSND 2NxwjhMykobjCGxBQfEsX78Ebx15jQiAcu52W9IkzkMJ1ujwkXZcdFmg7qPFTh28RjzTci OiMd50vilpnaIaCivbw2tu2jEZ1CpLYY2ed/6htG2QqXNTn+WNzM0GZ5jvRJ7PB0423d6d C/b3ZhIvg2KsEgKSSjLOecuYH7NbS/dLzC+FPC8YA0EPQIvm9w86P40FWcr8iQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TtV6T4jkjzMGh; Mon, 11 Mar 2024 08:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42B8IvtE089295; Mon, 11 Mar 2024 08:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42B8Ivx2089292; Mon, 11 Mar 2024 08:18:57 GMT (envelope-from git) Date: Mon, 11 Mar 2024 08:18:57 GMT Message-Id: <202403110818.42B8Ivx2089292@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Wen Heping Subject: git: c37f4c4df1ba - main - sysutils/py-scandir: Apply upstream patch to fix build with python-3.11 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wen X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c37f4c4df1baaa3c57dbf461bfe97fa1b3644f86 Auto-Submitted: auto-generated The branch main has been updated by wen: URL: https://cgit.FreeBSD.org/ports/commit/?id=c37f4c4df1baaa3c57dbf461bfe97fa1b3644f86 commit c37f4c4df1baaa3c57dbf461bfe97fa1b3644f86 Author: Wen Heping AuthorDate: 2024-03-11 08:15:10 +0000 Commit: Wen Heping CommitDate: 2024-03-11 08:17:33 +0000 sysutils/py-scandir: Apply upstream patch to fix build with python-3.11 PR: 277102 Reported by: wen@ Approved by: maintainer(timeout, > 20 days) --- sysutils/py-scandir/Makefile | 2 +- sysutils/py-scandir/files/patch-_scandir.c | 68 +++++++++++++++++++++++++++--- 2 files changed, 62 insertions(+), 8 deletions(-) diff --git a/sysutils/py-scandir/Makefile b/sysutils/py-scandir/Makefile index 927bd328241c..67883732fa31 100644 --- a/sysutils/py-scandir/Makefile +++ b/sysutils/py-scandir/Makefile @@ -1,6 +1,6 @@ PORTNAME= scandir PORTVERSION= 1.10.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/sysutils/py-scandir/files/patch-_scandir.c b/sysutils/py-scandir/files/patch-_scandir.c index a0dfd94c9f96..19e8f98f33ce 100644 --- a/sysutils/py-scandir/files/patch-_scandir.c +++ b/sysutils/py-scandir/files/patch-_scandir.c @@ -1,14 +1,68 @@ ---- _scandir.c.orig 2018-08-02 16:17:16 UTC +--- _scandir.c.orig 2024-02-16 23:29:35 UTC +++ _scandir.c -@@ -660,7 +660,11 @@ _pystat_fromstructstat(STRUCT_STAT *st) +@@ -94,7 +94,7 @@ comment): + + // _Py_stat_struct is already defined in fileutils.h on Python 3.5+ + // But not in PyPy +-#if PY_MAJOR_VERSION < 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 5) || defined(PYPY_VERSION_NUM) ++#if PY_MAJOR_VERSION < 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 5) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 11) || defined(PYPY_VERSION_NUM) + #ifdef MS_WINDOWS + struct _Py_stat_struct { + unsigned long st_dev; +@@ -660,7 +660,7 @@ _pystat_fromstructstat(STRUCT_STAT *st) return v; } -+#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 9 -+const char * const PyStructSequence_UnnamedField = "unnamed field"; -+#else - char *PyStructSequence_UnnamedField = "unnamed field"; -+#endif +-char *PyStructSequence_UnnamedField = "unnamed field"; ++static char *scandir_unnamed_field = "unnamed field"; PyDoc_STRVAR(stat_result__doc__, "stat_result: Result from stat, fstat, or lstat.\n\n\ +@@ -681,7 +681,7 @@ static PyStructSequence_Field stat_result_fields[] = { + {"st_uid", "user ID of owner"}, + {"st_gid", "group ID of owner"}, + {"st_size", "total size, in bytes"}, +- /* The NULL is replaced with PyStructSequence_UnnamedField later. */ ++ /* The NULL is replaced with scandir_unnamed_field later. */ + {NULL, "integer time of last access"}, + {NULL, "integer time of last modification"}, + {NULL, "integer time of last change"}, +@@ -986,10 +986,12 @@ DirEntry_fetch_stat(DirEntry *self, int follow_symlink + if (!path) + return NULL; + ++ Py_BEGIN_ALLOW_THREADS + if (follow_symlinks) + result = win32_stat_w(path, &st); + else + result = win32_lstat_w(path, &st); ++ Py_END_ALLOW_THREADS + + if (result != 0) { + return PyErr_SetExcFromWindowsErrWithFilenameObject(PyExc_OSError, +@@ -1014,10 +1016,12 @@ DirEntry_fetch_stat(DirEntry *self, int follow_symlink + #endif + path = PyBytes_AS_STRING(bytes); + ++ Py_BEGIN_ALLOW_THREADS + if (follow_symlinks) + result = STAT(path, &st); + else + result = LSTAT(path, &st); ++ Py_END_ALLOW_THREADS + Py_DECREF(bytes); + + if (result != 0) +@@ -1813,9 +1817,9 @@ init_scandir(void) + if (!billion) + INIT_ERROR; + +- stat_result_desc.fields[7].name = PyStructSequence_UnnamedField; +- stat_result_desc.fields[8].name = PyStructSequence_UnnamedField; +- stat_result_desc.fields[9].name = PyStructSequence_UnnamedField; ++ stat_result_desc.fields[7].name = scandir_unnamed_field; ++ stat_result_desc.fields[8].name = scandir_unnamed_field; ++ stat_result_desc.fields[9].name = scandir_unnamed_field; + PyStructSequence_InitType(&StatResultType, &stat_result_desc); + structseq_new = StatResultType.tp_new; + StatResultType.tp_new = statresult_new;