aboutsummaryrefslogtreecommitdiff
path: root/contrib/mklog
diff options
context:
space:
mode:
authorYury Gribov <ygribov@gcc.gnu.org>2014-08-01 04:19:59 +0000
committerYury Gribov <ygribov@gcc.gnu.org>2014-08-01 04:19:59 +0000
commit649aa8c1830b0ed5693922a575ecee7d3277e1b2 (patch)
tree2bfc12bbf22b79479403121c90968ef183f6ddf1 /contrib/mklog
parentbb7e83fccb81c2dca2b6a00a0ab5f53319493b06 (diff)
downloadgcc-649aa8c1830b0ed5693922a575ecee7d3277e1b2.zip
gcc-649aa8c1830b0ed5693922a575ecee7d3277e1b2.tar.gz
gcc-649aa8c1830b0ed5693922a575ecee7d3277e1b2.tar.bz2
mklog: Allow running from arbitrary folder.
2014-08-01 Yury Gribov <y.gribov@samsung.com> * mklog: Allow running from arbitrary folder. From-SVN: r213401
Diffstat (limited to 'contrib/mklog')
-rwxr-xr-xcontrib/mklog7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/mklog b/contrib/mklog
index cdc6455..3d17dc5 100755
--- a/contrib/mklog
+++ b/contrib/mklog
@@ -30,16 +30,15 @@
$username = $ENV{'USER'};
$name = `finger $username | grep -o 'Name: .*'`;
@n = split(/: /, $name);
-$name = @n[1]; chop($name);
+$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;
# if this is a git tree then take name and email from the git configuration
-if (-d .git) {
+if (-d "$gcc_root/.git") {
$gitname = `git config user.name`;
chomp($gitname);
if ($gitname) {
@@ -80,7 +79,7 @@ sub get_clname ($) {
my $dirname = $_[0];
while ($dirname) {
my $clname = "$dirname/ChangeLog";
- if (-f $clname) {
+ if (-f "$gcc_root/$clname") {
my $relname = substr ($_[0], length ($dirname) + 1);
return ($clname, $relname);
} else {