Install cpanfile-dump if it's missing.
This commit is contained in:
parent
4a8d514f13
commit
fe0475bd32
2 changed files with 10 additions and 9 deletions
|
@ -913,7 +913,7 @@ class DistZilla(BuildSystem):
|
||||||
for entry in lines:
|
for entry in lines:
|
||||||
yield "build", PerlModuleRequirement(entry.strip())
|
yield "build", PerlModuleRequirement(entry.strip())
|
||||||
if os.path.exists(os.path.join(os.path.dirname(self.path), "cpanfile")):
|
if os.path.exists(os.path.join(os.path.dirname(self.path), "cpanfile")):
|
||||||
yield from _declared_deps_from_cpanfile(session)
|
yield from _declared_deps_from_cpanfile(session, fixers)
|
||||||
|
|
||||||
|
|
||||||
class RunTests(BuildSystem):
|
class RunTests(BuildSystem):
|
||||||
|
@ -938,15 +938,14 @@ class RunTests(BuildSystem):
|
||||||
run_with_build_fixers(session, ["/bin/bash", "./runtests.sh"], fixers)
|
run_with_build_fixers(session, ["/bin/bash", "./runtests.sh"], fixers)
|
||||||
|
|
||||||
|
|
||||||
def _read_cpanfile(session, args, kind):
|
def _read_cpanfile(session, args, kind, fixers):
|
||||||
output = session.check_output(['cpanfile-dump'] + args)
|
for line in run_with_build_fixers(session, ['cpanfile-dump'] + args, fixers):
|
||||||
for line in output.splitlines(False):
|
yield kind, PerlModuleRequirement(line)
|
||||||
yield kind, PerlModuleRequirement(line.decode().strip())
|
|
||||||
|
|
||||||
|
|
||||||
def _declared_deps_from_cpanfile(session):
|
def _declared_deps_from_cpanfile(session, fixers):
|
||||||
yield from _read_cpanfile(session, ['--configure', '--build'], 'build')
|
yield from _read_cpanfile(session, ['--configure', '--build'], 'build', fixers)
|
||||||
yield from _read_cpanfile(session, ['--test'], 'test')
|
yield from _read_cpanfile(session, ['--test'], 'test', fixers)
|
||||||
|
|
||||||
|
|
||||||
class Make(BuildSystem):
|
class Make(BuildSystem):
|
||||||
|
@ -1090,7 +1089,7 @@ class Make(BuildSystem):
|
||||||
yield "build", PerlModuleRequirement(require)
|
yield "build", PerlModuleRequirement(require)
|
||||||
something = True
|
something = True
|
||||||
if os.path.exists(os.path.join(self.path, "cpanfile")):
|
if os.path.exists(os.path.join(self.path, "cpanfile")):
|
||||||
yield from _declared_deps_from_cpanfile(session)
|
yield from _declared_deps_from_cpanfile(session, fixers)
|
||||||
something = True
|
something = True
|
||||||
if not something:
|
if not something:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
|
@ -108,6 +108,8 @@ class SessionSetupFailure(Exception):
|
||||||
|
|
||||||
|
|
||||||
def run_with_tee(session: Session, args: List[str], **kwargs):
|
def run_with_tee(session: Session, args: List[str], **kwargs):
|
||||||
|
if 'stdin' not in kwargs:
|
||||||
|
kwargs['stdin'] = subprocess.DEVNULL
|
||||||
p = session.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs)
|
p = session.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs)
|
||||||
contents = []
|
contents = []
|
||||||
while p.poll() is None:
|
while p.poll() is None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue