Pass fixers along, strip whitespace.
This commit is contained in:
parent
9653795e26
commit
9ba2cd7bfd
4 changed files with 13 additions and 7 deletions
|
@ -150,6 +150,10 @@ def main(): # noqa: C901
|
|||
external_dir, internal_dir = session.setup_from_directory(args.directory)
|
||||
session.chdir(internal_dir)
|
||||
os.chdir(external_dir)
|
||||
|
||||
if not session.is_temporary and args.subcommand == 'info':
|
||||
args.explain = True
|
||||
|
||||
if args.resolve == "apt":
|
||||
resolver = AptResolver.from_session(session)
|
||||
elif args.resolve == "native":
|
||||
|
@ -211,7 +215,7 @@ def main(): # noqa: C901
|
|||
if args.subcommand == "info":
|
||||
from .info import run_info
|
||||
|
||||
run_info(session, buildsystems=bss)
|
||||
run_info(session, buildsystems=bss, fixers=fixers)
|
||||
except ExplainInstall as e:
|
||||
display_explain_commands(e.commands)
|
||||
except (UnidentifiedError, DetailedFailure):
|
||||
|
|
|
@ -978,7 +978,7 @@ class RunTests(BuildSystem):
|
|||
|
||||
def _read_cpanfile(session, args, kind, fixers):
|
||||
for line in run_with_build_fixers(session, ["cpanfile-dump"] + args, fixers):
|
||||
yield kind, PerlModuleRequirement(line)
|
||||
yield kind, PerlModuleRequirement(line.strip())
|
||||
|
||||
|
||||
def _declared_deps_from_cpanfile(session, fixers):
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
from functools import partial
|
||||
import logging
|
||||
from typing import List, Tuple, Callable, Any
|
||||
from typing import List, Tuple, Callable, Any, Optional
|
||||
|
||||
from buildlog_consultant import Problem
|
||||
from buildlog_consultant.common import (
|
||||
|
@ -104,8 +104,10 @@ def iterate_with_build_fixers(fixers: List[BuildFixer], cb: Callable[[], Any]):
|
|||
|
||||
|
||||
def run_with_build_fixers(
|
||||
session: Session, args: List[str], fixers: List[BuildFixer], **kwargs
|
||||
session: Session, args: List[str], fixers: Optional[List[BuildFixer]], **kwargs
|
||||
):
|
||||
if fixers is None:
|
||||
fixers = []
|
||||
return iterate_with_build_fixers(
|
||||
fixers, partial(run_detecting_problems, session, args, **kwargs)
|
||||
)
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
def run_info(session, buildsystems):
|
||||
def run_info(session, buildsystems, fixers=None):
|
||||
for buildsystem in buildsystems:
|
||||
print("%r:" % buildsystem)
|
||||
deps = {}
|
||||
try:
|
||||
for kind, dep in buildsystem.get_declared_dependencies(session):
|
||||
for kind, dep in buildsystem.get_declared_dependencies(session, fixers=fixers):
|
||||
deps.setdefault(kind, []).append(dep)
|
||||
except NotImplementedError:
|
||||
print(
|
||||
|
@ -35,7 +35,7 @@ def run_info(session, buildsystems):
|
|||
print("\t\t\t%s" % dep)
|
||||
print("")
|
||||
try:
|
||||
outputs = list(buildsystem.get_declared_outputs(session))
|
||||
outputs = list(buildsystem.get_declared_outputs(session, fixers=fixers))
|
||||
except NotImplementedError:
|
||||
print("\tUnable to detect declared outputs for this type of build system")
|
||||
outputs = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue