From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29186 invoked by alias); 2 Aug 2014 19:23:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 29176 invoked by uid 89); 2 Aug 2014 19:23:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 02 Aug 2014 19:23:41 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1XDetz-0006o7-5O from Tom_deVries@mentor.com ; Sat, 02 Aug 2014 12:23:35 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sat, 2 Aug 2014 12:23:35 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Sat, 2 Aug 2014 20:23:32 +0100 Message-ID: <53DD3AB2.9040901@mentor.com> Date: Sat, 02 Aug 2014 19:23:00 -0000 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Yury Gribov , Diego Novillo CC: Geoff Keating , GCC Patches Subject: Re: [PATCH] Keep patch file permissions in mklog References: <5389890F.2050501@mentor.com> <53DB15C5.6070206@samsung.com> <53DB391C.7050808@mentor.com> <53DB3F2A.5070800@samsung.com> In-Reply-To: <53DB3F2A.5070800@samsung.com> Content-Type: multipart/mixed; boundary="------------070603080104030301020304" X-SW-Source: 2014-08/txt/msg00129.txt.bz2 --------------070603080104030301020304 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 629 On 01-08-14 09:18, Yury Gribov wrote: > On 08/01/2014 10:52 AM, Tom de Vries wrote: >> This patch adds a script contrib/mklog-in-patch, which uses mklog to >> generate the skeleton log, but generates the log at the start of the >> patch as mklog did before (which is how I like to use it). > > Yeah, we had some argument about this but kind of agreed that separate log is > preferred. > >> I can also try to add an --inline option to mklog instead. > > I'd prefer this. > This patch implements an --inline option to mklog. I've used the --inline option to prepend the skeleton log to this patch. OK for trunk? Thanks, - Tom --------------070603080104030301020304 Content-Type: text/x-patch; name="0001-Add-inline-option-to-contrib-mklog.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Add-inline-option-to-contrib-mklog.patch" Content-length: 1989 2014-08-02 Tom de Vries * mklog: Add --inline option. diff --git a/contrib/mklog b/contrib/mklog index 3d17dc5..ba075cf 100755 --- a/contrib/mklog +++ b/contrib/mklog @@ -56,19 +56,27 @@ if (-d "$gcc_root/.git") { # Program starts here. You should not need to edit anything below this # line. #----------------------------------------------------------------------------- -if ($#ARGV != 0) { +$inline = 0; +if ($#ARGV == 1 && ("$ARGV[0]" eq "-i" || "$ARGV[0]" eq "--inline")) { + $diff = $ARGV[1]; + $inline = 1; + if ($diff eq "-") { + die "Reading from - and using -i are not compatible"; + } +} elsif ($#ARGV != 0) { $prog = `basename $0`; chop ($prog); print <', $tmp) or die "Could not open temp file"; +} else { + *FILE1 = STDOUT; +} + +# Print the log foreach my $clname (keys %cl_entries) { - print "$clname:\n\n$hdrline\n\n$cl_entries{$clname}\n"; + print FILE1 "$clname:\n\n$hdrline\n\n$cl_entries{$clname}\n"; +} + + +# Prepend the log to the patch +if ($inline) { + close (FILE1); + + system ("cat $diff >>$tmp") == 0 + or die "Could not append patch to temp file"; + + # We're using cat rather than move, to keep permissions on $diff the same. + system ("cat $tmp >$diff") == 0 + or die "Could not move temp file to patch file"; + + unlink ($tmp) == 1 or die "Could not remove temp file"; } exit 0; -- 1.9.1 --------------070603080104030301020304--