public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix mklog to support running from arbitrary folder
@ 2014-07-21  8:50 Yury Gribov
  2014-07-28  6:42 ` [PATCH][PING] " Yury Gribov
  2014-07-31 18:11 ` [PATCH] " Diego Novillo
  0 siblings, 2 replies; 4+ messages in thread
From: Yury Gribov @ 2014-07-21  8:50 UTC (permalink / raw)
  To: GCC Patches; +Cc: Diego Novillo, Trevor Saunders

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

Hi all,

Current mklog works only if run from GCC top-level folder. The patch 
allows running from arbitrary directory.

I've used Linux directory separators which is probably ok because script 
already expects Linux environment (dirname, basename, etc.).

Ok to commit?

-Y

[-- Attachment #2: mklog-patch-1.diff --]
[-- Type: text/x-diff, Size: 1159 bytes --]

commit aa8d7cd3db1f1eba8ee77b902cff1b2ab2a3f83a
Author: Yury Gribov <y.gribov@samsung.com>
Date:   Mon Jul 21 12:05:10 2014 +0400

    2014-07-21  Yury Gribov  <y.gribov@samsung.com>
    
    	* mklog: Allow running from arbitrary folder.

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 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH][PING] Fix mklog to support running from arbitrary folder
  2014-07-21  8:50 [PATCH] Fix mklog to support running from arbitrary folder Yury Gribov
@ 2014-07-28  6:42 ` Yury Gribov
  2014-07-31 18:11 ` [PATCH] " Diego Novillo
  1 sibling, 0 replies; 4+ messages in thread
From: Yury Gribov @ 2014-07-28  6:42 UTC (permalink / raw)
  To: GCC Patches; +Cc: Diego Novillo, Trevor Saunders

[-- Attachment #1: Type: text/plain, Size: 587 bytes --]




-------- Forwarded Message --------
Subject: [PATCH] Fix mklog to support running from arbitrary folder
Date: Mon, 21 Jul 2014 12:32:45 +0400
From: Yury Gribov <y.gribov@samsung.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
CC: Diego Novillo <dnovillo@google.com>, Trevor Saunders 
<tsaunders@mozilla.com>

Hi all,

Current mklog works only if run from GCC top-level folder. The patch
allows running from arbitrary directory.

I've used Linux directory separators which is probably ok because script
already expects Linux environment (dirname, basename, etc.).

Ok to commit?

-Y




[-- Attachment #2: mklog-patch-1.diff --]
[-- Type: text/x-diff, Size: 1160 bytes --]

commit aa8d7cd3db1f1eba8ee77b902cff1b2ab2a3f83a
Author: Yury Gribov <y.gribov@samsung.com>
Date:   Mon Jul 21 12:05:10 2014 +0400

    2014-07-21  Yury Gribov  <y.gribov@samsung.com>
    
    	* mklog: Allow running from arbitrary folder.

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 {


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix mklog to support running from arbitrary folder
  2014-07-21  8:50 [PATCH] Fix mklog to support running from arbitrary folder Yury Gribov
  2014-07-28  6:42 ` [PATCH][PING] " Yury Gribov
@ 2014-07-31 18:11 ` Diego Novillo
  2014-08-01  4:22   ` Yury Gribov
  1 sibling, 1 reply; 4+ messages in thread
From: Diego Novillo @ 2014-07-31 18:11 UTC (permalink / raw)
  To: Yury Gribov; +Cc: GCC Patches, Trevor Saunders

On Mon, Jul 21, 2014 at 4:32 AM, Yury Gribov <y.gribov@samsung.com> wrote:
> Hi all,
>
> Current mklog works only if run from GCC top-level folder. The patch allows
> running from arbitrary directory.
>
> I've used Linux directory separators which is probably ok because script
> already expects Linux environment (dirname, basename, etc.).
>
> Ok to commit?

OK.  Thanks.


Diego.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix mklog to support running from arbitrary folder
  2014-07-31 18:11 ` [PATCH] " Diego Novillo
@ 2014-08-01  4:22   ` Yury Gribov
  0 siblings, 0 replies; 4+ messages in thread
From: Yury Gribov @ 2014-08-01  4:22 UTC (permalink / raw)
  To: Diego Novillo; +Cc: GCC Patches, Trevor Saunders

On 07/31/2014 09:57 PM, Diego Novillo wrote:
>> Current mklog works only if run from GCC top-level folder. The patch allows
>> running from arbitrary directory.
>>
>> I've used Linux directory separators which is probably ok because script
>> already expects Linux environment (dirname, basename, etc.).
>>
>> Ok to commit?
>
> OK.  Thanks.

Done, r213401.

-Y

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-01  4:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-21  8:50 [PATCH] Fix mklog to support running from arbitrary folder Yury Gribov
2014-07-28  6:42 ` [PATCH][PING] " Yury Gribov
2014-07-31 18:11 ` [PATCH] " Diego Novillo
2014-08-01  4:22   ` Yury Gribov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).