Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function p {
- wget -O tmp.patch $1; patch -p0 < tmp.patch; d tmp.patch;
- }
- function d {
- # cvs diff -upNF^f . > $1.patch
- git diff --no-prefix HEAD . > $1.patch;
- # Clean up to avoid possible issues.
- rm -f $1.tmp.patch
- # Find every instance of the dpm()
- count=`diff_word_count "dpm(" $1.patch`
- if [ $count -gt 0 ]; then
- echo WARNING! Found $count instances of dpm\(\)! >> $1.tmp.patch
- fi
- # Find every instance of the dsm()
- count=`diff_word_count "dsm(" $1.patch`
- if [ $count -gt 0 ]; then
- echo WARNING! Found $count instances of dsm\(\)! >> $1.tmp.patch
- fi
- # Find every instance of the debug()
- count=`diff_word_count "debug(" $1.patch`
- if [ $count -gt 0 ]; then
- echo WARNING! Found $count instances of debug\(\)! >> $1.tmp.patch
- fi
- # Add contents of $1.patch below our warnings.
- count=`cat $1.tmp.patch | wc -l`
- if [ $count -gt 0 ]; then
- echo ------------------------------------------------------------------------------ >> $1.tmp.patch
- fi
- cat $1.patch >> $1.tmp.patch
- # Dump everything back into $1.patch and delete our temporary file.
- cat $1.tmp.patch > $1.patch
- rm -f $1.tmp.patch
- bbedit ./$1.patch;
- }
- function diff_word_count {
- cat $2 | grep $1 | wc -l
- }
Add Comment
Please, Sign In to add comment