This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Keep patch file permissions in mklog
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Yury Gribov <y dot gribov at samsung dot com>, Diego Novillo <dnovillo at google dot com>
- Cc: Geoff Keating <geoffk at geoffk dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 1 Aug 2014 08:52:12 +0200
- Subject: Re: [PATCH] Keep patch file permissions in mklog
- Authentication-results: sourceware.org; auth=none
- References: <5389890F dot 2050501 at mentor dot com> <53DB15C5 dot 6070206 at samsung dot com>
On 01-08-14 06:21, Yury Gribov wrote:
From: Tom de Vries <Tom_deVries@mentor.com>
Sent: Saturday, May 31, 2014 11:47AM
To: Geoff Keating <firstname.lastname@example.org>
Cc: GCC Patches
Subject: [PATCH] Keep patch file permissions in mklog
On 05/31/2014 11:47 AM, Tom de Vries wrote:
Currently, mklog resets the permissions on a patch file:
The permissions problem does not occur anymore with the latests versions of
mklog, since it doesn't modify the patch file anymore.
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).
OK for trunk?
I can also try to add an --inline option to mklog instead.
2014-08-01 Tom de Vries <email@example.com>
* mklog-in-patch: New script.
diff --git a/contrib/mklog-in-patch b/contrib/mklog-in-patch
new file mode 100755
@@ -0,0 +1,61 @@
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This file is part of GCC.
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING. If not, write to
+# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+# Check for errors
+if [ "$diff" = "" ]; then
+ echo <<EOF
+usage: $prog file.diff
+Invokes mklog, and prepends the generated log to file.diff.
+elif [ ! -r "$diff" ]; then
+ echo "Could not open file $diff for reading"
+ exit 1
+# Generate log in $temp
+if ! $scriptdir/mklog "$diff" > "$temp"; then
+ echo "Could not write log file to $temp"
+ exit 1
+# Append patch to $temp, and move $temp to $patch. For the latter, we use cat
+# rather than mv to keep $diff permissions the same.
+if ! ( cat $diff >>$temp && cat $temp >$diff ); then
+ echo "Could not add the ChangeLog entry to $diff"
+ exit 1
+if ! rm $temp; then
+ echo "Could not remove $temp"
+ exit 1