mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.6 KiB

  1. #!/bin/bash
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/scripts/Create-Diff
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. directories="Documentation misc package architecture target scripts"
  25. if [ "$1" = "-editor" ] ; then
  26. editor="$2" ; shift ; shift
  27. fi
  28. if [ "$#" -lt 2 ] ; then
  29. echo ; echo " Usage: $0 [ -editor <editor> ] <old-dir> <new-dir> [ {file|directory} ]"
  30. echo
  31. echo " Create a unified diff over two ROCK source trees. You can"
  32. echo " send this diff to the mailing list if you want your changes"
  33. echo " to be included."
  34. echo
  35. echo " Please do create seperate diffs for changes which do not"
  36. echo " belong to each other."
  37. echo ; exit 1
  38. else
  39. olddir=$1; shift
  40. newdir=$1; shift
  41. [ "$1" ] && directories="$*"
  42. fi
  43. if ! perl -e 'exit 0' ; then
  44. perl() { cat ; }
  45. fi
  46. eval "`grep -A 10 '\[BEGIN\]' $olddir/scripts/parse-config | grep -B 10 '\[END\]'`"
  47. [ "$editor" = "" ] && echo "[ Generated by ./scripts/Create-Diff for ROCK Linux $rockver ]" > /tmp/$$
  48. for x in $directories ; do
  49. x=${x#./}; x=${x%/}
  50. if [ -d $x ]; then
  51. FLAGS="-rduN"
  52. name_for_diff="$x/."
  53. source_for_sed="$x/./"
  54. target_for_sed="$x/"
  55. else
  56. FLAGS="-duN"
  57. name_for_diff="$x"
  58. source_for_sed=""
  59. target_for_sed=""
  60. fi
  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/;
  66. $_="" if $fn eq "Documentation/FAQ";
  67. $_="" if $fn eq "Documentation/LSM";
  68. $_="" if $fn =~ /~$/'
  69. done | perl -w `dirname $0`/patch-pp.pl "$newdir" >> /tmp/$$
  70. if [ "$editor" = "" ]; then
  71. cat /tmp/$$
  72. rm /tmp/$$
  73. else
  74. eval "$editor /tmp/$$"
  75. rm /tmp/$$
  76. fi