]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: create: fix extraction of name from URLs ending in /
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 22 Jan 2016 12:00:00 +0000 (01:00 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 22 Jan 2016 23:42:57 +0000 (23:42 +0000)
If the URL ends in a / then we want to strip that off the path we split
out of the URL before calling os.path.basename() on it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/recipetool/create.py

index 5caf3741b811240602d030c51bb542f118a309af..f0bb58e4bd367e5e7e32b96fd29672b92a61ca67 100644 (file)
@@ -432,7 +432,7 @@ def create_recipe(args):
     if srcuri and not realpv or not pn:
         parseres = urlparse.urlparse(srcuri)
         if parseres.path:
-            srcfile = os.path.basename(parseres.path)
+            srcfile = os.path.basename(parseres.path.rstrip('/'))
             name_pn, name_pv = determine_from_filename(srcfile)
             logger.debug('Determined from filename: name = "%s", version = "%s"' % (name_pn, name_pv))
             if name_pn and not pn: