After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682104 - Improve the error message when apt-file is not present
Improve the error message when apt-file is not present
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2012-08-17 13:51 UTC by Sebastian
Modified: 2012-09-12 12:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sysdeps: Suggest install apt-file if apt-get installd (1.50 KB, patch)
2012-08-28 04:28 UTC, Craig Keogh
reviewed Details | Review
sysdeps: Suggest install apt-file if apt-get installd (1.64 KB, patch)
2012-08-29 12:15 UTC, Craig Keogh
committed Details | Review
doc: apt-file is required for users on Debian/Ubuntu (1.40 KB, patch)
2012-08-29 12:16 UTC, Craig Keogh
committed Details | Review

Description Sebastian 2012-08-17 13:51:36 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.
Comment 1 André Klapper 2012-08-17 17:20:49 UTC
(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"?
Comment 2 Sebastian 2012-08-17 20:55:55 UTC
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.
Comment 3 Colin Walters 2012-08-20 17:25:31 UTC
(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.
Comment 4 Craig Keogh 2012-08-28 04:28:33 UTC
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.
Comment 5 Colin Walters 2012-08-28 12:34:39 UTC
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.
Comment 6 Craig Keogh 2012-08-29 12:15:04 UTC
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.
Comment 7 Craig Keogh 2012-08-29 12:16:30 UTC
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 8 Craig Keogh 2012-09-12 12:57:45 UTC
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 9 Craig Keogh 2012-09-12 12:58:02 UTC
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