From f26bc545bb701f5e2c81dde100412765c8089394 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Sun, 14 Apr 2019 15:30:41 -0500 Subject: [PATCH 01/10] Use setuptools for installation (#34) Use setuptools entry point scripts for installation, preserve local binscripts for a 'local' install. --- bin/inquisitor | 20 ++++++++++++++++++ bin/mwmerge | 20 ++++++++++++++++++ bin/{mwmigrate.py => mwmigrate} | 1 + bin/{mwmirror.py => mwmirror} | 1 + bin/mwuse | 20 ++++++++++++++++++ bin/openmw-conflicts | 19 ++++------------- bin/pybuild | 20 ++++++++++++++++++ portmod/config.py | 2 +- {bin => portmod}/inquisitor.py | 17 ++++++++++++++- portmod/log.py | 1 + bin/mwmerge.py => portmod/omwmerge.py | 9 ++++++-- bin/pybuild.py => portmod/omwpybuild.py | 8 +++++-- bin/mwuse.py => portmod/omwuse.py | 10 ++++++++- portmod/openmw_conflicts.py | 26 +++++++++++++++++++++++ portmod/repo/__init__.py | 2 +- portmod/repo/loader.py | 5 ++++- portmod/repo/use.py | 2 +- pyproject.toml | 2 +- setup.py | 28 ++++++++++++++++--------- 19 files changed, 177 insertions(+), 36 deletions(-) create mode 100755 bin/inquisitor create mode 100755 bin/mwmerge rename bin/{mwmigrate.py => mwmigrate} (99%) rename bin/{mwmirror.py => mwmirror} (99%) create mode 100755 bin/mwuse create mode 100755 bin/pybuild rename {bin => portmod}/inquisitor.py (95%) mode change 100755 => 100644 rename bin/mwmerge.py => portmod/omwmerge.py (86%) mode change 100755 => 100644 rename bin/pybuild.py => portmod/omwpybuild.py (98%) mode change 100755 => 100644 rename bin/mwuse.py => portmod/omwuse.py (93%) mode change 100755 => 100644 create mode 100644 portmod/openmw_conflicts.py diff --git a/bin/inquisitor b/bin/inquisitor new file mode 100755 index 00000000..c99f8dec --- /dev/null +++ b/bin/inquisitor @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +# Copyright 2019 Portmod Authors +# Distributed under the terms of the GNU General Public License v3 + +import sys +from os import path as osp + + +if __name__ == "__main__": + if osp.isfile( + osp.join( + osp.dirname(osp.dirname(osp.realpath(__file__))), ".portmod_not_installed" + ) + ): + sys.path.insert(0, osp.dirname(osp.dirname(osp.realpath(__file__)))) + + from portmod.inquisitor import main + + main() diff --git a/bin/mwmerge b/bin/mwmerge new file mode 100755 index 00000000..e2c67bb9 --- /dev/null +++ b/bin/mwmerge @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +# Copyright 2019 Portmod Authors +# Distributed under the terms of the GNU General Public License v3 + +import sys +from os import path as osp + + +if __name__ == "__main__": + if osp.isfile( + osp.join( + osp.dirname(osp.dirname(osp.realpath(__file__))), ".portmod_not_installed" + ) + ): + sys.path.insert(0, osp.dirname(osp.dirname(osp.realpath(__file__)))) + + from portmod.omwmerge import main + + main() diff --git a/bin/mwmigrate.py b/bin/mwmigrate similarity index 99% rename from bin/mwmigrate.py rename to bin/mwmigrate index cc923d0a..a8871aa2 100755 --- a/bin/mwmigrate.py +++ b/bin/mwmigrate @@ -6,6 +6,7 @@ import sys from os import path as osp + if __name__ == "__main__": if osp.isfile( osp.join( diff --git a/bin/mwmirror.py b/bin/mwmirror similarity index 99% rename from bin/mwmirror.py rename to bin/mwmirror index 2c5449fa..f4e182e7 100755 --- a/bin/mwmirror.py +++ b/bin/mwmirror @@ -6,6 +6,7 @@ import sys from os import path as osp + if __name__ == "__main__": if osp.isfile( osp.join( diff --git a/bin/mwuse b/bin/mwuse new file mode 100755 index 00000000..9641996b --- /dev/null +++ b/bin/mwuse @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +# Copyright 2019 Portmod Authors +# Distributed under the terms of the GNU General Public License v3 + +import sys +from os import path as osp + + +if __name__ == "__main__": + if osp.isfile( + osp.join( + osp.dirname(osp.dirname(osp.realpath(__file__))), ".portmod_not_installed" + ) + ): + sys.path.insert(0, osp.dirname(osp.dirname(osp.realpath(__file__)))) + + from portmod.omwuse import main + + main() diff --git a/bin/openmw-conflicts b/bin/openmw-conflicts index f187de3d..fe46893b 100755 --- a/bin/openmw-conflicts +++ b/bin/openmw-conflicts @@ -1,13 +1,12 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Copyright 2019 Portmod Authors # Distributed under the terms of the GNU General Public License v3 -import shutil -import subprocess import sys from os import path as osp + if __name__ == "__main__": if osp.isfile( osp.join( @@ -16,16 +15,6 @@ if __name__ == "__main__": ): sys.path.insert(0, osp.dirname(osp.dirname(osp.realpath(__file__)))) - from portmod.config import find_config, read_config - - config = read_config() - - mod_dirs = [directory for (index, directory) in find_config(config, "data", "*")] - - args = ["dcv"] - args.extend(mod_dirs) + from portmod.openmw_conflicts import main - if shutil.which("dcv"): - subprocess.Popen(args).wait() - else: - print('Error: Could not find "dcv"') + main() diff --git a/bin/pybuild b/bin/pybuild new file mode 100755 index 00000000..3e643bbd --- /dev/null +++ b/bin/pybuild @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +# Copyright 2019 Portmod Authors +# Distributed under the terms of the GNU General Public License v3 + +import sys +from os import path as osp + + +if __name__ == "__main__": + if osp.isfile( + osp.join( + osp.dirname(osp.dirname(osp.realpath(__file__))), ".portmod_not_installed" + ) + ): + sys.path.insert(0, osp.dirname(osp.dirname(osp.realpath(__file__)))) + + from portmod.omwpybuild import main + + main() diff --git a/portmod/config.py b/portmod/config.py index 7cd6743c..479e9430 100644 --- a/portmod/config.py +++ b/portmod/config.py @@ -1,7 +1,7 @@ # Copyright 2019 Portmod Authors # Distributed under the terms of the GNU General Public License v3 -from portmod.globals import OPENMW_CONFIG, OPENMW_CONFIG_DIR +from .globals import OPENMW_CONFIG, OPENMW_CONFIG_DIR import fnmatch import shutil import re diff --git a/bin/inquisitor.py b/portmod/inquisitor.py old mode 100755 new mode 100644 similarity index 95% rename from bin/inquisitor.py rename to portmod/inquisitor.py index e264821a..7e07f5f8 --- a/bin/inquisitor.py +++ b/portmod/inquisitor.py @@ -8,7 +8,8 @@ import sys import argparse from os import path as osp -if __name__ == "__main__": + +def main(): if osp.isfile( osp.join( osp.dirname(osp.dirname(osp.realpath(__file__))), ".portmod_not_installed" @@ -38,6 +39,14 @@ if __name__ == "__main__": from portmod.main import pybuild_validate, pybuild_manifest from portmod.repo.metadata import get_categories, get_repo_root, license_exists import portmod.log as log + from portmod.repo.metadata import ( + get_categories, + get_repo_root, + license_exists, + Person, + Group, + ) + from portmod.log import err from portmod.repo.list import read_list import portmod.repos as repos @@ -177,5 +186,11 @@ if __name__ == "__main__": # Check that distfiles occur in the manifest pass +<<<<<<< HEAD:bin/inquisitor.py if error: exit(1) +======= + +if __name__ == "__main__": + main() +>>>>>>> Moved scripts into the library part of portmod, use setuptools:portmod/inquisitor.py diff --git a/portmod/log.py b/portmod/log.py index 899cd748..48795bae 100644 --- a/portmod/log.py +++ b/portmod/log.py @@ -11,3 +11,4 @@ def warn(string): def err(string): print("{}: {}".format(colour(Fore.RED, "ERROR"), string)) + exit(1) diff --git a/bin/mwmerge.py b/portmod/omwmerge.py old mode 100755 new mode 100644 similarity index 86% rename from bin/mwmerge.py rename to portmod/omwmerge.py index 25ac7812..f5263c6a --- a/bin/mwmerge.py +++ b/portmod/omwmerge.py @@ -7,7 +7,8 @@ import sys import os from os import path as osp -if __name__ == "__main__": + +def main(): if osp.isfile( osp.join( osp.dirname(osp.dirname(osp.realpath(__file__))), ".portmod_not_installed" @@ -18,6 +19,10 @@ if __name__ == "__main__": # Avoid buffering so that we can read from other processes as they output os.environ["PYTHONUNBUFFERED"] = "1" - from portmod.main import main + from portmod.main import main as portmod_main + + portmod_main() + +if __name__ == "__main__": main() diff --git a/bin/pybuild.py b/portmod/omwpybuild.py old mode 100755 new mode 100644 similarity index 98% rename from bin/pybuild.py rename to portmod/omwpybuild.py index 7c723bfb..53b5b71e --- a/bin/pybuild.py +++ b/portmod/omwpybuild.py @@ -7,7 +7,8 @@ import sys import argparse from os import path as osp -if __name__ == "__main__": + +def main(): if osp.isfile( osp.join( osp.dirname(osp.dirname(osp.realpath(__file__))), ".portmod_not_installed" @@ -21,7 +22,6 @@ if __name__ == "__main__": from portmod.repo.download import download_mod from portmod.mod import install_mod, remove_mod from portmod.main import pybuild_validate, pybuild_manifest - from portmod.log import err parser = argparse.ArgumentParser( description="Command line interface to interact with pybuilds" @@ -72,3 +72,7 @@ if __name__ == "__main__": if args.debug: traceback.print_exc() err("{}".format(e)) + + +if __name__ == "__main__": + main() diff --git a/bin/mwuse.py b/portmod/omwuse.py old mode 100755 new mode 100644 similarity index 93% rename from bin/mwuse.py rename to portmod/omwuse.py index 2c77ff6c..91e3737e --- a/bin/mwuse.py +++ b/portmod/omwuse.py @@ -6,8 +6,10 @@ import sys import argparse from os import path as osp +from portmod.repo.use import add_use, remove_use -if __name__ == "__main__": + +def main(): if osp.isfile( osp.join( osp.dirname(osp.dirname(osp.realpath(__file__))), ".portmod_not_installed" @@ -63,3 +65,9 @@ if __name__ == "__main__": if args.debug: traceback.print_exc() err("{}".format(e)) + if args.R: + remove_use(args.R, args.m) + + +if __name__ == "__main__": + main() diff --git a/portmod/openmw_conflicts.py b/portmod/openmw_conflicts.py new file mode 100644 index 00000000..ad30e0ad --- /dev/null +++ b/portmod/openmw_conflicts.py @@ -0,0 +1,26 @@ +#!/usr/bin/python + +# Copyright 2019 Portmod Authors +# Distributed under the terms of the GNU General Public License v3 + +import shutil +import subprocess +from portmod.config import find_config, read_config + + +def main(): + config = read_config() + + mod_dirs = [directory for (index, directory) in find_config(config, "data", "*")] + + args = ["dcv"] + args.extend(mod_dirs) + + if shutil.which("dcv"): + subprocess.Popen(args).wait() + else: + print('Error: Could not find "dcv"') + + +if __name__ == "__main__": + main() diff --git a/portmod/repo/__init__.py b/portmod/repo/__init__.py index 1d80707f..1843c046 100644 --- a/portmod/repo/__init__.py +++ b/portmod/repo/__init__.py @@ -1,4 +1,4 @@ # Copyright 2019 Portmod Authors # Distributed under the terms of the GNU General Public License v3 -from portmod.repo.atom import Atom # noqa # pylint: disable=unused-import +from .atom import Atom # noqa # pylint: disable=unused-import diff --git a/portmod/repo/loader.py b/portmod/repo/loader.py index dface8b8..9675f421 100644 --- a/portmod/repo/loader.py +++ b/portmod/repo/loader.py @@ -13,6 +13,7 @@ from portmod.repos import REPOS from portmod.repo.metadata import get_categories import portmod.globals from .atom import Atom +from portmod.repo import use # We store a cache of mods so that they are only loaded once @@ -38,6 +39,8 @@ def load_file(file): return None mod.FILE = os.path.abspath(file) mod.INSTALLED = False + (enabled, disabled) = use.get_use(mod) + mod.USE = enabled return mod @@ -59,7 +62,7 @@ def load_all_installed(): return mods -def __load_installed_mod(path): +def __load_installed_mod(path, atom=None): if os.path.exists(path): files = glob.glob(os.path.join(path, "*.pybuild")) if len(files) > 1: diff --git a/portmod/repo/use.py b/portmod/repo/use.py index a38f97b4..a6a40737 100644 --- a/portmod/repo/use.py +++ b/portmod/repo/use.py @@ -6,8 +6,8 @@ from typing import AbstractSet, Any, Callable, List, Optional, Type import os import configparser from portmod.globals import GLOBAL_USE, PORTMOD_CONFIG_DIR, PORTMOD_CONFIG -import portmod.repo.loader as loader from portmod.repo.util import select_mod +from portmod.repo import loader from portmod.repo.flags import get_flags, add_flag, remove_flag from portmod.repo.textures import select_texture_size from portmod.repo.atom import Atom, InvalidAtom, useflag_re diff --git a/pyproject.toml b/pyproject.toml index 53f900bf..21efbd77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] # Minimum requirements for the build system to execute. -requires = [] +requires = ["setuptools", "wheel"] [tool.black] line-length = 88 diff --git a/setup.py b/setup.py index ee40c7ed..1fde83ab 100755 --- a/setup.py +++ b/setup.py @@ -4,20 +4,28 @@ # Distributed under the terms of the GNU General Public License v3 -from distutils.core import setup +from setuptools import setup setup( name="portmod", version="1.0", + author="Portmod Authors", + description="https://gitlab.com/portmod/portmod", + download_url="A CLI tool to manage mods for OpenMW", + license="GPLv3", url="https://gitlab.com/portmod/portmod", - scripts=[ - "bin/inquisitor.py", - "bin/mwmerge.py", - "bin/mwuse.py", - "bin/openmw-conflicts", - "bin/pybuild.py", - "bin/mwmirror.py", - "bin/mwmigrate.py", - ], packages=["portmod", "portmod.repo", "portmod.pybuild"], + entry_points=( + { + "console_scripts": [ + "inquisitor = portmod.inquisitor:main", + "mwmerge = portmod.omwmerge:main", + "mwmigrate = portmod.migrate:migrate", + "mwmirror = portmod.mirror:mirror", + "mwuse = portmod.omwuse:main", + "openmw-conflicts = portmod.openmw_conflicts:main", + "pybuild = portmod.omwpybuild:main", + ] + } + ), ) -- GitLab From b4f3a99073aaff9ea90c56b841eedf15aa5dc8d0 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Mon, 13 May 2019 19:19:24 -0500 Subject: [PATCH 02/10] mw -> omw --- bin/{mwmerge => omwmerge} | 0 bin/{mwmigrate => omwmigrate} | 0 bin/{mwmirror => omwmirror} | 0 bin/{mwuse => omwuse} | 0 setup.py | 8 ++++---- 5 files changed, 4 insertions(+), 4 deletions(-) rename bin/{mwmerge => omwmerge} (100%) rename bin/{mwmigrate => omwmigrate} (100%) rename bin/{mwmirror => omwmirror} (100%) rename bin/{mwuse => omwuse} (100%) diff --git a/bin/mwmerge b/bin/omwmerge similarity index 100% rename from bin/mwmerge rename to bin/omwmerge diff --git a/bin/mwmigrate b/bin/omwmigrate similarity index 100% rename from bin/mwmigrate rename to bin/omwmigrate diff --git a/bin/mwmirror b/bin/omwmirror similarity index 100% rename from bin/mwmirror rename to bin/omwmirror diff --git a/bin/mwuse b/bin/omwuse similarity index 100% rename from bin/mwuse rename to bin/omwuse diff --git a/setup.py b/setup.py index 1fde83ab..bdbacbbe 100755 --- a/setup.py +++ b/setup.py @@ -19,10 +19,10 @@ setup( { "console_scripts": [ "inquisitor = portmod.inquisitor:main", - "mwmerge = portmod.omwmerge:main", - "mwmigrate = portmod.migrate:migrate", - "mwmirror = portmod.mirror:mirror", - "mwuse = portmod.omwuse:main", + "omwmerge = portmod.omwmerge:main", + "omwmigrate = portmod.migrate:migrate", + "omwmirror = portmod.mirror:mirror", + "omwuse = portmod.omwuse:main", "openmw-conflicts = portmod.openmw_conflicts:main", "pybuild = portmod.omwpybuild:main", ] -- GitLab From df38d9972709eb8213f6fa04383e22e22d9fb041 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Mon, 13 May 2019 19:28:12 -0500 Subject: [PATCH 03/10] Use the right script names in CI --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c996431..18686321 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,9 +28,9 @@ before_script: inquisitor: stage: test script: - - mwmerge.py --sync + - omwmerge --sync - cd ~/.local/share/portmod/openmw - - inquisitor.py + - inquisitor install: stage: build -- GitLab From b5cfa12f36a1d274bc2206cbfad0a00e0752c78d Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Mon, 13 May 2019 19:37:45 -0500 Subject: [PATCH 04/10] Removed leftover git merge stuff --- portmod/inquisitor.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/portmod/inquisitor.py b/portmod/inquisitor.py index 7e07f5f8..c6e79eab 100644 --- a/portmod/inquisitor.py +++ b/portmod/inquisitor.py @@ -186,11 +186,9 @@ def main(): # Check that distfiles occur in the manifest pass -<<<<<<< HEAD:bin/inquisitor.py if error: exit(1) -======= + if __name__ == "__main__": main() ->>>>>>> Moved scripts into the library part of portmod, use setuptools:portmod/inquisitor.py -- GitLab From 5cf512c049b472bafa7b0b650ec33e8568d38d05 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Mon, 13 May 2019 19:41:40 -0500 Subject: [PATCH 05/10] Fix flake8 problems --- portmod/inquisitor.py | 13 ------------- portmod/omwpybuild.py | 1 + portmod/omwuse.py | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/portmod/inquisitor.py b/portmod/inquisitor.py index c6e79eab..b2c6bc5b 100644 --- a/portmod/inquisitor.py +++ b/portmod/inquisitor.py @@ -38,14 +38,6 @@ def main(): from portmod.yaml import yaml_load, Person, Group from portmod.main import pybuild_validate, pybuild_manifest from portmod.repo.metadata import get_categories, get_repo_root, license_exists - import portmod.log as log - from portmod.repo.metadata import ( - get_categories, - get_repo_root, - license_exists, - Person, - Group, - ) from portmod.log import err from portmod.repo.list import read_list import portmod.repos as repos @@ -54,11 +46,6 @@ def main(): error = False - def err(string: str): - global error - log.err(string) - error = True - if repo_root is None: err( "Cannot find repository for the current directory. " diff --git a/portmod/omwpybuild.py b/portmod/omwpybuild.py index 53b5b71e..83b3cec4 100644 --- a/portmod/omwpybuild.py +++ b/portmod/omwpybuild.py @@ -20,6 +20,7 @@ def main(): import portmod.globals from portmod.repo.loader import load_file from portmod.repo.download import download_mod + from portmod.log import err from portmod.mod import install_mod, remove_mod from portmod.main import pybuild_validate, pybuild_manifest diff --git a/portmod/omwuse.py b/portmod/omwuse.py index 91e3737e..60377a0b 100644 --- a/portmod/omwuse.py +++ b/portmod/omwuse.py @@ -6,7 +6,6 @@ import sys import argparse from os import path as osp -from portmod.repo.use import add_use, remove_use def main(): -- GitLab From 9d4b04b8f398903fffda4413bc796dc1604926d0 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Tue, 14 May 2019 10:28:33 -0500 Subject: [PATCH 06/10] Update usage instructions to reflect new executable names Install instructions have been expanded too. --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5d1adf6a..59426b48 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,22 @@ https://gitlab.com/bmwinger/omwcmd ## Installing on Linux To install into `/usr/bin` (requires root), run -```sudo ./setup.py install``` + + git clone https://gitlab.com/portmod/portmod + sudo pip3 install /path/to/portmod + +Or, directly from Gitlab: + + sudo pip3 install git+https://gitlab.com/portmod/portmod To install into `~/.local/bin`, run -```./setup.py install --user``` + + git clone https://gitlab.com/portmod/portmod + pip3 install --user --upgrade /path/to/portmod + +Or, directly from Gitlab: + + pip3 install --user --upgrade git+https://gitlab.com/portmod/portmod You will want to create a config file in ~/.config/portmod/portmod.cfg. A sample is included in the root of the repository. Primarily you will want to set the USE variable and the ARCH variable to reflect your openmw setup. @@ -41,11 +53,11 @@ https://git-scm.com/download/win Before installing other mods, you should explicitly install the morrowind mod. This pybuild automatically detects the location of your morrowind installation and "installs it" by creating a softlink to this installation. This is done so that the morrowind data files can be treated just like other data files. You may also want to install omwllf to merge levelled lists. Mods can be installed by passing the relevant atoms as command line arguments. E.g.: -`mwmerge morrowind omwllf` +`omwmerge morrowind omwllf` You can search for mods using the `--search`/`-s` (searches name only) and `--searchdesc`/`-S` (searches name and description) options. -Specific versions of mods can be installed by including the version number: `mwmerge abandoned-flat-2.0` +Specific versions of mods can be installed by including the version number: `omwmerge abandoned-flat-2.0` Specified mods will be automatically be downloaded, configured and installed. -- GitLab From 23707ab6d5810de6b2322b57ef50e18c18eb9364 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Tue, 14 May 2019 18:19:32 -0500 Subject: [PATCH 07/10] Corrections based on PR feedback --- portmod/log.py | 1 - portmod/omwuse.py | 2 -- portmod/repo/loader.py | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/portmod/log.py b/portmod/log.py index 48795bae..899cd748 100644 --- a/portmod/log.py +++ b/portmod/log.py @@ -11,4 +11,3 @@ def warn(string): def err(string): print("{}: {}".format(colour(Fore.RED, "ERROR"), string)) - exit(1) diff --git a/portmod/omwuse.py b/portmod/omwuse.py index 60377a0b..f29ae195 100644 --- a/portmod/omwuse.py +++ b/portmod/omwuse.py @@ -64,8 +64,6 @@ def main(): if args.debug: traceback.print_exc() err("{}".format(e)) - if args.R: - remove_use(args.R, args.m) if __name__ == "__main__": diff --git a/portmod/repo/loader.py b/portmod/repo/loader.py index 9675f421..aa0367a6 100644 --- a/portmod/repo/loader.py +++ b/portmod/repo/loader.py @@ -39,7 +39,6 @@ def load_file(file): return None mod.FILE = os.path.abspath(file) mod.INSTALLED = False - (enabled, disabled) = use.get_use(mod) mod.USE = enabled return mod @@ -62,7 +61,7 @@ def load_all_installed(): return mods -def __load_installed_mod(path, atom=None): +def __load_installed_mod(path): if os.path.exists(path): files = glob.glob(os.path.join(path, "*.pybuild")) if len(files) > 1: -- GitLab From 5ec346ed62386d71a135bee4f04c7fcea315b372 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Tue, 14 May 2019 18:24:08 -0500 Subject: [PATCH 08/10] Removed unused import --- portmod/repo/loader.py | 1 - 1 file changed, 1 deletion(-) diff --git a/portmod/repo/loader.py b/portmod/repo/loader.py index aa0367a6..af686540 100644 --- a/portmod/repo/loader.py +++ b/portmod/repo/loader.py @@ -13,7 +13,6 @@ from portmod.repos import REPOS from portmod.repo.metadata import get_categories import portmod.globals from .atom import Atom -from portmod.repo import use # We store a cache of mods so that they are only loaded once -- GitLab From 66d6e29d7de181ea5cc8a95445e6c79071fd8196 Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Tue, 14 May 2019 18:30:28 -0500 Subject: [PATCH 09/10] Use isn't being updated here, remove that line --- portmod/repo/loader.py | 1 - 1 file changed, 1 deletion(-) diff --git a/portmod/repo/loader.py b/portmod/repo/loader.py index af686540..dface8b8 100644 --- a/portmod/repo/loader.py +++ b/portmod/repo/loader.py @@ -38,7 +38,6 @@ def load_file(file): return None mod.FILE = os.path.abspath(file) mod.INSTALLED = False - mod.USE = enabled return mod -- GitLab From d3562cbbd10ecada8e01801f02f8602dc44deccd Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Tue, 14 May 2019 19:46:54 -0500 Subject: [PATCH 10/10] Re-add err() wrapper --- portmod/inquisitor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/portmod/inquisitor.py b/portmod/inquisitor.py index b2c6bc5b..f070ec69 100644 --- a/portmod/inquisitor.py +++ b/portmod/inquisitor.py @@ -38,7 +38,7 @@ def main(): from portmod.yaml import yaml_load, Person, Group from portmod.main import pybuild_validate, pybuild_manifest from portmod.repo.metadata import get_categories, get_repo_root, license_exists - from portmod.log import err + import portmod.log as log from portmod.repo.list import read_list import portmod.repos as repos @@ -46,6 +46,11 @@ def main(): error = False + def err(string: str): + global error + log.err(string) + error = True + if repo_root is None: err( "Cannot find repository for the current directory. " -- GitLab