On 9/6/06, Leszek Matok <Lam(a)lam.pl> wrote:
transaction:
echo "mv -f file.bak file" > backlog
mv file file.bak
cp -f file.new file # actual work, this can break
rm -f file.bak backlog
error recovery on next run:
if [ -f backlog ]
sh backlog
fi
Do you know a file system that can't do this?
Well, this doesn't work because of %pre, %post, %preun, %postun,
%trigger, etc. If %post touches a file in /etc, you can't restore old
files listed in the %files section and honestly expect everything to
continue to work as if nothing happened. It's for this same reason why
yum doesn't handle package downgrading and rollbacks -- there is no
100% safe way to perform them, so yum doesn't even try.
With the way RPM is designed, unless you can do a filesystem-level
rollback to a pre-transaction state, you shouldn't abort a
transaction. Without that, everything is going to be a fragile hack
that can leave things really, really broken.
Regards,
--
Konstantin Ryabitsev
Montréal, Québec