I have found a bug in an RPM that I have been provided. rpm -qp --scripts foo.rpm > /tmp/badscriptcat /tmp/badscriptpostinstall scriptlet (using /bin/sh):...if [ 'some bug' == true ]....I have access to the source code and the spec files, but I am unable to find which file is the postinstall scriptlet. Is it possible for me to fix this bug? If so where do I find the script?I assumed it would be in buildutils/rpmbuild/SPEC, yet when I grep the entire source code, I can't find the string that contains the bug. 
Where are RPM postinstall scripts located?
shell script;rpm
They are in the spec file itself. See http://fedoraproject.org/wiki/How_to_create_an_RPM_package#ScriptletsIn your case search for a %post section.