mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-21 19:41:15 +00:00
pkg-config wrapper: disable logging by default
This commit is contained in:
parent
c15e85e713
commit
d9585fd22a
1 changed files with 17 additions and 8 deletions
23
deps/system/bin/pkg-config
vendored
23
deps/system/bin/pkg-config
vendored
|
@ -25,12 +25,22 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
_LOG_FILENAME = '' # 'pkg-config.log'
|
||||||
|
|
||||||
|
|
||||||
|
def _write_log(message: str):
|
||||||
|
if not _LOG_FILENAME:
|
||||||
|
return
|
||||||
|
|
||||||
|
with open(_LOG_FILENAME, 'a') as log:
|
||||||
|
log.write(message)
|
||||||
|
|
||||||
|
|
||||||
def _main():
|
def _main():
|
||||||
args = sys.argv[1:]
|
args = sys.argv[1:]
|
||||||
|
|
||||||
with open('pkg-config.log', 'a') as log:
|
|
||||||
cmdline = ' '.join(map(shlex.quote, args))
|
cmdline = ' '.join(map(shlex.quote, args))
|
||||||
log.write(f'% pkg-config {cmdline}\n')
|
_write_log(f'% pkg-config {cmdline}\n')
|
||||||
|
|
||||||
bin_path = Path(__file__).parent
|
bin_path = Path(__file__).parent
|
||||||
prefix_path = bin_path.parent
|
prefix_path = bin_path.parent
|
||||||
|
@ -50,11 +60,10 @@ def _main():
|
||||||
stdout = result.stdout.decode('ascii')
|
stdout = result.stdout.decode('ascii')
|
||||||
stderr = result.stderr.decode('ascii')
|
stderr = result.stderr.decode('ascii')
|
||||||
|
|
||||||
with open('pkg-config.log', 'a') as log:
|
_write_log('out> ')
|
||||||
log.write('out> ')
|
_write_log(stdout if stdout else '\n')
|
||||||
log.write(stdout if stdout else '\n')
|
_write_log('err> ')
|
||||||
log.write('err> ')
|
_write_log(stderr if stderr else '\n')
|
||||||
log.write(stderr if stderr else '\n')
|
|
||||||
|
|
||||||
sys.stdout.write(stdout)
|
sys.stdout.write(stdout)
|
||||||
sys.stderr.write(stderr)
|
sys.stderr.write(stderr)
|
||||||
|
|
Loading…
Reference in a new issue