On Mon, 6 Aug 2018 12:32:20 -0300, "Elias M. Mariani"
<[email protected]> wrote:
> scandir has been included in the Python 3.5 standard library as
> os.scandir(). So some packages use it for compatibility with python
> 2.7.
Glad to see the quality of this port, you did a nice work!
Here's some tweaks:
--- Makefile.orig Thu Aug 9 12:37:02 2018
+++ Makefile Thu Aug 9 12:35:59 2018
@@ -1,6 +1,6 @@
# $OpenBSD$
-COMMENT = directory iterator
+COMMENT = improved directory iterator and faster os.walk()
MODPY_EGG_VERSION = 1.8
DISTNAME = scandir-${MODPY_EGG_VERSION}
@@ -25,7 +25,7 @@ FLAVOR ?=
WANTLIB += pthread ${MODPY_WANTLIB}
-TEST_DEPENDS += sysutils/py-scandir${MODPY_FLAVOR}
+TEST_DEPENDS += ${FULLPKGNAME}:${BUILD_PKGPATH}
.if !${FLAVOR:Mpython3}
TEST_DEPENDS += devel/py-unittest2
--- pkg/DESCR.orig Thu Aug 9 12:37:19 2018
+++ pkg/DESCR Thu Aug 9 12:31:53 2018
@@ -1,2 +1,5 @@
-A directory iterator. It has been included in the Python 3.5 standard
-library.
+scandir() is a directory iteration function like os.listdir(), except that
+instead of returning a list of bare filenames, it yields DirEntry objects that
+include file type and stat information along with the name. Using scandir()
+increases the speed of os.walk() by 2-20 times (depending on the platform and
+file system) by avoiding unnecessary calls to os.stat() in most cases.
And I added the link of your merged PR in the patch header.
Are you fine with theses diffs? I'm going to import the port once I have
your approval :)
Cheers,
Daniel