Merge lp:~mvo/sessioninstaller/install-provided-for-binaries into lp:sessioninstaller

Proposed by Michael Vogt
Status: Merged
Merged at revision: 113
Proposed branch: lp:~mvo/sessioninstaller/install-provided-for-binaries
Merge into: lp:sessioninstaller
Diff against target: 38 lines (+20/-1)
1 file modified
sessioninstaller/core.py (+20/-1)
To merge this branch: bzr merge lp:~mvo/sessioninstaller/install-provided-for-binaries
Reviewer Review Type Date Requested Status
Aptdaemon Developers Pending
Review via email: mp+35996@code.launchpad.net

Description of the change

This should give us "install_provided_file" support for binaries.

I just tested it with brasero and it works fine there, it requests cdrdao
and after the install is finished, it will burn the disk.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

A full fix needs apt-file I think. We should monitor how this is actually used, if e.g.
for libs, we could extend command-not-found to include them too.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sessioninstaller/core.py'
2--- sessioninstaller/core.py 2010-09-09 07:02:33 +0000
3+++ sessioninstaller/core.py 2010-09-20 10:11:03 +0000
4@@ -685,6 +685,25 @@
5 @track_usage
6 @inline_callbacks
7 def _install_provide_files(self, xid, files, interaction, sender):
8+ try:
9+ import CommandNotFound
10+ cnf = CommandNotFound.CommandNotFound("/usr/share/command-not-found")
11+ to_install = list()
12+ for executable in [os.path.basename(f) for f in files]:
13+ list_of_packages_and_components = cnf.getPackages(executable)
14+ if list_of_packages_and_components:
15+ (package, component) = list_of_packages_and_components[0]
16+ to_install.append(package)
17+ if to_install:
18+ yield self._install_package_names(xid, to_install, interaction, sender)
19+ return
20+ # FIXME: show a message here that the binaries were not
21+ # found instead of falling through to the misleading
22+ # other error message
23+ except:
24+ log.exception("command-not-found")
25+
26+ # FIXME: use a different error message
27 header = _("Installing packages by files isn't supported")
28 message = _("This method hasn't yet been implemented.")
29 #FIXME: should provide some information about how to find apps
30@@ -1028,7 +1047,7 @@
31 header = _("Installing printer drivers on request isn't supported")
32 message = _("Currently autodetection and installation of "
33 "missing printer drivers is not supported.")
34- #FIXME: should provide some information about how to get fonts
35+ #FIXME: should provide some information about how to get printers
36 dia = ErrorDialog(header, message)
37 dia.run()
38 dia.hide()

Subscribers

People subscribed via source and target branches