GNOME Bugzilla – Bug 682104
Improve the error message when apt-file is not present
Last modified: 2012-09-12 12:58:13 UTC
This patch improves the error message that jhbuild give, in the case that apt-file is not installed, when jhbuild is invoked with: jhbuild sysdeps --install Old message: Don't know how to install packages on this system New message: Don't know how to install packages on this system\nYou may need to install apt-file first. This patch is of course only useful for people using apt based systems such as Ubuntu or Debian, but it is at least an improvement on the current message, which leaves the user with no clue as to why the command failed.
(In reply to comment #0) > This patch is of course only useful for people using apt based systems such as > Ubuntu or Debian Exactly that's the problem: The statement is wrong/misleading for anybody else. Maybe "Please contact your distribution to find out what is needed to install packages from the command line / terminal"?
I would rather like to improve the error messages in a way that they provide enough information for the people to help themselves. Today I was trying to compile gtk+ with jhbuild and I had to ask multiple times in IRC to figure out what was going wrong, luckily people were there to help me, but that might not always be the case. Can't we somehow compile a list of all tool names, or find a generic way to get the tool name? We could also write something like: If you are using a .deb based distribution such as Debian, Ubuntu, Mint, etc. you need to install apt-file. If you are on Fedora, install ... Otherwise, contact your distribution.
(In reply to comment #1) > > Maybe "Please contact your distribution to find out what is needed to install > packages from the command line / terminal"? It's not that they need something on Ubuntu to install packages; apt-file is a tool to find which packages contain a filename. Polishing this up would require splitting up the current detect() method into: available(): ready(): print_help(): Or something. Where available() for Ubuntu/Debian would be whether 'apt-get' is in the path, ready() would be a check for apt-file installed and set up, and print_help() would describe how to install apt-file and set it up.
Created attachment 222607 [details] [review] sysdeps: Suggest install apt-file if apt-get installd How about something like this? Look at coding up Colin's available(), ready(), print_help() in the future.
Review of attachment 222607 [details] [review]: ::: jhbuild/commands/sysdeps.py @@ +133,3 @@ + "packages on this system. Please " + "install %(cmd)s.") + % {'cmd' : 'apt-file'}) Maybe link the user to http://www.debian.org/doc/manuals/apt-howto/ch-search.en.html#s-apt-file ? Also probably worth adding a comment above that links to this bug, so someone coming along later knows it's a temporary ubuntu/debian-only thing.
Created attachment 222741 [details] [review] sysdeps: Suggest install apt-file if apt-get installd (In reply to comment #5) > Also probably worth adding a comment above that links to this bug, so someone > coming along later knows it's a temporary ubuntu/debian-only thing. Added a comment as suggested.
Created attachment 222742 [details] [review] doc: apt-file is required for users on Debian/Ubuntu (In reply to comment #5) > Maybe link the user to > http://www.debian.org/doc/manuals/apt-howto/ch-search.en.html#s-apt-file ? Hmmm, that document is obsolete. How about instead an update to the manual, as attached?
Comment on attachment 222741 [details] [review] sysdeps: Suggest install apt-file if apt-get installd Committed. http://git.gnome.org/browse/jhbuild/commit/?id=5585c82f65ab296d39a61af12083e6fa9dc2b08b
Comment on attachment 222742 [details] [review] doc: apt-file is required for users on Debian/Ubuntu Committed. http://git.gnome.org/browse/jhbuild/commit/?id=309ed16edcaa7c79c5ae506d46f2ad181a7bc13f