[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] [patch 5/5] Informative message when using graph without
From: |
Jean Delvare |
Subject: |
Re: [Quilt-dev] [patch 5/5] Informative message when using graph without graphviz |
Date: |
Sun, 19 Jan 2014 21:14:44 +0100 |
Hi Martin,
Le Saturday 18 January 2014 à 01:54 +0100, address@hidden a
écrit :
> pièce jointe document texte brut (graph_depends_on_graphviz)
> Description: Informative message when using graph without graphviz
> Previously, trying to use the graph subcommand without graphviz being
> installed resulted in a cryptic error message:
> .
> Can't exec "tred": No such file or directory at
> /usr/lib/perl/5.14/IO/File.pm line 66, <STDIN> line 1.
As far as I can see, tred is only needed for the --reduce option.
Likewise, dot is needed but only if option -T is passed. If neither
option is passed, quilt graph works without graphviz.
> graphviz is already in the Suggests field of the debian package, and
> we cannot raise this dependency severity given the central role of
> quilt in the debian infrastructure. This informative error message is
> much more sensible.
I agree that we do not want a hard dependency on graphviz. The graph
subcommand is not a core one, I almost never use it. In openSUSE we did
not even suggest graphviz.
> Author: Martin Quinson <address@hidden>
> Bug-Debian: http://bugs.debian.org/659944
> Forwarded: 2014-01-18
>
> ---
> quilt/graph.in | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> Index: b/quilt/graph.in
> ===================================================================
> --- a/quilt/graph.in
> +++ b/quilt/graph.in
> @@ -17,6 +17,13 @@
> . $QUILT_DIR/scripts/patchfns
> fi
>
> +whichtred=`which /usr/bin/tred`
> +if [ -z "$whichtred" ]
tred doesn't have to be installed in /usr/bin, it could be
in /usr/local/bin or anywhere else. The mail command has a similar "soft
dependency" on formail, and it is handled that way:
# check if formail is installed before doing anything
if ! type formail &> /dev/null
then
echo $"You have to install 'formail' to use 'quilt mail'" >&2
exit 1
fi
I believe you should do the same for graphviz. I don't know if some
distributions split graphviz into multiple packages... But just in case,
it would feel safer to check separately for "dot" if option -T is passed
and for "tred" if option --reduce is passed.
> +then
> + echo $"It seems that graphviz is currently not installed (unable to
> find the tred binary). You must install it to use 'quilt graph'."
> + exit 1
> +fi
It would be great to come up with a common error message format that can
be used for all similar cases. Something like:
printf $"You have to install '%s' (from package '%s') to use 'quilt
%s'\n" \
tred graphviz graph >&2
That way we don't have to translate it again and again.
--
Jean Delvare
Suse L3 Support
- [Quilt-dev] [patch 0/5] Resending updated debian patches, mquinson, 2014/01/17
- [Quilt-dev] [patch 2/5] allow mail command to grab the mail title from dep3 formalism, mquinson, 2014/01/17
- [Quilt-dev] [patch 5/5] Informative message when using graph without graphviz, mquinson, 2014/01/17
- Re: [Quilt-dev] [patch 5/5] Informative message when using graph without graphviz,
Jean Delvare <=
- [Quilt-dev] [patch 3/5] verbose error message when the serie file does not exist, mquinson, 2014/01/17
- [Quilt-dev] [patch 4/5] setup dont obey the settings of any englobing .pc, mquinson, 2014/01/17
- [Quilt-dev] [patch 1/5] Exit with an error when diffs retcode=2 (error) on patch refresh, mquinson, 2014/01/17