diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-05-15 22:52:15 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-05-15 22:52:15 (GMT) |
commit | 88d9adf2df28f5f1e4d1182f4db48ddbcbc88062 (patch) | |
tree | 5a2db793e59660c5f7d1740721f43e4557508141 /src/engine | |
parent | 514ed6f180a869c28d12dfa34c8cdf32d7cbca4c (diff) | |
download | SCons-88d9adf2df28f5f1e4d1182f4db48ddbcbc88062.zip SCons-88d9adf2df28f5f1e4d1182f4db48ddbcbc88062.tar.gz SCons-88d9adf2df28f5f1e4d1182f4db48ddbcbc88062.tar.bz2 |
py2/3 don't call id in ipkg tool generate method if it's not available. This was causing test/import.py to fail
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Tool/ipkg.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/engine/SCons/Tool/ipkg.py b/src/engine/SCons/Tool/ipkg.py index 452cbb9..df77eea 100644 --- a/src/engine/SCons/Tool/ipkg.py +++ b/src/engine/SCons/Tool/ipkg.py @@ -44,20 +44,26 @@ def generate(env): try: bld = env['BUILDERS']['Ipkg'] except KeyError: - bld = SCons.Builder.Builder( action = '$IPKGCOM', - suffix = '$IPKGSUFFIX', - source_scanner = None, - target_scanner = None) + bld = SCons.Builder.Builder(action='$IPKGCOM', + suffix='$IPKGSUFFIX', + source_scanner=None, + target_scanner=None) env['BUILDERS']['Ipkg'] = bld - env['IPKG'] = 'ipkg-build' - env['IPKGCOM'] = '$IPKG $IPKGFLAGS ${SOURCE}' - env['IPKGUSER'] = os.popen('id -un').read().strip() - env['IPKGGROUP'] = os.popen('id -gn').read().strip() - env['IPKGFLAGS'] = SCons.Util.CLVar('-o $IPKGUSER -g $IPKGGROUP') + + env['IPKG'] = 'ipkg-build' + env['IPKGCOM'] = '$IPKG $IPKGFLAGS ${SOURCE}' + + if env.WhereIs('id'): + env['IPKGUSER'] = os.popen('id -un').read().strip() + env['IPKGGROUP'] = os.popen('id -gn').read().strip() + env['IPKGFLAGS'] = SCons.Util.CLVar('-o $IPKGUSER -g $IPKGGROUP') env['IPKGSUFFIX'] = '.ipk' def exists(env): + """ + Can we find the tool + """ return env.Detect('ipkg-build') # Local Variables: |