From owner-svn-ports-all@freebsd.org Fri Dec 20 10:40:30 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 898A71D5A21; Fri, 20 Dec 2019 10:40:30 +0000 (UTC) (envelope-from koobs@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fQHy32K5z3KPM; Fri, 20 Dec 2019 10:40:30 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 635BA257EB; Fri, 20 Dec 2019 10:40:30 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKAeUrA014157; Fri, 20 Dec 2019 10:40:30 GMT (envelope-from koobs@FreeBSD.org) Received: (from koobs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKAeUO0014156; Fri, 20 Dec 2019 10:40:30 GMT (envelope-from koobs@FreeBSD.org) Message-Id: <201912201040.xBKAeUO0014156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: koobs set sender to koobs@FreeBSD.org using -f From: Kubilay Kocak Date: Fri, 20 Dec 2019 10:40:30 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r520500 - in branches/2019Q4/sysutils/py-scandir: . files X-SVN-Group: ports-branches X-SVN-Commit-Author: koobs X-SVN-Commit-Paths: in branches/2019Q4/sysutils/py-scandir: . files X-SVN-Commit-Revision: 520500 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 10:40:30 -0000 Author: koobs Date: Fri Dec 20 10:40:29 2019 New Revision: 520500 URL: https://svnweb.freebsd.org/changeset/ports/520500 Log: MFH: r520359 sysutils/py-scandir: Fix unicode issues, level up ports compliance This change fixes tests and likely runtime in certain locale environments by replace the existing test_scandir.py patch with a backported upstream patch from PR #109 [1][2], coupled with setting an appropriate locale. While I'm here: - Strip shared library and add LICENSE_FILE Tests now all pass on all Python versions (2.7-3.8) [1] https://github.com/benhoyt/scandir/pull/109 [2] https://github.com/benhoyt/scandir/issues/122 Approved by: portmgr (blanket: ports compliance, bugfix) Approved by: ports-secteam (blanket(s): ports compliance, bugfix) Added: branches/2019Q4/sysutils/py-scandir/files/patch-scandir.py - copied unchanged from r520359, head/sysutils/py-scandir/files/patch-scandir.py Deleted: branches/2019Q4/sysutils/py-scandir/files/patch-test_test__scandir.py Modified: branches/2019Q4/sysutils/py-scandir/Makefile Directory Properties: branches/2019Q4/ (props changed) Modified: branches/2019Q4/sysutils/py-scandir/Makefile ============================================================================== --- branches/2019Q4/sysutils/py-scandir/Makefile Fri Dec 20 10:38:12 2019 (r520499) +++ branches/2019Q4/sysutils/py-scandir/Makefile Fri Dec 20 10:40:29 2019 (r520500) @@ -4,6 +4,7 @@ PORTNAME= scandir PORTVERSION= 1.10.0 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= sysutils python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -11,6 +12,7 @@ MAINTAINER= rene@FreeBSD.org COMMENT= Fast and featureful directory iterator LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE.txt USES= python USE_PYTHON= autoplist distutils @@ -18,7 +20,12 @@ USE_PYTHON= autoplist distutils USE_GITHUB= yes GH_ACCOUNT= benhoyt +USE_LOCALE= en_US.UTF-8 + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/_scandir.so + do-test: - ${PYTHON_CMD} ${WRKSRC}/test/run_tests.py + ${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${WRKSRC}/test/run_tests.py .include Copied: branches/2019Q4/sysutils/py-scandir/files/patch-scandir.py (from r520359, head/sysutils/py-scandir/files/patch-scandir.py) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2019Q4/sysutils/py-scandir/files/patch-scandir.py Fri Dec 20 10:40:29 2019 (r520500, copy of r520359, head/sysutils/py-scandir/files/patch-scandir.py) @@ -0,0 +1,28 @@ +# Based on https://github.com/benhoyt/scandir/pull/109 +# TODO: Upstream +# See: https://github.com/benhoyt/scandir/issues/122 + +From cfda49a07865097d3fdadc4e321881635ab2f795 Mon Sep 17 00:00:00 2001 +From: "Elias M. Mariani" +Date: Mon, 6 Aug 2018 12:06:44 -0300 +Subject: [PATCH] Fix dirent.h struct alignment on OpenBSD + +--- scandir.py.orig 2019-03-09 17:51:39 UTC ++++ scandir.py +@@ -432,6 +432,16 @@ elif sys.platform.startswith(('linux', 'darwin', 'suno + ('__d_padding', ctypes.c_uint8 * 4), + ('d_name', ctypes.c_char * 256), + ) ++ elif 'freebsd' in sys.platform: ++ _fields_ = ( ++ ('d_ino', ctypes.c_uint64), ++ ('d_off', ctypes.c_uint64), ++ ('d_reclen', ctypes.c_uint16), ++ ('d_type', ctypes.c_uint8), ++ ('d_namlen', ctypes.c_uint8), ++ ('__d_padding', ctypes.c_uint8 * 4), ++ ('d_name', ctypes.c_char * 256), ++ ) + else: + _fields_ = ( + ('d_ino', ctypes.c_uint32), # must be uint32, not ulong