[pacman-dev] [PATCH] dependency error message fix in package.c + critical error messages

Nagy Gabor ngaba at bibl.u-szeged.hu
Fri Oct 26 10:24:59 EDT 2007


> On 10/23/07, Xavier <shiningxc at gmail.com> wrote:
> > On Wed, Oct 24, 2007 at 01:15:39AM +0200, Nagy Gabor wrote:
> > > Hi!
> > > Look at line 122-123:
> > > _alpm_log(PM_LOG_ERROR, _("could not find %s in database --
> > > skipping\n"), miss->depend.name);
> > > Probably you want to say miss->target here.
> > > You can treat this mail as a patch, since it is very easy to fix
> > > it (now I'm working on removing pmdepend_t and I don't want to
> > > create a new branch;-)
> >
> > Creating a branch is very easy with git, generating an one line
> > patch too, this can be done in seconds :)
> > It's true that a patch becomes more interesting with bigger
> > changes, but it really doesn't cost anything to make one, and
> > besides it makes Aaron and Dan less angry :d
> 
> Hah, it's not that. It's just the _resistance_ to sending a properly
> formatted patch is silly.
As I wrote in the patch description; that message must be NEVER listed.
There are some parts of libalpm/pacman code which mustn't be reached by
a bug-free libalpm/pacman (like this). Sometimes these code-parts induce
a debug message only. However, I think, they are really good
bug-indicators, so I would prefer something like this:
_alpm_log(PM_LOG_ERROR, _("FATAL internal error occurred. Please report
this to bugs.archlinux.org. Bug-code: %d")).
You may say, that pactests cover all common cases, so I'm a bit
paranoid. This may be true, but we have some unfixed bugs (imho
conflict005.py is the most serious one); and in these cases these type
of error messages can be treated as feedbacks too (in the example above,
pacman should shout if it overwrites a file). What about this idea?
This can be introduced step-by-step.
So, here is the patch:
----------------------
From 9036af619e04339c86c0019101bc2a0622591eed Mon Sep 17 00:00:00 2001
From: Nagy Gabor <ngaba at bibl.u-szeged.hu>
Date: Fri, 26 Oct 2007 16:11:13 +0200
Subject: [PATCH] dependency error message fix in package.c
 Normally you must never see that error message.

---
 lib/libalpm/remove.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 734c365..0ed4dd0 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -120,7 +120,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
 							}
 						} else {
 							_alpm_log(PM_LOG_ERROR, _("could not find %s in database -- skipping\n"),
-							          miss->depend.name);
+							          miss->target);
 						}
 					}
 					FREELIST(lp);
-- 
1.5.3.4





More information about the pacman-dev mailing list