diff mbox

Improving mklog [was: Re: RFC Asan instrumentation control]

Message ID CAD_=9DQOKs5x7bGXU762+MTHT2yB0ae1KL4PmYb4GkvJ=hqLAw@mail.gmail.com
State New
Headers show

Commit Message

Diego Novillo Dec. 19, 2013, 1:47 p.m. UTC
On Thu, Dec 19, 2013 at 8:04 AM, Yury Gribov <y.gribov@samsung.com> wrote:
> On 12/19/2013 04:17 PM, Yury Gribov wrote:
>>> In my experience mklog is pretty much useless, e.g. if you
>>> add a new function, it will list the previous function as being modified
>>> rather than the new one, etc.
>>
>> In my experience it prints both the old and the new one. If that's a
>> problem we could probably fix it (I mean I can volunteer).
>>
>> Here's a draft patch for mklog which splits generated ChangeLog entry
>> into several parts (so no more spurious gcc/ or gcc/testsuite/).
>> I can continue working on this if people find it useful.
>
> Removed Kostya and Max, added Diego as original author of mklog.

Oh, crud, why did I have to write it in Perl? Sigh.

The patch is fine (some tweaks below). If someone volunteers to
re-write it in Python, I think it would make it easier to keep
extending. Ultimately, mklog ought to write the ChangeLog itself. We
get rid of that headache, at least.
diff mbox

Patch

diff --git a/contrib/mklog b/contrib/mklog
index a874c72..a9bf276 100755
--- a/contrib/mklog
+++ b/contrib/mklog
@@ -34,6 +34,10 @@  $name = @n[1]; chop($name);
 $addr = $username . "\@my.domain.org";
 $date = `date +%Y-%m-%d`; chop ($date);

+$gcc_root = $0;
+$gcc_root =~ s/[^\\\/]+$/../;
+chdir $gcc_root;
+

 #-----------------------------------------------------------------------------
 # Program starts here. You should not need to edit anything below this
@@ -53,13 +57,26 @@  $basename = `basename $diff`; chop ($basename);
 $cl = `mktemp /tmp/$basename.XXXXXX` || exit 1; chop ($cl);
 $hdrline = "$date  $name  <$addr>";

-open (CLFILE, ">$cl") or die "Could not open file $cl for writing";
-
-print CLFILE "$hdrline\n\n";
+my %clog_entries;

I'd rather continue using 'cl' to abbreviate ChangeLog, instead of 'clog'.