def main(): if len(sys.argv) > 2: usage(True) profile = os.environ.get('_DT_PROFILE', None) if len(sys.argv) > 1: profile = sys.argv[1] if not profile: usage(True) if profile not in profiles: print "no profile '%s'" % profile sys.exit(1) env = dict(os.environ) env['_DT_PROFILE'] = profile run('make', env=env)
def main(): if len(sys.argv) != 2: usage(True) if os.environ.get("_DT_SHELL", None): print "already in a shell" sys.exit(1) profile = sys.argv[1] if profile not in profiles: print "no profile '%s'" % profile sys.exit(1) profile_file = os.path.join(profiles_dir, profile) env = dict(os.environ) env["_DT_PROFILE"] = profile env["_DT_SHELL"] = "1" env["PS1"] = "\u@\h:\w [dt:${_DT_PROFILE}]\$ " run(os.environ["SHELL"], "--norc", env=env)
def edit(options, config, env=None): check() if env == None: env = dict(os.environ) config_dir = os.path.dirname(os.path.abspath(config)) if not os.path.exists(config_dir): os.makedirs(config_dir) mtime = 0 if os.path.exists(config): mtime = os.path.getmtime(config) env["KCONFIG_CONFIG"] = config executable = os.path.join(devtool.bin_dir, "kconfig-mconf") run(executable, options, env=env) if os.path.exists(config): mtime = os.path.getmtime(config) - mtime if mtime: return True return False
def conf(options, config, env=None): if env == None: env = dict(os.environ) env["KCONFIG_CONFIG"] = config executable = os.path.join(devtool.bin_dir, "kconfig-conf") run(executable, "--silentoldconfig", options, env=env)