[packagekit] Broken %pre and %post scripts cause silent failure

Sveta Anisimova svet at bu.edu
Fri Mar 21 11:03:51 PDT 2008


Hi,

here's the broken %pre script from the
spec file :
%pre
echo I will not even install
exit 1

which causes the PackageKit to fail to install the package but doesn't
catch an appropriate error.
the Finished signal reports success for package_update() function call.

here is a demonstration with both PackageKit and yum update:

[svet at svet ~]$ pkcon update testbroken
resolve runtime was 0.9 seconds
update-package runtime was 5.5 seconds

[svet at svet ~]$ yum list testbroken
Excluding Packages in global exclude list
Finished
Installed Packages
testbroken.noarch                        1.0.0-1.fc9.svet.bur9. installed
Available Packages
testbroken.noarch                        2.0.0-1.fc9.svet.bur9. sample



[svet at svet ~]$ sudo yum update testbroken
Password:

development               100% |=========================| 2.4 kB    00:00
development-debuginfo     100% |=========================| 1.9 kB    00:00
sample                    100% |=========================| 1.4 kB    00:00
development-source        100% |=========================| 1.9 kB    00:00
primary.sqlite.bz2        100% |=========================| 1.7 MB    00:01
Excluding Packages in global exclude list
Finished
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package testbroken.noarch 0:2.0.0-1.fc9.svet.bur9.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
  Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
  testbroken              noarch     2.0.0-1.fc9.svet.bur9.1  sample
        2.7 k

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       1 Package(s)
Remove       0 Package(s)

Total download size: 2.7 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
I will not even install
error: failed to stat /var/lib/gdm/.gvfs: Permission denied
error: %pre(testbroken-2.0.0-1.fc9.svet.bur9.1.noarch) scriptlet
failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping
testbroken-2.0.0-1.fc9.svet.bur9.1

Updated: testbroken.noarch 0:2.0.0-1.fc9.svet.bur9.1
Complete!

[svet at svet ~]$ yum list testbroken
Excluding Packages in global exclude list
Finished
Installed Packages
testbroken.noarch                        1.0.0-1.fc9.svet.bur9. installed
Available Packages
testbroken.noarch                        2.0.0-1.fc9.svet.bur9. sample

similar problem occurs with broken %post script in the spec file:

%post
echo I am broken
exit 1

with only difference that in this case PackageKit does install the
broken rpm so that both the old and new versions of the same package
listed as installed with yum list.

thanks,

sveta




More information about the PackageKit mailing list