Rollback functionality for apt-rpm

Vincent Danen vdanen at annvix.org
Sat Dec 2 22:25:51 PST 2006


* Panu Matilainen <pmatilai at laiskiainen.org> [2006-11-30 14:33:52 +0200]:

> >> This looks like a rather interesting feature. While I can't speak for Panu, I
> >> can definitely see adding this to PhoeNUX OS' build... (Now if only we could
> >> get scriptlet postponing, looks like I have to add it as a lua hook for
> >> now :| )
> 
> You can't really postpone scriptlets without breaking the rpm scriptlet
> ordering assumptions - eg %preun needs to run with the old 
> package still installed, which is it is not when the transaction has 
> completed. I don't even want to think about triggers in that scenario :)

I don't think he meant postponing everything... obviously some stuff
needs to be run right away (as you say, %preun), but some stuff doesn't
(service restarts, etc.) that typically showup in %post.

> > ooh!  ooh!  You mean like postponing all %post scripts and such until
> > after the entire transaction is complete?  Are you serious?  If you
> > implement something like that *please* share!  With Annvix (and Mandriva
> > and possibly other distros) we tend to restart apache on every new
> > module that gets installed, but if you upgrade apache to a new version,
> > that's a lot of modules and a lot of useless apache restarts.
> >
> > I've wanted a post-transaction handler in urpmi for ages but they never
> > seemed to get how useful it would be, so if you have eyes to implement
> > something like this in apt, I'm very very willing to use your work... =)
> > Sorry, I'd be willing to help, but I don't know the first thing about
> > lua and have very little time to learn.
> 
> There are already three different ways to execute stuff post-transaction:
> 1) post-transaction scriptlets in rpm itself (at least later rpm versions)

Do you have more info on this?  I've never heard of this.

> 2) post-transaction scripts in apt-rpm (set via RPM::Post-Invoke config item)
> 3) post-transaction Lua scripts in apt-rpm where there's quite a bit more
>     information available about the transaction etc compared to 2)
> 
> For a simple example of 3) check out the logger script in apt-rpm contrib:
> http://svn.laiskiainen.org/apt-rpm/trunk/contrib/log/

It's a little late, but I'm going to take a look at this tomorrow.  This
sounds really really like what I want.

> Anyway, postponing scripts is going to require some distro-specific 
> conventions in packaging, and when you're down that route ... you can 
> already do that via various mechanisms. Especially with Lua hooks which 
> have access to the actual transaction information, things like "was any 
> package requiring apache restart installed/upgraded/removed in this 
> transaction, do the restart if so" are quite feasible. Obviously those 
> "service needs restart" etc items need to be stored someplace, and there's 
> no readymade script-framework-whatever for it. But it's certainly possible 
> (and if somebody writes something like that, it's more than welcome to the 
> contrib script collection :)

Yeah, that's no problem.  I've always meant to do something like this
with urpmi, but never got around to it since urpmi doesn't have any
hooks and I'd actually have to hack the perl code.  But with the lua
support, doing something like this with apt seems a lot more reasonable.

-- 
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}
mysql> SELECT * FROM users WHERE clue > 0;
Empty set (0.00sec)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
URL: <http://lists.laiskiainen.org/pipermail/apt-rpm-laiskiainen.org/attachments/20061202/eea0abbd/attachment-0003.pgp>


More information about the Apt-Rpm mailing list