Hi,

Attached is a diff to update to py-texscythe and a diff to make
texlive/texmf use it. This is on the roadmap to tex live 2015, which is
nearing completion too.

I've decided to install pre-built sqlite databases for the last two
versions of TeX live in a similar vein to sqlports.

OK?

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk
Index: Makefile
===================================================================
RCS file: /home/edd/cvsync/ports/devel/py-texscythe/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile    29 Sep 2015 10:52:12 -0000      1.2
+++ Makefile    28 Apr 2016 13:18:00 -0000
@@ -4,8 +4,7 @@ COMMENT =               TeX Live texmf subsetter tool
 
 DISTNAME =             texscythe-${MODPY_EGG_VERSION}
 PKGNAME =              py-texscythe-${MODPY_EGG_VERSION}
-MODPY_EGG_VERSION =    0.1.1
-REVISION =             0
+MODPY_EGG_VERSION =    0.2.0.1
 
 CATEGORIES =           devel print
 
@@ -22,6 +21,13 @@ MODULES =            lang/python
 RUN_DEPENDS +=         databases/py-sqlalchemy
 TEST_DEPENDS =         ${RUN_DEPENDS} \
                        devel/py-test
+BUILD_DEPENDS +=       ${RUN_DEPENDS}
+
+# pre-build database for last two texlive versions.
+# texlive port can then use these directly for PLIST generation.
+post-build:
+       cd ${WRKBUILD} && ./texscyther -t texlive2015.tlpdb.gz --initdb
+       cd ${WRKBUILD} && ./texscyther -t texlive2014.tlpdb.gz --initdb
 
 do-test:
        @${MODPY_TEST_TARGET} --pytest-args="--runslow"
@@ -29,6 +35,6 @@ do-test:
 EXAMPLES =             ${PREFIX}/share/examples/py-texscythe/
 post-install:
        ${INSTALL_DATA_DIR} ${EXAMPLES}
-       ${INSTALL_DATA} ${WRKSRC}/texlive2014.tlpdb.gz ${EXAMPLES}
+       ${INSTALL_DATA} ${WRKSRC}/texlive201{4,5}.tlpdb.gz{,.db} ${EXAMPLES}
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /home/edd/cvsync/ports/devel/py-texscythe/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo    22 Sep 2015 19:49:05 -0000      1.1.1.1
+++ distinfo    28 Apr 2016 13:17:16 -0000
@@ -1,2 +1,2 @@
-SHA256 (texscythe-0.1.1.tar.gz) = Fw3OvPF+UCxotiqAiKI3xz7N8rflWWrcJunry/t2Hvc=
-SIZE (texscythe-0.1.1.tar.gz) = 1175839
+SHA256 (texscythe-0.2.0.1.tar.gz) = 
bUs+pbcVErZexpVDbMVI9tfOqZsB6FXYhES4kF4lzeA=
+SIZE (texscythe-0.2.0.1.tar.gz) = 2409909
Index: patches/patch-texscyther
===================================================================
RCS file: patches/patch-texscyther
diff -N patches/patch-texscyther
--- patches/patch-texscyther    22 Sep 2015 19:49:05 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-texscyther,v 1.1.1.1 2015/09/22 19:49:05 edd Exp $
---- texscyther.orig    Sun Jun  7 13:58:37 2015
-+++ texscyther Sun Jun  7 13:59:35 2015
-@@ -28,7 +28,7 @@ DESCR = "Compute subsets of the TeX Live texmf tree."
- def print_version():
-         print(72 * "-")
-         print("  TeXScythe Version %s" % (VERSION))
--        print("  (c) Edd Barrett 2013 <vex...@gmail.com> <e...@openbsd.org>")
-+        print("  (c) Edd Barrett 2013-2015 <e...@theunixzoo.co.uk>")
-         print(72 * "-")
- 
- if __name__ == "__main__":
Index: pkg/PLIST
===================================================================
RCS file: /home/edd/cvsync/ports/devel/py-texscythe/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST   22 Sep 2015 19:49:05 -0000      1.1.1.1
+++ pkg/PLIST   28 Apr 2016 13:17:16 -0000
@@ -19,3 +19,6 @@ lib/python${MODPY_VERSION}/site-packages
 lib/python${MODPY_VERSION}/site-packages/texscythe/tlpdbparser.pyc
 share/examples/${MODPY_PY_PREFIX}texscythe/
 share/examples/${MODPY_PY_PREFIX}texscythe/texlive2014.tlpdb.gz
+share/examples/${MODPY_PY_PREFIX}texscythe/texlive2014.tlpdb.gz.db
+share/examples/${MODPY_PY_PREFIX}texscythe/texlive2015.tlpdb.gz
+share/examples/${MODPY_PY_PREFIX}texscythe/texlive2015.tlpdb.gz.db
Index: Makefile
===================================================================
RCS file: /home/edd/cvsync/ports/print/texlive/texmf/Makefile,v
retrieving revision 1.44
diff -u -p -r1.44 Makefile
--- Makefile    3 Dec 2015 21:24:31 -0000       1.44
+++ Makefile    24 Apr 2016 22:49:14 -0000
@@ -122,8 +122,7 @@ post-install:
 # This target requires py-texscythe.
 update-plist: plist
 plist:
-       cd ${FILESDIR} && ${LOCALBASE}/bin/texscyther --initdb \
-               -t 
${LOCALBASE}//share/examples/py-texscythe/texlive2014.tlpdb.gz && \
-               ${MODPY_BIN} mk_plists.py
+       cd ${FILESDIR} && ${MODPY_BIN} mk_plists.py \
+               ${TRUEPREFIX}/share/examples/py-texscythe/texlive2014.tlpdb.gz
 
 .include <bsd.port.mk>
Index: files/mk_plists.py
===================================================================
RCS file: /home/edd/cvsync/ports/print/texlive/texmf/files/mk_plists.py,v
retrieving revision 1.2
diff -u -p -r1.2 mk_plists.py
--- files/mk_plists.py  25 Sep 2015 12:13:47 -0000      1.2
+++ files/mk_plists.py  24 Apr 2016 16:57:30 -0000
@@ -3,18 +3,26 @@
 # This is how we generate the OpenBSD packing lists for TeX Live.
 # It is hooked in to the plist target in the port makefile.
 
+import re
+import sys
+from texscythe import config, subset, orm
+
+
 PLIST_BUILDSET_OUT = "../pkg/PLIST-buildset"
 PLIST_MAIN_OUT = "../pkg/PLIST-main"
 PLIST_FULL_OUT = "../pkg/PLIST-full"
 PLIST_DOCS_OUT = "../pkg/PLIST-docs"
 PLIST_CONTEXT_OUT = "../pkg/PLIST-context"
 
-import re
-from texscythe import config, subset
-
 YEAR = 2014
 MAN_INFO_REGEX = "texmf-dist\/doc\/(man\/man[0-9]\/.*[0-9]|info\/.*\.info)$"
 
+if len(sys.argv) != 2:
+    print("Please specify a tlpdb file")
+    sys.exit(1)
+
+TLPDB = sys.argv[1]
+
 
 class NastyError(Exception):
     pass
@@ -190,13 +198,16 @@ def filter_junk(filelist):
 
 def collect_files(specs, regex=None):
     cfg = config.Config(
+        TLPDB,
         inc_pkgspecs=specs,
         plist=None,  # return file list
         prefix_filenames="share/",
         dirs=False,  # Do this manually as we will filter the list
         regex=regex,
     )
-    files = subset.compute_subset(cfg)
+    sess = orm.init_orm(cfg)
+    files = subset.compute_subset(cfg, sess)
+    sess.close()
     files = relocate_mans_and_infos(files)
     files = filter_junk(files)
     return sorted(files)

Reply via email to