Bug 19810 - pkcon resolve does not understand package name any more
Summary: pkcon resolve does not understand package name any more
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-29 07:50 UTC by Martin Pitt
Modified: 2009-01-29 09:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch (974 bytes, patch)
2009-01-29 08:19 UTC, Martin Pitt
Details | Splinter Review

Description Martin Pitt 2009-01-29 07:50:55 UTC
In earlier packagekit versions, "pkcon resolve foo" would give me the ID and installation status of package "foo". With 0.3.13 that doesn't seem to work any more:

$ LANG=C pkcon resolve coreutils
Error: package-not-found : Package name pkcon could not be resolved
$ LANG=C pkcon resolve hal
Error: package-not-found : Package name pkcon could not be resolved

I. e. regardless of which package name I give to it, it always tries to resolve "pkcon".

This is with the apt backend. (Ubuntu 9.04)
Comment 1 Martin Pitt 2009-01-29 07:54:38 UTC
I'm willing to bet my lunch that this is due to 23f348972c05ba1b8f2837c61110facc2ebefd9e:

-               package_ids = pk_package_ids_from_id (value);
-               ret = pk_client_resolve (client_async, filters, package_ids, &error);
-               g_strfreev (package_ids);
+               ret = pk_client_resolve (client_async, filters, argv, &error);

This probably shouldn't start at argv, since argv[0] is "pkcon", and argv[1] is "resolve"?
Comment 2 Martin Pitt 2009-01-29 07:58:52 UTC
This breaks Jockey's test suite, I'll have a look at this. The original code takes "value = argv[2]", so using argv+2 should DTRT. I'll run some tests, and if it works, commit.
Comment 3 Martin Pitt 2009-01-29 08:18:40 UTC
Ah, there we go.

Original:

$ ./pkcon resolve hal coreutils
Error: package-not-found: Package name /home/martin/ubuntu/packagekit/PackageKit/client/.libs/lt-pkcon could not be resolved

argv+2 works in all cases:

$ ./pkcon resolve hal coreutils
installed   	hal-0.5.12~rc1+git20090120-0ubuntu1  [===============]         
installed   	coreutils-6.10-6ubuntu1              [===============]         

$ ./pkcon --filter=installed resolve hal coreutils
installed   	hal-0.5.12~rc1+git20090120-0ubuntu1  [===============]         
installed   	coreutils-6.10-6ubuntu1              [===============]         

$ ./pkcon resolve 
Command failed:  You need to specify a package name to resolve

git push doesn't seem to work for me (I suspect I'm using the wrong address), so I'll just attach the patch.
Comment 4 Martin Pitt 2009-01-29 08:19:06 UTC
Created attachment 22355 [details] [review]
patch
Comment 5 Richard Hughes 2009-01-29 09:00:44 UTC
Committed, thanks dude.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.