mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
pbuilder and cowbuilder live in sbin
This commit is contained in:
parent
30da459114
commit
f363b745ff
@ -36,11 +36,14 @@ from ubuntutools.sponsor_patch.question import ask_for_manual_fixing
|
||||
from ubuntutools.sponsor_patch.source_package import SourcePackage
|
||||
|
||||
|
||||
def is_command_available(command):
|
||||
def is_command_available(command, check_sbin=False):
|
||||
"Is command in $PATH?"
|
||||
path = os.environ.get('PATH', '/usr/bin:/bin')
|
||||
path = os.environ.get('PATH', '/usr/bin:/bin').split(':')
|
||||
if check_sbin:
|
||||
path += [directory[:-3] + 'sbin'
|
||||
for directory in path if directory.endswith('/bin')]
|
||||
return any(os.access(os.path.join(directory, command), os.X_OK)
|
||||
for directory in path.split(':'))
|
||||
for directory in path)
|
||||
|
||||
|
||||
def check_dependencies():
|
||||
@ -51,7 +54,7 @@ def check_dependencies():
|
||||
missing.append(cmd)
|
||||
if not is_command_available('bzr-buildpackage'):
|
||||
missing.append('bzr-builddeb')
|
||||
if not any(is_command_available(cmd)
|
||||
if not any(is_command_available(cmd, check_sbin=True)
|
||||
for cmd in ('pbuilder', 'sbuild', 'cowbuilder')):
|
||||
missing.append('pbuilder/cowbuilder/sbuild')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user