[packagekit] Getting the repository a package was installed from

Anders F Björklund afb at algonet.se
Thu Dec 9 00:31:36 PST 2010


Richard Hughes wrote:

> I.e. if the package backend supports getting the "what repo did this
> package come from" then it uses @ then the repo name, so that the '@'
> signifies installed. The alternative is
> "hal;0.0.1-1.fc13;i386;installed:fedora" or
> "hal;0.0.1-1.fc13;i386;installed at fedora" which would be exactly the
> same, just a few bytes more, and maybe clearer to the implementor. Of
> course, this would be optional and we'll still support "installed" for
> the foreseeable future.

The @repo has the same "dirty hack" feel to it,
as the current @collection does for names... ?

But I guess "installed" was something of a kludge
anyway, using a boolean there seems more natural.

> So, votes please:
> 
> 1. Just stick with "installed" and add another DBus method to get the
> repo it was installed from
> 2. "installed:fedora"
> 3. "@fedora"
> 4. "installed at fedora"

Probably 1, but either is fine as far as I care.

i.e. neither are true repos, but field is "data"

Easy enough to modify:

        if package.installed:
            data = 'installed'
        elif self._channel_is_local(channel):
            data = 'local'
        else:
            data = channel.getAlias()

> It would also be interesting to know how many backends can get the
> "where the package came from" information.

I added it as an RFE for Smart Package Manager:

https://bugs.launchpad.net/smart/+bug/687713

In the PackageKit backend, it would be used like:

    repoid = smart.pkgconf.getOrigin(package)

--anders




More information about the PackageKit mailing list