diff options
author | Martin Langhoff <martin@laptop.org> | 2011-02-07 22:28:48 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2011-02-08 17:18:31 (GMT) |
commit | 2d07a10cafeaaf82dc8394f2bb9402de5651a83c (patch) | |
tree | 022103863cf3ccac2587afa614f9134797355247 /osbuilder.py | |
parent | 1600c668a6e0358ef1ede140100f3865ee5a46c9 (diff) |
Ensure PATH includes /sbin and /usr/sbin
Running osbuilder under sudo sometimes means a overly-sanitized path,
which can break scripts.
Diffstat (limited to 'osbuilder.py')
-rwxr-xr-x | osbuilder.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/osbuilder.py b/osbuilder.py index a1c6434..fc5d577 100755 --- a/osbuilder.py +++ b/osbuilder.py @@ -71,6 +71,11 @@ class Stage(object): env['oob_config_dir'] = os.path.dirname(self.osb.build_config) + envpath = env['PATH'].split(':') + for dir in ('/sbin', '/usr/sbin'): + if envpath.count(dir) == 0: + env['PATH'] = env['PATH'] + ':' + dir + for section in self.osb.cfg.sections(): for option in self.osb.cfg.options(section): val = self.osb.cfg.get(section, option) |