This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Keep patch file permissions in mklog
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: Yury Gribov <y dot gribov at samsung dot com>, Diego Novillo <dnovillo at google dot com>, Geoff Keating <geoffk at geoffk dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Trevor Saunders <tsaunders at mozilla dot com>
- Date: Mon, 11 Aug 2014 12:29:27 -0500
- Subject: Re: [PATCH] Keep patch file permissions in mklog
- Authentication-results: sourceware.org; auth=none
- References: <53DB15C5 dot 6070206 at samsung dot com> <53DB391C dot 7050808 at mentor dot com> <53DB3F2A dot 5070800 at samsung dot com> <53DD3AB2 dot 9040901 at mentor dot com> <53DF2BF4 dot 8090806 at samsung dot com> <53DF40F7 dot 6050909 at mentor dot com> <53DF736F dot 7000206 at samsung dot com> <53E86F4B dot 2020107 at mentor dot com> <53E87C39 dot 1090205 at samsung dot com> <53E888A3 dot 60502 at mentor dot com>
On Mon, Aug 11, 2014 at 11:10:59AM +0200, Tom de Vries wrote:
> +use File::Temp;
> +use File::Copy qw(cp mv);
> + # Copy the permissions to the temp file (in perl 2.15 and later).
> + cp $diff, $tmp or die "Could not copy patch file to temp file: $!";
That's File::Copy 2.15, not Perl 2.15 (which doesn't exist). File::Copy 2.15
isn't so terribly old, so you might want to do a version check, e.g. as
use File::Copy 2.15 qw/cp mv/;
(but it's in Perl 5.10 already, so you might not want to bother).
> -if ($#ARGV != 0) {
> +$inline = 0;
> +if ($#ARGV == 1 && ("$ARGV[0]" eq "-i" || "$ARGV[0]" eq "--inline")) {
> + shift;
> + $inline = 1;
> +} elsif ($#ARGV != 0) {
If you want any more command-line options, have a look at Getopt::Long.
Segher