On Wed, Sep 12, 2007 at 11:27:27PM +0200, Kurt Roeckx wrote:
> On Wed, Sep 12, 2007 at 08:59:37PM +0000, brian m. carlson wrote:
> > package dpkg
> > tags 432893 + patch
> > kthxbye
> > 
> > Attached is a patch that *should* fix this bug.  It simply restores the
> > previous state of a package when a removal fails, instead of simply
> > setting it to installed.  Preliminary testing seems to confirm that this
> > works.  A changelog entry is also included.
> 
> Policy says:
>           If this fails, the package is in a "Failed-Config" state, or else
>           it remains "Installed".

Unfortunately, it's not very clear what "this" refers to: is it the
entire series of scripts (step 1 in its entirety), or is it just the
abort-remove call?  I don't think it matters, since the result is the
same.

> Is there a reason that prerm failure doesn't always set the
> Failed-Config state?  dpkg has no idea which part of the prerm was
> succesful and which not, it might have undone some part of the postinst
> and then failed, and I think the Failed-Config makes most sense.

In the case that I tested, the abort-remove call was successful.  I can
add a test for the case when it is not and set the proper flags for that
case as well.  That's a trivial patch.

Knowing what policy says, my personal feeling in this case is:

state = abort_remove_ok?prev_state:failed_config;

A package obviously cannot "remain" anything when it wasn't that way in
the first place.

> But I guess it should only do that if the original state was either
> Installed or Failed-Config, and else keep the original state.
> But I have no idea if it calls the prerm in the other states.  For
> instance, what should it do if called from Unpacked state?

Well, we don't have many choices.  Unpacked is the only case I can see
where that would be a problem.  And in that case, I think that it does
no harm to either mark it as failed-config or leave it unpacked, since
the cases are almost identical: it will still have to be configured.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature

Reply via email to