[packagekit] PackageKit and source packages?

Benjamin M. Schwartz bmschwar at fas.harvard.edu
Mon May 23 07:31:41 PDT 2011


On 05/23/2011 04:39 AM, Richard Hughes wrote:
> 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()
> 
> ->   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()
> 
> 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()
> 
> 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.

OK.  I agree.  The alternative that I was thinking of was to add an extra
"src_url" attribute to the Details signal, and let the caller work out
what to do with that URL ... but this does look nicer in several regards.

> If we added the GetSource() call illustrated above, would that solve
> your use case?

I think it would.  I think my imagined patch to Gnome-shell would use
SearchFiles to find out which package owns a certain program, GetSource to
get the corresponding source package name, and DownloadPackage to $TMPDIR
to retrieve the source.  Then I would probably pop up a nautilus or
file-roller window to show the contents, and rely on file-roller's ability
to decompress the various package formats.

Installing the source package with InstallPackages would be cleaner use of
the available abstractions, but it would require installation privileges,
and would waste disk space by accumulating permanently installed source code.

--Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/packagekit/attachments/20110523/e13fa20f/attachment-0004.pgp>


More information about the PackageKit mailing list