4 # Prepares a patch for the patch tester.
5 # Copyright (C) 2007-2024 Free Software Foundation, Inc.
6 # Contributed by Sebastian Pop <sebastian.pop@amd.com>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 prepare_patch.sh <source_dir> [patches_dir]
26 SOURCE_DIR is the directory containing GCC's toplevel configure.
28 PATCHES_DIR is the directory where the patch will be copied to.
29 Default is SOURCE_DIR/patches.
35 test $# -eq 0 && usage
40 if [[ "$#" < 2 ]]; then
41 PATCHES
=$SOURCE/patches
46 [ -f $SOURCE/config.guess
] || usage
47 [ -d $PATCHES ] || mkdir
-p $PATCHES
49 echo "Enter a name for this patch: "
51 PATCH
=$PATCHES/`TZ=UTC date +"%Y_%m_%d_%H_%M_%S"`_
$name.
diff
53 echo "Enter the email where the report should be sent: "
55 echo "email:$email" >> $PATCH
57 branch
=`svn info $SOURCE | grep URL: | sed -e "s/^URL: //g"`
58 echo "Enter svn branch (svn info in $SOURCE reports $branch, default is trunk): "
60 if [ x
$svn_branch = x
]; then
63 echo "branch:$svn_branch" >> $PATCH
65 revision
=`svn info $SOURCE | grep Revision: | sed -e "s/^Revision: //g"`
66 echo "Enter svn revision (svn info in $SOURCE reports $revision, default is HEAD): "
68 if [ x
$svn_revision = x
]; then
71 echo "revision:$svn_revision" >> $PATCH
73 echo "Enter configure options: "
74 read configure_options
75 echo "configure:$configure_options" >> $PATCH
77 echo "Enter make options: "
79 echo "make:$make_options" >> $PATCH
81 echo "Enter make check options: "
83 echo "check:$check_options" >> $PATCH
87 svn
diff $SOURCE |
tee -a $PATCH
91 You can now edit your patch, include a ChangeLog, and before
92 submitting to the patch tester, don't forget to sign it with:
94 gpg --clearsign $PATCH