Malte Forkel wrote:
> Can I safely modify /var/lib/apt/extended_states in a postinst skript,
> that is while aptitude | apt-get | ... is running?

Ew...  That could be scary!  The short answer is that I don't know.
Certainly an official package would no be allowed to do it.  But would
it work?  I don't know.  Maybe.  I think that postinst time is at a
completely different time from when apt edits that package so it would
probably interlace acceptably.  That would change this suggestion hack
into a serious hack.

Can I ask why you want to do it in a package postinst?  I assumed you
had just wanted to diddle the status of a package or two without
actually removing and reinstalling the package.  But now it sounds
like you want to do something more extensive.  Perhaps it would be
better to do using cfengine, puppet, chef, shell script or other tool.
(I use one of the other tools.)  This just doesn't seem like something
that would work out well in a package.  Sounds like something that
most people might recommend puppet and similar for instead.

> I guess /var/lib/apt/extended_states is not officially documented, so
> its very unlikely but possible that it might change or disappear in the
> future?

Right.  Use of it is entirely within the confines of the apt program
until the authors there decide otherwise.  But the file exists and is
a text file and Unix is all about hacking text files and so I have
hacked on it.  But that doesn't make it the right thing to do.  You
would be completely on your own about it.

Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to