3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # T2 SDE: scripts/Create-Diff
5 # Copyright (C) 2004 - 2023 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # This Copyright note is generated by scripts/Create-CopyPatch,
9 # more information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License version 2.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 directories
="misc package architecture target scripts"
17 if [ "$1" = "-editor" ]; then
18 editor
="$2"; shift; shift
21 if [ "$#" -lt 2 ]; then
22 echo; echo " Usage: $0 [ -editor <editor> ] <old-dir> <new-dir> [ {file|directory} ]"
24 echo " Creates a unified diff over two T2 source trees. You can"
25 echo " send this diff to the mailing list if you want your changes"
26 echo " to be included."
28 echo " Please do create seperate diffs for changes which do not"
29 echo " belong to each other."
34 [ "$1" ] && directories
="$*"
37 if ! perl
-e 'exit 0'; then
41 eval "`grep -A 10 '\[BEGIN\]' $olddir/scripts/parse-config | grep -B 10 '\[END\]'`"
43 [ "$editor" = "" ] && echo "[ Generated by scripts/Create-Diff for T2 $sdever ]" > /tmp
/$$
45 for x
in $directories; do
50 source_for_sed
="$x/./"
58 diff -x CVS
-x '.svn' -x '.#*' -x '*.mine' -x '*.r[1-9][0-9]*' \
59 $FLAGS "$olddir"/$name_for_diff "$newdir"/$name_for_diff |
grep -v '^diff ' | \
60 sed "s,^--- $olddir/$source_for_sed,--- ./$target_for_sed," | \
61 sed "s,^+++ $newdir/$source_for_sed,+++ ./$target_for_sed," | \
62 perl
-pe '$fn=$1 if /^--- \.\/(\S+)\s/;
66 if [ "$editor" = "" ]; then
70 eval "$editor /tmp/$$"