mtd/scripts creatediffs.py,1.2,1.3

gleixner at infradead.org gleixner at infradead.org
Sun Nov 6 17:50:08 EST 2005


Update of /home/cvs/mtd/scripts
In directory phoenix.infradead.org:/tmp/cvs-serv27170

Modified Files:
	creatediffs.py 
Log Message:
Use git core tools and update to new features. 
Handle Artems empty commit messages
Exclude 2.4 specific files to reduce the patch errors
Improve handling of Makefile.*



Index: creatediffs.py
===================================================================
RCS file: /home/cvs/mtd/scripts/creatediffs.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- creatediffs.py	6 Nov 2005 11:14:42 -0000	1.2
+++ creatediffs.py	6 Nov 2005 22:50:04 -0000	1.3
@@ -187,40 +187,62 @@
                     files = ""
             except:
                 break
+
+            # Skip 2.4 files
+            if fname.find("-v24") >= 0:
+                continue
+            if fname == "Makefile.24" >= 0:
+                continue
+            # Skip Makefile magic files
+            if fname == "Makefile" or fname == "Makefile.inc":
+                continue
             
             if frev1 == "NONE":
                 fd.write("pushd %s\n" %(os.getcwd()))
+                if fname == "Makefile.common":
+                    fnamedest = "Makefile"
+                else:
+                    fnamedest = fname
                 fd.write("cvs up -p -r%s %s/%s >%s/%s/%s\n" %(
-                    frev2 ,self.patchpath, fname, mtdrepo, self.patchpath, fname))
+                    frev2 ,self.patchpath, fname, mtdrepo, self.patchpath, fnamedest))
                 fd.write("popd\n")
-                fd.write("cg-add %s/%s\n" %(self.patchpath, fname))
+                fd.write("git add %s/%s\n" %(self.patchpath, fnamedest))
             elif frev2 == "NONE":
-                fd.write("cg-rm %s/%s\n" %(self.patchpath, fname))
+                if fname == "Makefile.common":
+                    fname = "Makefile"
+		fd.write("git-update-index --remove %s/%s\n" %(self.patchpath, fname))
             else:
                 fd.write("pushd %s\n" %(os.getcwd()))
                 fd.write("cvs diff -u -r%s -r%s %s/%s >%s/cvspatch\n" %(
                     frev1, frev2, self.patchpath, fname, mtdrepo))
                 fd.write("popd\n")
+                if fname == "Makefile.common":
+                    fname = "Makefile"
+                    fd.write("sed -i s@/Makefile.common@/Makefile@ cvspatch\n")
                 fd.write("patch -p0 <cvspatch\n")
                 fd.write("rm -f cvspatch\n")
-            fd.write("find -iname *.rej\n")
-            fd.write("find -iname *.orig\n")
-            fd.write("cg-status\n")
+		fd.write("git-update-index %s/%s\n" %(self.patchpath, fname))
+
+        fd.write("find -iname *.rej\n")
+        fd.write("find -iname *.orig\n")
+        fd.write("git status\n")
         fd.close()
         
-        fd = open(mtdrepo + "/.git/author", "w")
+        fd = open(mtdrepo + "/commit.sh", "w")
+        fd.write('#!/bin/sh\n')
         fd.write('export GIT_AUTHOR_NAME="%s"\n' %(self.usr[0]))
         fd.write('export GIT_AUTHOR_EMAIL="%s"\n' %(self.usr[1]))
         fd.write('export GIT_AUTHOR_DATE="%s"\n' %(self.cdate))
+	fd.write('\ngit commit -v -F logmessage\n')
         fd.close()
-        fd = open(mtdrepo+"/.git/logmessage", "w")
+        fd = open(mtdrepo+"/logmessage", "w")
         lines = self.log.get(1.0,END).splitlines()
         # Strip trailing newlines
         while len(lines) and len(lines[-1].strip()) == 0:
             lines.pop(-1)
         for line in lines:
             fd.write(line+"\n")
-        if lines[-1].find("Signed") < 0:
+        if len(lines) > 0 and lines[-1].find("Signed") < 0:
             fd.write("\n")
         if self.signAuthor.get() == 1:
             fd.write("Signed-off-by: %s <%s>\n" %(self.usr[0], self.usr[1]))





More information about the linux-mtd-cvs mailing list