aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-14 12:09:45 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-14 12:09:45 +0000
commitd5f9f518fbf45d3d91a0eb7eca0b1471d6a03bba (patch)
tree33066cc0dd504058a5e2faab1c35d94b9a4aa6b3 /contrib
parent776bb2212abaa85161a57119db98549ab25e33a6 (diff)
Fix patch mangling with --inline option
2014-11-14 Tom de Vries <tom@codesourcery.com> * mklog: Move reading of .diff file up and add comment. Copy diff_lines to orig_diff_lines. Use orig_diff_lines when appending patch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217558 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog5
-rwxr-xr-xcontrib/mklog16
2 files changed, 17 insertions, 4 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 2484d86e20d..60257c48e07 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-14 Tom de Vries <tom@codesourcery.com>
+
+ * mklog: Move reading of .diff file up and add comment. Copy diff_lines
+ to orig_diff_lines. Use orig_diff_lines when appending patch.
+
2014-11-11 David Malcolm <dmalcolm@redhat.com>
* ChangeLog.jit: New.
diff --git a/contrib/mklog b/contrib/mklog
index 8412d38fbf6..840f6f8c266 100755
--- a/contrib/mklog
+++ b/contrib/mklog
@@ -132,15 +132,23 @@ sub is_top_level {
return $function && $function !~ /^[\s{]/;
}
+# Read contents of .diff file
+open (DFILE, $diff) or die "Could not open file $diff for reading";
+chomp (my @diff_lines = <DFILE>);
+close (DFILE);
+
+# Array diff_lines is modified by the log generation, so save a copy in
+# orig_diff_lines if needed.
+if ($inline) {
+ @orig_diff_lines = @diff_lines;
+}
+
# For every file in the .diff print all the function names in ChangeLog
# format.
%cl_entries = ();
$change_msg = undef;
$look_for_funs = 0;
$clname = get_clname('');
-open (DFILE, $diff) or die "Could not open file $diff for reading";
-chomp (my @diff_lines = <DFILE>);
-close (DFILE);
$line_idx = 0;
foreach (@diff_lines) {
# Stop processing functions if we found a new file.
@@ -313,7 +321,7 @@ foreach my $clname (keys %cl_entries) {
if ($inline) {
# Append the patch to the log
- foreach (@diff_lines) {
+ foreach (@orig_diff_lines) {
print OUTPUTFILE "$_\n";
}
}