mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
Check for builder in sbin paths even if they aren't in PATH
This commit is contained in:
parent
684e340b54
commit
781d077af8
@ -77,11 +77,9 @@ class pbuilder_dist:
|
|||||||
self.builder = builder
|
self.builder = builder
|
||||||
|
|
||||||
# Ensure that the used builder is installed
|
# Ensure that the used builder is installed
|
||||||
for file in os.environ['PATH'].split(':'):
|
paths = set(os.environ['PATH'].split(':'))
|
||||||
if os.path.exists(os.path.join(file, builder)):
|
paths |= set(('/sbin', '/usr/sbin', '/usr/local/sbin'))
|
||||||
builder = ''
|
if not any(os.path.exists(os.path.join(p, builder)) for p in paths):
|
||||||
break
|
|
||||||
if builder:
|
|
||||||
print 'Error: Could not find "%s".' % builder
|
print 'Error: Could not find "%s".' % builder
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user