3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # This copyright note is auto-generated by scripts/Create-CopyPatch.
6 # T2 SDE: scripts/Create-Diff
7 # Copyright (C) 2004 - 2020 The T2 SDE Project
8 # Copyright (C) 1998 - 2003 ROCK Linux Project
10 # More information can be found in the files COPYING and README.
12 # This program is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; version 2 of the License. A copy of the
15 # GNU General Public License can be found in the file COPYING.
16 # --- T2-COPYRIGHT-NOTE-END ---
18 directories
="misc package architecture target scripts"
20 if [ "$1" = "-editor" ]; then
21 editor
="$2"; shift; shift
24 if [ "$#" -lt 2 ]; then
25 echo; echo " Usage: $0 [ -editor <editor> ] <old-dir> <new-dir> [ {file|directory} ]"
27 echo " Creates a unified diff over two T2 source trees. You can"
28 echo " send this diff to the mailing list if you want your changes"
29 echo " to be included."
31 echo " Please do create seperate diffs for changes which do not"
32 echo " belong to each other."
37 [ "$1" ] && directories
="$*"
40 if ! perl
-e 'exit 0'; then
44 eval "`grep -A 10 '\[BEGIN\]' $olddir/scripts/parse-config | grep -B 10 '\[END\]'`"
46 [ "$editor" = "" ] && echo "[ Generated by scripts/Create-Diff for T2 $sdever ]" > /tmp
/$$
48 for x
in $directories; do
53 source_for_sed
="$x/./"
61 diff -x CVS
-x '.svn' -x '.#*' -x '*.mine' -x '*.r[1-9][0-9]*' \
62 $FLAGS "$olddir"/$name_for_diff "$newdir"/$name_for_diff |
grep -v '^diff ' | \
63 sed "s,^--- $olddir/$source_for_sed,--- ./$target_for_sed," | \
64 sed "s,^+++ $newdir/$source_for_sed,+++ ./$target_for_sed," | \
65 perl
-pe '$fn=$1 if /^--- \.\/(\S+)\s/;
69 if [ "$editor" = "" ]; then
73 eval "$editor /tmp/$$"