That's not how this works. The previous spec file doesn't exist on the disk. The scriptlets it included are stored in the rpm database. You can't "edit" that.
You can prevent scripts from running by running rpm --noscripts -e <package>
but you don't want to do that during the ugprade or when removing any other packages.
I assume your package is removing files in %post
. If they aren't files that you can easily recreate/etc. then your only option here is to copy all the files in %pre
and then restore them all in a special trigger designed for this sort of emergency clean up.
From http://rpm.org/api/4.4.2.2/triggers.html:
There is one other type of trigger available -- triggerpostun. These
are triggers that are run after their target package has been removed;
they will never be run when the package containing the trigger is
removed.
While this type of trigger is almost never useful, they allow a
package to fix errors introduced by the postun of another package (or
by an earlier version of that package).
You also don't need to manually remove any files your package installed normally (things listed in the %files
section of your rpm and that rpm -qf <package>
lists). rpm will remove those for your automatically when your package is removed (and install the new packages versions of files automatically during upgrade).