]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: create: use ${BP} for subdir for binary packages
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Sun, 29 May 2016 22:21:01 +0000 (10:21 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 30 May 2016 21:45:13 +0000 (22:45 +0100)
If we use ${BP} for the subdirectory, the default value of S will work
rather than having to have an ugly value derived from the package
file name in both places. This does mean that we have to assume the
default though (we can't just let the normal logic work because the
value of BP is the default until later on, so the replacement doesn't
work).

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 ad2618963d176508327239dc92dda1cd1770eba3..1899a0dcd83a9a314358485e36d4b87fb8717924 100644 (file)
@@ -359,7 +359,7 @@ def create_recipe(args):
         if args.binary:
             # Assume the archive contains the directory structure verbatim
             # so we need to extract to a subdirectory
-            fetchuri += ';subdir=%s' % os.path.splitext(os.path.basename(urlparse.urlsplit(fetchuri).path))[0]
+            fetchuri += ';subdir=${BP}'
         srcuri = fetchuri
         rev_re = re.compile(';rev=([^;]+)')
         res = rev_re.search(srcuri)
@@ -566,7 +566,9 @@ def create_recipe(args):
         lines_before.append('SRCREV = "%s"' % srcrev)
     lines_before.append('')
 
-    if srcsubdir:
+    if srcsubdir and not args.binary:
+        # (for binary packages we explicitly specify subdir= when fetching to
+        # match the default value of S, so we don't need to set it in that case)
         lines_before.append('S = "${WORKDIR}/%s"' % srcsubdir)
         lines_before.append('')