Still up to the same old stupid bash tricks... but implemented slightly better. This will still have to be manually maintained to remain useful as wine's directory structure evolves, just like the old "version" of this awfulness. Use at your own (very real) risk as these are almost untested. License is bugroff.
This version has better provisions for in-source compilation, runs in only one pass, and is cwd/location independant. It should also be a lot easier to maintain than the previous try
winetreediff_excl (a text file listing shell-glob patterns to ignore):
CVS *.o *.a *.s Makefile *.spec.c *.dll.dbg.c *.exe.dbg.c *.drv.dbg.c *.acm.dbg.c *.ocx.dbg.c *.so *.def *.glue.c *.ok *.mc.rc testlist.c aclocal.m4 *.res gmtdir Makeprog.rules Make.rules *.swp config.log config.status lex.yy.c y.tab.c y.tab.h *.so.?.? wineclipsrv doall doconfig wine.man autom4te.cache mydiffs gmt-cfg-vars Makedll.rules Maketest.rules tags delme.diff delme2.diff wine.texinfo <<EOF
winetreediff (a script to filter out impossible-to-glob patterns and perform the real processing. Note the hard-coded path to winetreediff_excl. Change it to match where you put it. Needs the x bit, of course.)
#!/bin/sh
noslash=$( echo "$1" | sed s/\/$// ) noslashquot=$( echo "$noslash" | sed s/\//\\\//g | sed s/\./\\\./g )
# echo "noslash=$noslash noslashquot=$noslashquot"
rm -f delme.diff delme2.diff touch delme.diff delme2.diff
diff -ur --minimal --exclude-from=/home/greg/bin/winetreediff_excl $noslash . | \ grep -v '^Only in.*wine$' | \ grep -v '^Only in .*dlls/rpcrt4/tests: stringinput_server$' | \ grep -v '^Only in .*include: config.h$' | \ grep -v '^Only in .*programs/avitools: aviinfo$' | \ grep -v '^Only in .*programs/avitools: aviplay$' | \ grep -v '^Only in .*programs/avitools: icinfo$' | \ grep -v '^Only in .*programs/clock: clock$' | \ grep -v '^Only in .*programs/cmdlgtst: cmdlgtst$' | \ grep -v '^Only in .*programs/control: control$' | \ grep -v '^Only in .*programs/expand: expand$' | \ grep -v '^Only in .*programs/notepad: notepad$' | \ grep -v '^Only in .*programs/osversioncheck: osversioncheck$' | \ grep -v '^Only in .*programs/progman: progman$' | \ grep -v '^Only in .*programs/regapi: regapi$' | \ grep -v '^Only in .*programs/regedit: regedit$' | \ grep -v '^Only in .*programs/regsvr32: regsvr32$' | \ grep -v '^Only in .*programs/regtest: regtest$' | \ grep -v '^Only in .*programs/rpcss: rpcss$' | \ grep -v '^Only in .*programs/rundll32: rundll32$' | \ grep -v '^Only in .*programs/uninstaller: uninstaller$' | \ grep -v '^Only in .*programs/view: view$' | \ grep -v '^Only in .*programs/wcmd: wcmd$' | \ grep -v '^Only in .*programs: wineapploader$' | \ grep -v '^Only in .*programs/wineboot: wineboot$' | \ grep -v '^Only in .*programs/wineconsole: wineconsole$' | \ grep -v '^Only in .*programs/winedbg: winedbg$' | \ grep -v '^Only in .*programs/winefile: winefile$' | \ grep -v '^Only in .*programs: winelauncher$' | \ grep -v '^Only in .*programs/winemine: winemine$' | \ grep -v '^Only in .*programs/winepath: winepath$' | \ grep -v '^Only in .*programs/winhelp: hlp2sgml$' | \ grep -v '^Only in .*programs/winhelp: winhelp$' | \ grep -v '^Only in .*programs/winver: winver$' | \ grep -v '^Only in .*server: wineserver$' | \ grep -v '^Only in .*stringinput_server: stringinput_server$' | \ grep -v '^Only in .*tools: bin2res$' | \ grep -v '^Only in .*tools: fnt2bdf$' | \ grep -v '^Only in .*tools: makedep$' | \ grep -v '^Only in .*tools: mingwrap$' | \ grep -v '^Only in .*tools/widl: widl$' | \ grep -v '^Only in .*tools/winebuild: winebuild$' | \ grep -v '^Only in .*tools/winebuild: winebuild.man$' | \ grep -v '^Only in .*tools/winedump: winedump$' | \ grep -v '^Only in .*tools: winegcc$' | \ grep -v '^Only in .*tools: winewrap$' | \ grep -v '^Only in .*tools/wmc: wmc$' | \ grep -v '^Only in .*tools/wrc: wrc$' | \ ( tee delme.diff | grep -v '^Only in .*:' )
cat delme.diff | \ grep '^Only in .*:' | \ sed s/^Only\ in\ // | \ sed s/:\ /\// | \ ( tee delme2.diff | grep "^./" ) | \ sed "s/^.//diff\ -u\ /dev/null\ .//" | \ sed "s/$/;/" | \ bash -C -
cat delme2.diff | \ grep -v "^./" | \ sed "s/^$noslashquot//diff\ -u\ .//" | \ sed "s/$/\ /dev/null;/" | \ ( cd $noslash && bash -C - )
rm -f delme.diff delme2.diff <<EOF
still hardly a work of art. but ought to generate diffs between trees ready for submission to wine-devel, no cvs needed. For example, I use this as follows to update my horribly out-of-sync wine tree with the latest changes from cvs:
.../wine> cd ../wine.test .../wine.test> winetreediff ../wine.vanilla | wc -l
0 .../wine> # great, these trees are identical w.r.t. winetreediff. .../wine> cd ../wine.vanilla .../wine.vanilla> cvs -qz4 up -dPA
[cvs does something]
.../wine.vanilla> # generate the difference between "../wine.test" and "." .../wine.vanilla> winetreediff ../wine.test > ../wine/mydiffs/cvsupdate.diff .../wine.vanilla> cd ../wine.test .../wine.test> patch -p0 < ../wine/mydiffs/cvsupdate.diff
[ goes fine ]
.../wine.test> cd ../wine
Now I have a nice diff expressing the difference caused by the CVS update. If I am concerned about it, I could run
.../wine> patch -p0 --dry-run < mydiffs/cvsupdate.diff
To see what the damage will be, otherwise, just
.../wine> patch -p0 < mydiffs/cvsupdate.diff
would bring me up-to-date.
LIMITATIONS:
o Dangerous if used incautiously. o Breaks if wine changes. o Probably Buggy. o Only supports "." and "/" characters in directory argument. o Creates and destroys temp files named delme.diff and delme2.diff. (Should at least use something more obscure.) o Prefers (requires?) a matching directory structure between the two trees.