severity 602263 wishlist
quit
Eugene V. Lyubimkin wrote:
> On 2010-11-02 22:59, Jonathan Nieder wrote:
>> $ cupt why gnome-user-guide
>> E: some dpkg triggers are not processed, please run 'dpkg --triggers-only
>> -a' as root
>> E: error parsing system status file '/var/lib/dpkg/status'
>> E: error while creating package cache
[...]
> No, this is definitely not a dpkg bug. All three error messages come
> from cupt. It refuses to build a cache when some dpkg triggers are not
> processed. It was intended, I don't see a bug here. Do you?
Yes, for some sense of the word "bug". During an upgrade it can be
very helpful to learn why the packages being upgraded are there in the
first place.
I suppose the problem is that callers do not know how to deal with
triggers? Here's a very naïve sketch. Untested. I haven't read the
relevant code paths, so it might not even do anything. :)
diff --git a/Cupt/System/State.pm b/Cupt/System/State.pm
index 73029f4..c643fa3 100644
--- a/Cupt/System/State.pm
+++ b/Cupt/System/State.pm
@@ -135,13 +135,11 @@ sub _parse_dpkg_status {
};
do { # check 'status'
local $_ = $installed_info{'status'};
- if (m/^trigger/) {
- mydie("some dpkg triggers are not
processed, please run 'dpkg --triggers-only -a' as root");
- }
if ($_ ne 'not-installed' and $_ ne 'unpacked'
and
$_ ne 'half-configured' and $_ ne
'half-installed' and
$_ ne 'config-files' and $_ ne
'post-inst-failed' and
- $_ ne 'removal-failed' and $_ ne
'installed')
+ $_ ne 'removal-failed' and $_ ne
'installed' and
+ $_ ne 'triggers-awaited' and $_ ne
'triggers-pending')
{
mydie("malformed 'status' status
indicator (for package '%s')", $package_name);
}
diff --git a/Cupt/System/Worker.pm b/Cupt/System/Worker.pm
index 2c865a3..f874f33 100644
--- a/Cupt/System/Worker.pm
+++ b/Cupt/System/Worker.pm
@@ -256,6 +256,10 @@ sub get_actions_preview ($) {
# some interim state, but other
version
$action = 'install';
}
+ } elsif ($ref_installed_info->{'status'} eq
'triggers-awaited' ||
+ $ref_installed_info->{'status'} eq
'triggers-pending')
+ {
+ mydie("some dpkg triggers are not
processed, please run 'dpkg --triggers-only -a' as root");
} else {
# otherwise some package version is
installed
my $version_comparison_result =
Cupt::Core::compare_version_strings(
@@ -272,7 +276,11 @@ sub get_actions_preview ($) {
# package is to be removed
if (defined $ref_installed_info) {
# there is some installed info about package
- if ($ref_installed_info->{'status'} eq
'unpacked' ||
+ if ($ref_installed_info->{'status'} eq
'triggers-awaited' ||
+ $ref_installed_info->{'status'} eq
'triggers-pending')
+ {
+ mydie("some dpkg triggers are not
processed, please run 'dpkg --triggers-only -a' as root");
+ } elsif ($ref_installed_info->{'status'} eq
'unpacked' ||
$ref_installed_info->{'status'} eq
'half-configured' ||
$ref_installed_info->{'status'} eq
'half-installed')
{
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]