[packagekit] PackageKit and source packages?

Anders F Björklund afb at algonet.se
Mon May 23 01:58:01 PDT 2011


Richard Hughes wrote:

> On 21 May 2011 17:18, Benjamin M. Schwartz <bmschwar at fas.harvard.edu> wrote:
>> 1. Get the source code by asking PackageKit to install the source package,
>> and then asking PackageKit for the list of files owned by this package.
>> For RPM this applies literally.  For Gentoo, the backend would have to
>> emulate this somehow.
> 
> Right. In PackageKit parlance, this would happen:
> 
> ->   Resolve(sane-backends)
> <-   Package(available, sane-backends;0.3.0;i396;fedora, Scanner software)
> <-   Finished()
> 
> ->   GetSource(sane-backends;0.3.0;i396;fedora)
> <-   Package(available, sane;0.3.0;i396;fedora-source, Scanner software)
> <-   Finished()

For the backends that already compile from source (ports),
these would just resolve to the same package I suppose ?

Shouldn't the arch be changed too, to download the source
rather than a pre-compiled version if one is available ?

Or must one add a fake repo for that, to split ports/packages ?
Currently, for the FreeBSD backend, they're all in "ports":

  def get_repo_list(filters)
    status(STATUS_INFO)
    repo_detail("ports", "FreeBSD Ports", enabled=true)
  end

When you install, it tries to download a binary .tbz if one
is available otherwise it falls back to building from source.

> ->   DownloadPackage(sane;0.3.0;i396;fedora-source, "/tmp")
> <-   Package(downloading, sane;0.3.0;i396;fedora-source, Scanner software)
> <-   Files(sane;0.3.0;i396;fedora-source, "/tmp/sane-0.3.0.i396.srpm")
> <-   Finished()

That should probably be more like .src.rpm than .i386.srpm ?
Relating to the arch question above, shouldn't it be "src".

> or, if we just want the files list of the source package:
> 
> ->   GetFiles(sane;0.3.0;i396;fedora-source, "/tmp")
> <-   Files(sane;0.3.0;i396;fedora-source, "/usr/share/sane/README")
> <-   Finished()

So when you query a source package, you get the files that
would be installed - e.g. build and peek at $RPM_BUILD_ROOT ?

It seemed more likely that it would consist of files like
*.spec and *.tar.gz (or similar, like *.patch *_orig.tar.gz)

> I think realistically this is the level PackageKit should work at,
> rather doing things like decompressing archives and git trees, and
> that kind of thing.
> 
> If we added the GetSource() call illustrated above, would that solve
> your use case?

Would PackageKit also support for BuildDepends and BuildPackage ?
Or is this more of an informational query, like a metadata field ?

--anders




More information about the PackageKit mailing list