[packagekit] Adding a new INFO enumerated type?

Tim Lauridsen tim.lauridsen at googlemail.com
Wed Apr 23 03:29:52 PDT 2008


Richard Hughes wrote:
> Currently we have this:
> 
> typedef enum {
> 	PK_INFO_ENUM_INSTALLED			= 1 << 0,
> 	PK_INFO_ENUM_AVAILABLE			= 1 << 1,
> ...
> } PkInfoEnum;
> 
> INSTALLED means "on my hard drive"
> AVAILABLE means "on the server, and not on the hard drive"
> 
> So when we filter with installed, we just show INSTALLED, and ~installed
> we just show AVAILABLE. When there is no filter we just show both.
> 
> Now, as onestep pointed out on IRC, you can't re-install packages, as
> you don't know whether the INSTALLED package is on the server, or just
> installed from local media. Now, personally I never need to reinstall
> packages, but I know other systems like synaptic support it, and I don't
> want the API in PK to actively /prevent/ it.
> 
> So, what I'm suggesting is we either allow PkInfoEnum to be passed as a
> bitfield (and fix up all the breakages from functions that expect it to
> have a single value) or to add another INFO enum.
> 
> I'm erring on the latter, and doing something like this:
> 
> typedef enum {
> 	PK_INFO_ENUM_LOCAL = 1 << 0,
> 	PK_INFO_ENUM_AVAILABLE = 1 << 1,
> 	PK_INFO_ENUM_REMOTE = 1 << 2,
> ...
> } PkInfoEnum;
> 
> LOCAL means "on my hard drive, not available on the server"
> AVAILABLE means "on the server, and on the hard drive"
> REMOTE means "on the server, and not on the hard drive"
> 
> With this scheme, the installed filter would match on LOCAL and
> AVAILABLE, and ~installed would match on REMOTE. No filter would match
> all three. (note: a regression/slowdown would be requiring network
> access to do installed searching, as we need to know if a package is
> still in the repo...)
> 
> LOCAL packages would have a remove action, AVAILABLE would have remove,
> and re-install action and remote would have install action.
> 
> But then again maybe a bitfield might be best. Feedback required.
> Thanks.
> 
> Richard.

I dont like that you are changing the meaning of 'AVAILABLE',
'AVAILABLE' should mean available for install, not installed and 
available on the server.
You can split INSTALLED into 2 cases.
Installed and exist on the server (INSTALLED_REMOTE)
Installed and not existing on the server (INSTALLED_LOCAL)

AVAILABLE has a installed button
INSTALLED_REMOTE has a Remove + Reinstall button
INSTALLED_LOCAL as a Remove Button

you can added a extra filter called 'remote' there will only show 
packages available on the server.
and '~remote' will only show package not available on the server.

Tim

> 
> 
> _______________________________________________
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/packagekit




More information about the PackageKit mailing list