rrs/tools/common.py: Add get_pv_type function.

get_pv_type returns the type of pv can be git, svn, hg,
etc.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
Aníbal Limón 2015-07-01 17:20:23 -05:00 committed by Paul Eggleton
parent 954e81d27a
commit 1208f6bc67

View File

@ -26,3 +26,14 @@ def update_repo(fetchdir, repo_name, repo_url, pull, logger):
out = utils.runcmd("git fetch", path, logger = logger)
return path
def get_pv_type(pv):
pv_type = ''
if '+git' in pv:
pv_type = 'git'
elif '+svn' in pv:
pv_type = 'svn'
elif '+hg' in pv:
pv_type = 'hg'
return pv_type