From 5da798198d423ca1cb6bd6a125437df6f936a2fc Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sun, 31 Mar 2019 22:03:43 +0200 Subject: [PATCH] texlive-lancjk, texlive-langkorean: fix recursive dependency Also tidy up python scripts --- packages/texlive/check_for_conflicts.py | 2 +- packages/texlive/parse_tlpdb.py | 15 ++++++++------- packages/texlive/texlive-langcjk.subpackage.sh | 2 +- packages/texlive/texlive-langkorean.subpackage.sh | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/texlive/check_for_conflicts.py b/packages/texlive/check_for_conflicts.py index 96c79745b..3649f7988 100644 --- a/packages/texlive/check_for_conflicts.py +++ b/packages/texlive/check_for_conflicts.py @@ -1,8 +1,8 @@ #!/usr/bin/python3 +# Tiny script to check if all texlive's subpackages contain conflicting files with open("collections.txt", "r") as f: pkgs = f.read().split("\n") -# print(pkgs) files = {} for pkg in pkgs: diff --git a/packages/texlive/parse_tlpdb.py b/packages/texlive/parse_tlpdb.py index 6c28297cc..240f771ec 100755 --- a/packages/texlive/parse_tlpdb.py +++ b/packages/texlive/parse_tlpdb.py @@ -4,7 +4,7 @@ def parse_tlpdb_to_dict(tlpdb_path): """Reads given tlpdb database and creates dict with packages and their dependencies and files """ - with open(tlpdb, "r") as f: + with open(tlpdb_path, "r") as f: packages = f.read().split("\n\n") pkg_dict = {} @@ -54,10 +54,6 @@ def Files(*args, **kwargs): files += get_files_in_package(prefix+pkg, [], [], visit_collections=bool_visit_collections)[0] return files -import sys -tlpdb = sys.argv[2] -pkg_dict = parse_tlpdb_to_dict(tlpdb) - def get_conflicting_pkgs(package): """Returns list of packages that contain some files that are also found in 'package'. These packages should be listed as dependencies. @@ -88,13 +84,13 @@ def get_conflicting_pkgs(package): elif package == "bibtexextra": return ["basic", "binextra"] elif package == "langcjk": - return ["basic", "langkorean", "langother"] + return ["basic", "langother"] elif package == "latexrecommended": return ["basic", "fontsrecommended", "latexextra", "pictures", "plaingeneric"] elif package == "mathscience": return ["basic", "langgreek"] elif package == "langkorean": - return ["langjapanese", "latexrecommended"] + return ["langjapanese", "langcjk", "latexrecommended"] elif package == "latexextra": return ["fontsextra"] elif package == "humanities": @@ -110,6 +106,11 @@ def get_conflicting_pkgs(package): else: raise ValueError(sys.argv[1]+" isn't a known package name") + +import sys +tlpdb = sys.argv[2] +pkg_dict = parse_tlpdb_to_dict(tlpdb) + if len(sys.argv) > 2 and sys.argv[-1] == "print_names": """Generate dependencies to put into TERMUX_SUBPKG_DEPENDS""" # Strip latex and basic since those collections are part of termux package "texlive" diff --git a/packages/texlive/texlive-langcjk.subpackage.sh b/packages/texlive/texlive-langcjk.subpackage.sh index e5a65a45b..3181b6da0 100644 --- a/packages/texlive/texlive-langcjk.subpackage.sh +++ b/packages/texlive/texlive-langcjk.subpackage.sh @@ -1,3 +1,3 @@ TERMUX_SUBPKG_DESCRIPTION="Texlive's collection-langcjk" -TERMUX_SUBPKG_DEPENDS="texlive, texlive-langkorean, texlive-langother" +TERMUX_SUBPKG_DEPENDS="texlive, texlive-langother" TERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_PKG_BUILDER_DIR/parse_tlpdb.py $(echo $SUB_PKG_NAME | awk -F"-" '{print $2}') $TERMUX_PKG_TMPDIR/texlive.tlpdb) diff --git a/packages/texlive/texlive-langkorean.subpackage.sh b/packages/texlive/texlive-langkorean.subpackage.sh index 4261ed2bc..b1208baa0 100644 --- a/packages/texlive/texlive-langkorean.subpackage.sh +++ b/packages/texlive/texlive-langkorean.subpackage.sh @@ -1,3 +1,3 @@ TERMUX_SUBPKG_DESCRIPTION="Texlive's collection-langkorean" -TERMUX_SUBPKG_DEPENDS="texlive, texlive-langjapanese, texlive-latexrecommended" +TERMUX_SUBPKG_DEPENDS="texlive, texlive-langjapanese, texlive-langcjk, texlive-latexrecommended" TERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_PKG_BUILDER_DIR/parse_tlpdb.py $(echo $SUB_PKG_NAME | awk -F"-" '{print $2}') $TERMUX_PKG_TMPDIR/texlive.tlpdb)