]> code.ossystems Code Review - openembedded-core.git/commitdiff
archiver.bbclass: emit patch series files for original src
authorRobert Yang <liezhi.yang@windriver.com>
Mon, 24 Mar 2014 05:39:27 +0000 (13:39 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 24 Mar 2014 10:18:25 +0000 (10:18 +0000)
Emit patch series files for original src so that the user knows how to
apply the patch orderly.

[YOCTO #5113]

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/archiver.bbclass

index 9aa9335b94755b3b1e338b00a93774a99c65fd71..8d8e7c42a8292272e34af18c12718a3bb1a39739 100644 (file)
@@ -150,6 +150,19 @@ python do_ar_original() {
             tar = tarfile.open(tarname, 'w:gz')
             tar.add('.')
             tar.close()
+
+    # Emit patch series files for 'original'
+    bb.note('Writing patch series files...')
+    for patch in src_patches(d):
+        _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+        patchdir = parm.get('patchdir')
+        if patchdir:
+            series = os.path.join(ar_outdir, 'series.subdir.%s' % patchdir.replace('/', '_'))
+        else:
+            series = os.path.join(ar_outdir, 'series')
+
+        with open(series, 'a') as s:
+            s.write('%s -p%s\n' % (os.path.basename(local), parm['striplevel']))
 }
 
 python do_ar_patched() {