From patchwork Sat Aug 2 19:23:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 375947 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 54D6D1400B2 for ; Sun, 3 Aug 2014 05:23:58 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=wTXsiwTmCJ27uXbUt mXwd9ROwwaS/l2Gt3TYTRlurr1xfceDSLGODy5zjZKvY7E67X3ch1hwWtYa+Ujtg JnVeGRPc9+ZBUyVK7fPotMWWohLpUwImbGXAbv6J8K8rjJMeypY5tnJltmxDbLyd AzZc/A61bZG/pD+Eirtkds+m+g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=mj+POHuOWNggxrFemB+6KKt 7EuE=; b=LbuheZdtu2JDutCXIjgCM84gqgnW79Giimi7lhF4PpNS+qXUmIxFn5d 47o8EYs2DeKMAfaKIidc6+zj6vdYO3ME6j3XGXryokUSXeoAGavliEZoN2csw8AT B5jB8o02JQNGPAgpyu3YRxbcs9VgHpbA7SmNpOOxrOkrksMN1s7c= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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, 2 Aug 2014 21:23:30 +0200 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> 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 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