From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9513 invoked by alias); 11 Aug 2014 08:18:08 -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 9503 invoked by uid 89); 11 Aug 2014 08:18:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mailout4.w1.samsung.com Received: from mailout4.w1.samsung.com (HELO mailout4.w1.samsung.com) (210.118.77.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Mon, 11 Aug 2014 08:18:06 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NA4003DOV1R5H60@mailout4.w1.samsung.com> for gcc-patches@gcc.gnu.org; Mon, 11 Aug 2014 09:17:51 +0100 (BST) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id C9.B5.25543.93C78E35; Mon, 11 Aug 2014 09:18:01 +0100 (BST) Received: from [106.109.9.145] by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NA4006AGV21GY40@eusync3.samsung.com>; Mon, 11 Aug 2014 09:18:01 +0100 (BST) Message-id: <53E87C39.1090205@samsung.com> Date: Mon, 11 Aug 2014 08:18:00 -0000 From: Yury Gribov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-version: 1.0 To: Tom de Vries Cc: Diego Novillo , Geoff Keating , GCC Patches , Trevor Saunders , Segher Boessenkool 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> <53DD3AB2.9040901@mentor.com> <53DF2BF4.8090806@samsung.com> <53DF40F7.6050909@mentor.com> <53DF736F.7000206@samsung.com> <53E86F4B.2020107@mentor.com> In-reply-to: <53E86F4B.2020107@mentor.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00994.txt.bz2 On 08/11/2014 11:22 AM, Tom de Vries wrote: >> +if ($#ARGV == 1 && ("$ARGV[0]" eq "-i" || "$ARGV[0]" eq "--inline")) { >> >> I'd do >= 1 but that's a question of personal preference. >> > > What is the purpose of that proposed change ? Kind of laying foundation for adding more flags in the future. But as I said, this could be done as need for new flags arises. > I'm now using mktemp from File::Temp. The script now relies on external Perl modules. This is probably fine because AFAIK File::Temp and File::Copy are available included in all distributions. +use File::Copy "cp"; +use File::Copy "mv"; You could trade one line with qw(cp mv)... + $tmp = mktemp("tmp.XXXXXXXX") or die "cannot create temp file: $!"; Perhaps "Could not" like in other error messages? + cp "$diff", "$tmp" or die "Could not copy patch file to temp file: $!"; Script don't quote stuff in other places so quoting here is useless. -Y