move orig/rej file removal
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 31 Mar 2013 00:47:39 +0000 (01:47 +0100)
committerJohannes Berg <johannes@sipsolutions.net>
Sun, 31 Mar 2013 00:47:39 +0000 (01:47 +0100)
This needs to be after each patch.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
gentree.py

index c766a0af9ecfa1995f50bef572a7bb9e6f977822..06aee47df238240939bdaad251fedc8653605180 100755 (executable)
@@ -232,16 +232,16 @@ def main():
                 pfilef.write(diff)
                 pfilef.close()
                 os.unlink(fullfn + '.orig_file')
+        # remove orig/rej files that patch sometimes creates
+        for root, dirs, files in os.walk(args.outdir):
+            for f in files:
+                if f[-5:] == '.orig' or f[-4:] == '.rej':
+                    os.unlink(os.path.join(root, f))
         if not printed:
             print "Not applying changes from %s, not needed" % (os.path.basename(pdir),)
         else:
             git_debug_snapshot(args, "apply backport patches from %s" % (os.path.basename(pdir),))
 
-    # remove orig/rej files that patch sometimes creates
-    for root, dirs, files in os.walk(args.outdir):
-        for f in files:
-            if f[-5:] == '.orig' or f[-4:] == '.rej':
-                os.unlink(os.path.join(root, f))
 
     # rewrite Makefile and source symbols
     regexes = []