diff options
author | Guillem Jover <guillem@debian.org> | 2012-04-21 02:14:30 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2012-06-30 06:35:24 +0200 |
commit | bae98fb22f3ba9592772365ba23f37a02b4d55a0 (patch) | |
tree | 7d51459d95e788a2b5769d78fddc1aebb35035d4 /dpkg-deb | |
parent | f2199100c96c85850f6aee405fe69c888bb34b5b (diff) | |
download | dpkg-bae98fb22f3ba9592772365ba23f37a02b4d55a0.tar.gz |
libdpkg: Change pkg_format_parse() to take a dpkg_error argument
This fixes two issues at once: the more detailed inner message is
relied back to the more general outter printer which allows a clearer
error message, and it makes the pkg-format module stop printing things
at all which is bad for a library,
Diffstat (limited to 'dpkg-deb')
-rw-r--r-- | dpkg-deb/info.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c index 53eb4cf7a..7c3483cd5 100644 --- a/dpkg-deb/info.c +++ b/dpkg-deb/info.c @@ -271,11 +271,13 @@ do_showinfo(const char *const *argv) { const char *debar, *dir; char *controlfile; + struct dpkg_error err; struct pkginfo *pkg; - struct pkg_format_node *fmt = pkg_format_parse(showformat); + struct pkg_format_node *fmt; + fmt = pkg_format_parse(showformat, &err); if (!fmt) - ohshit(_("Error in format")); + ohshit(_("error in show format: %s"), err.str); info_prepare(&argv, &debar, &dir, 1); |