From: Paul Eggleton Date: Fri, 22 Jan 2016 12:00:00 +0000 (+1300) Subject: recipetool: create: fix extraction of name from URLs ending in / X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~27418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=308189beda8a31541481d09e3d5e86187e843d8d;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git recipetool: create: fix extraction of name from URLs ending in / 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 Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 5caf3741b81..f0bb58e4bd3 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -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: