[pacman-dev] [PATCH] pacman: better warning message when skipping duplicate targets

Andrew Gregory andrew.gregory.8 at gmail.com
Tue Dec 11 19:51:15 UTC 2018


On 12/11/18 at 06:14pm, Michael Straube wrote:
> Am 09.12.18 um 19:47 schrieb Andrew Gregory:
> > On 12/09/18 at 06:31pm, Michael Straube wrote:
> > > Change the warning message to reflect the reason when skipping duplicate
> > > targets. skipping target -> skipping duplicate target
> > > 
> > > FS#49377
> > > 
> > > Signed-off-by: Michael Straube <michael.straube at posteo.de>
> > > ---
> > >   src/pacman/remove.c | 2 +-
> > >   src/pacman/sync.c   | 2 +-
> > >   2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > Should we just remove the error altogether and move the message to
> > DEBUG?  The user doesn't need to do anything in response to it and
> > I can't think of any reason a front-end would want to actually die
> > from it.  It seems to just be useless line noise that requires
> > front-ends to check for it specifically just to ignore it.
> > 
> 
> Sounds reasonable. On the other hand I can imagine that some people
> would complain that too much from what's going on is hidden from the
> user. What do others think?
> 
> 
> P.S.: You mean?
> pm_printf(ALPM_LOG_DEBUG, _("skipping duplicate target: %s\n"), target);

I realized after sending this that adding a duplicate could actually
be an error if they are two separate packages with the same name.  So,
I'm going to say to add a check in add_pkg for whether the duplicate
is actually the same package (simple pointer cmp) and, if they are the
same, log a debug message and return success, if they are different
return the error as we do now.  process_pkg in pacman should then
treat that error just like any other instead of printing a warning and
continuing on.  alpm_remove_pkg should just log the debug message and
return success.

apg


More information about the pacman-dev mailing list