Macro find tool

Does there exist a tool to find in what package a given macro is defined? I have to work with LaTeX (not XeLaTeX, for legacy reasons). I'm dealing with very old code, which I have to get compiled. So, if I encounter an unknown command, I have to include the corresponding package. Currently, I just google and hope to find the right package. Does there exist something like Hoogle (which is a search engine for Haskell), but for LaTeX?

-
There is no existing package that can figure out which macro belongs to which package, since some packages redefine macros, effectively duplicating the source. The other way around though (finding out the macro definition given a package/class) is possible via texdef. – Werner May 25 '12 at 17:33
I found a package (it's not on CTAN) that defined \value, \left and \right. Really! It's quite hopeless to do a search in the 1588 (current value) directories under <TeXLive root>/tex/latex (and there are other places where to look for packages). – egreg May 30 '12 at 17:47
@egreg I routinely grep through <TeXLive root>/tex/latex, and I think Joseph Wright also does. This is useful for us to know how much a given LaTeX3 feature is used. – Bruno Le Floch Aug 28 '12 at 19:10

find kpsewhich -show-path=tex | sed 's/:/ /g' | sed 's/\!\!//g' -name '.sty' -or -name '.cls' -or -name '*.tex' | xargs grep MACRO