def which(program): """ find program in the environment PATH :return: path to program if found, None otherwise """ import warnings warnings.warn("qibuild.sh.which is deprecated, " "use qibuild.command.find_program instead") from qibuild.command import find_program return find_program(program)
def which(program): """ find program in the environment PATH :return: path to program if found, None otherwise """ import warnings warnings.warn("qibuild.sh.which is deprecated, " "use qibuild.command.find_program instead") from qibuild.command import find_program return find_program(program)
def get_remote_refs(git_url): """ return a dict with remote refs return { 'refs/bla/bla' : 'sha1', 'refs/bla/bla2' : 'sha2' } """ git = command.find_program("git") if not git: raise Exception("git not found") process = subprocess.Popen([git, "ls-remote", git_url], stdout=subprocess.PIPE) out = process.communicate()[0] lines = out.splitlines() return _dict_from_refs(lines)
def find_git(): """ Find the Git executable """ # FIXME: trusting path when on a cmd line makes sense, # but one day we may have a GUI calling qisrc... return command.find_program("git")