[netfilter-cvslog] r4021 - trunk/patch-o-matic-ng/patch2pom

laforge at netfilter.org laforge at netfilter.org
Mon Jun 27 11:10:55 CEST 2005


Author: laforge at netfilter.org
Date: 2005-06-27 11:10:54 +0200 (Mon, 27 Jun 2005)
New Revision: 4021

Modified:
   trunk/patch-o-matic-ng/patch2pom/PatchFile.pm
   trunk/patch-o-matic-ng/patch2pom/patch2pom
Log:
add Fix to correctly work with git-generated patches (Yasuyuki Kozakai)


Modified: trunk/patch-o-matic-ng/patch2pom/PatchFile.pm
===================================================================
--- trunk/patch-o-matic-ng/patch2pom/PatchFile.pm	2005-06-27 09:10:23 UTC (rev 4020)
+++ trunk/patch-o-matic-ng/patch2pom/PatchFile.pm	2005-06-27 09:10:54 UTC (rev 4021)
@@ -34,12 +34,12 @@
 sub _parse_fileline {
     my $line = $_[0];
 
-    unless($line =~ /^...\s([^\t]+)\t(.*)/) {
+    unless($line =~ /^...\s([^\t\s]+)[\t\s]*([^\t\s]*)/) {
 	print STDERR "\033[36;1;40mInvalid file line:\n$line\033[m\n";
 	exit(10);
     }
 
-    return { file => $1, date => $2 };
+    return { file => $1, comments => $2 };
 }
 
 sub _finish_chunk {
@@ -68,8 +68,8 @@
 sub format {
     my $this = shift;
     my $str = $this->{diffline};
-    $str .= "--- ".$this->{old}->{file}."\t".$this->{old}->{date}."\n";
-    $str .= "+++ ".$this->{new}->{file}."\t".$this->{new}->{date}."\n";
+    $str .= "--- ".$this->{old}->{file}."\t".$this->{old}->{comments}."\n";
+    $str .= "+++ ".$this->{new}->{file}."\t".$this->{new}->{comments}."\n";
     foreach my $chunk (@{$this->{chunks}}) {
 	$str .= $chunk->format();
     }

Modified: trunk/patch-o-matic-ng/patch2pom/patch2pom
===================================================================
--- trunk/patch-o-matic-ng/patch2pom/patch2pom	2005-06-27 09:10:23 UTC (rev 4020)
+++ trunk/patch-o-matic-ng/patch2pom/patch2pom	2005-06-27 09:10:54 UTC (rev 4021)
@@ -79,7 +79,7 @@
 $pombase =~ s!/+$!!;
 
 sub create_file {
-    my ($file, $date, @content) = @_;
+    my ($file, @content) = @_;
 
     $file = $pombase.'/'.$file;
 
@@ -91,10 +91,6 @@
     open NEWFILE, '>', $file;
     print NEWFILE @content;
     close NEWFILE;
-
-    my $time = str2time($date);
-
-    utime($time, $time, $file);
 }
 
 my $patch_file_opened = 0;
@@ -159,7 +155,7 @@
 	my @content = @{$file->{chunks}->[0]->{minichunks}->[0]};
 	chomp $content[$#content] if($file->{chunks}->[0]->{nonewline});
 
-	create_file($filename, $file->{new}->{date}, @content);
+	create_file($filename, @content);
 
     } elsif($filename =~ m!/Kconfig$!) {
 
@@ -219,7 +215,7 @@
 			    delete $lines[$#lines];
 			}
 
-			create_file($ladd_filename, $file->{new}->{date}, @lines);
+			create_file($ladd_filename, @lines);
 		    }
 		}
 	    }
@@ -250,7 +246,7 @@
 
 		    my $ladd_filename = ladd_filename($filename);
 
-		    create_file($ladd_filename, $file->{new}->{date}, $context, @{$chunk->{minichunks}->[$i+1]});
+		    create_file($ladd_filename, $context, @{$chunk->{minichunks}->[$i+1]});
 		}
 	    }
 
@@ -295,7 +291,7 @@
 
 			my $ladd_filename = ladd_filename($filename);
 
-			create_file($ladd_filename, $file->{new}->{date}, $context, @{$chunk->{minichunks}->[$i+1]});
+			create_file($ladd_filename, $context, @{$chunk->{minichunks}->[$i+1]});
 		    }
 		}
 	    }




More information about the netfilter-cvslog mailing list