gentree.py: keep patch headers for patch refresh
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 7 May 2013 03:03:20 +0000 (20:03 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 8 May 2013 07:49:23 +0000 (09:49 +0200)
Without this change we were removing patch headers
when refreshing patches.

Cc: techtonik@gmail.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
gentree.py

index 04ce0e3676e1d1749b339dca22fc47c41e28031f..9d0f3ae574652482f52de45c5552a02e08714ecd 100755 (executable)
@@ -401,7 +401,9 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
             return 2
 
         if args.refresh:
-            pfilef = open(pfile + '.tmp', 'w')
+            pfilef = open(pfile + '.tmp', 'a')
+            pfilef.write(p.top_header)
+            pfilef.flush()
             for patchitem in p.items:
                 patched_file = '/'.join(patchitem.source.split('/')[1:])
                 fullfn = os.path.join(args.outdir, patched_file)