aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorYury Gribov <tetra2005@gmail.com>2017-07-18 15:39:39 +0000
committerMaxim Ostapenko <chefmax@gcc.gnu.org>2017-07-18 18:39:39 +0300
commit883b0e467ad1e7c9af9131b026b4446d571f3caa (patch)
treefbd13ac97c6ffe94fb3d9358e3f8df7d3335090e /contrib
parentb267968e676627af45f63c64f4c8c4a0f1939561 (diff)
downloadgcc-883b0e467ad1e7c9af9131b026b4446d571f3caa.zip
gcc-883b0e467ad1e7c9af9131b026b4446d571f3caa.tar.gz
gcc-883b0e467ad1e7c9af9131b026b4446d571f3caa.tar.bz2
mklog: Fix extraction of changed file name.
2017-07-17 Yury Gribov <tetra2005@gmail.com> * mklog: Fix extraction of changed file name. From-SVN: r250314
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog4
-rwxr-xr-xcontrib/mklog18
2 files changed, 19 insertions, 3 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 46e8a82..35bd9e2 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2017-07-17 Yury Gribov <tetra2005@gmail.com>
+
+ * mklog: Fix extraction of changed file name.
+
2017-07-17 Georg-Johann Lay <avr@gjlay.de>
* gcc_update (files_and_dependencies)
diff --git a/contrib/mklog b/contrib/mklog
index 6112628..ff20cf1 100755
--- a/contrib/mklog
+++ b/contrib/mklog
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# Copyright (C) 2012-2014 Free Software Foundation, Inc.
+# Copyright (C) 2012-2017 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -195,8 +195,20 @@ foreach (@diff_lines) {
} elsif($right eq '/dev/null') {
$filename = $left;
} else {
- print STDERR "Error: failed to parse diff for $left and $right\n";
- exit 1;
+ my @ldirs = split /[\/\\]/, $left;
+ my @rdirs = split /[\/\\]/, $right;
+
+ $filename = '';
+ while ((my $l = pop @ldirs) && (my $r = pop @rdirs)) {
+ last if ($l ne $r);
+ $filename = "$l/$filename";
+ }
+ $filename =~ s/\/$//;
+
+ if (!$filename) {
+ print STDERR "Error: failed to parse diff for $left and $right\n";
+ exit 1;
+ }
}
$left = $right = undef;
($clname, $relname) = get_clname ($filename);