Guest User

Untitled

a guest
Jun 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. function p {
  2. wget -O tmp.patch $1; patch -p0 < tmp.patch; d tmp.patch;
  3. }
  4. function d {
  5. # cvs diff -upNF^f . > $1.patch
  6. git diff --no-prefix HEAD . > $1.patch;
  7.  
  8. # Clean up to avoid possible issues.
  9. rm -f $1.tmp.patch
  10.  
  11. # Find every instance of the dpm()
  12. count=`diff_word_count "dpm(" $1.patch`
  13. if [ $count -gt 0 ]; then
  14. echo WARNING! Found $count instances of dpm\(\)! >> $1.tmp.patch
  15. fi
  16.  
  17. # Find every instance of the dsm()
  18. count=`diff_word_count "dsm(" $1.patch`
  19. if [ $count -gt 0 ]; then
  20. echo WARNING! Found $count instances of dsm\(\)! >> $1.tmp.patch
  21. fi
  22.  
  23. # Find every instance of the debug()
  24. count=`diff_word_count "debug(" $1.patch`
  25. if [ $count -gt 0 ]; then
  26. echo WARNING! Found $count instances of debug\(\)! >> $1.tmp.patch
  27. fi
  28.  
  29. # Add contents of $1.patch below our warnings.
  30. count=`cat $1.tmp.patch | wc -l`
  31. if [ $count -gt 0 ]; then
  32. echo ------------------------------------------------------------------------------ >> $1.tmp.patch
  33. fi
  34. cat $1.patch >> $1.tmp.patch
  35.  
  36. # Dump everything back into $1.patch and delete our temporary file.
  37. cat $1.tmp.patch > $1.patch
  38. rm -f $1.tmp.patch
  39.  
  40. bbedit ./$1.patch;
  41. }
  42. function diff_word_count {
  43. cat $2 | grep $1 | wc -l
  44. }
Add Comment
Please, Sign In to add comment