On 5/10/05, Aizer Danny-BDA023 <Danny.Aizer@xxxxxxxxxxxx> wrote: > Suppose I have an RPM with an elaborate %preinst script which does all > kinds of things to the file-system (rm, ln, mv, etc). And suppose it > fails (so the package is not installed), but after some things were > done and others not (e.g., an important file was rm'ed but not replaced). > > Is there a way to undo the changes of the %preinst script ? Is there any > script, maybe named %unpreinst, or some other method to do this? > If you used --repackage before hand, you can use --rollback. Check these sites out: http://www.linuxjournal.com/article/7034 http://lee.k12.nc.us/~joden/misc/patches/rpm/ The first one is an article in linux journal that pretty much documents rpm's transactional rollback feature and the second is the autorollback site which is an experimental feature allowing rpm to automatically rollback a failed transaction. Since you probably didn't use --repackage, you will need to re-install the old package using the --oldpackage option. That said, since your old package does not know what your new package did, this may or my not work. Another problem with rolling back scriptlets is presently, rpm does not allow your scriptlet to know if its being called in a rollback or a pure upgrade context. Typically, I use semaphores with upgrade and rollback scripts that wrap rpm. Cheers...james > Thanks, > /Danny > > _______________________________________________ > Rpm-list mailing list > Rpm-list@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/rpm-list >