diff options
Diffstat (limited to 'scripts/lib/recipetool')
-rw-r--r-- | scripts/lib/recipetool/create.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 5af58a12f7..2a5a84c3c7 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -339,9 +339,14 @@ def determine_from_url(srcuri): | |||
339 | pn = res.group(1).strip().replace('_', '-') | 339 | pn = res.group(1).strip().replace('_', '-') |
340 | pv = res.group(2).strip().replace('_', '.') | 340 | pv = res.group(2).strip().replace('_', '.') |
341 | 341 | ||
342 | if not pn and not pv and parseres.scheme not in ['git', 'gitsm', 'svn', 'hg']: | 342 | if not pn and not pv: |
343 | srcfile = os.path.basename(parseres.path.rstrip('/')) | 343 | if parseres.scheme not in ['git', 'gitsm', 'svn', 'hg']: |
344 | pn, pv = determine_from_filename(srcfile) | 344 | srcfile = os.path.basename(parseres.path.rstrip('/')) |
345 | pn, pv = determine_from_filename(srcfile) | ||
346 | elif parseres.scheme in ['git', 'gitsm']: | ||
347 | pn = os.path.basename(parseres.path.rstrip('/')).lower().replace('_', '-') | ||
348 | if pn.endswith('.git'): | ||
349 | pn = pn[:-4] | ||
345 | 350 | ||
346 | logger.debug('Determined from source URL: name = "%s", version = "%s"' % (pn, pv)) | 351 | logger.debug('Determined from source URL: name = "%s", version = "%s"' % (pn, pv)) |
347 | return (pn, pv) | 352 | return (pn, pv) |