+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)
#!/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.
#
} 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);