sync.c : duplicate the target before modifying it
commitf4809dcc9c27ac614e2a3381d4ecd8661beec8de
authorXavier Chantry <shiningxc@gmail.com>
Tue, 15 Sep 2009 14:07:25 +0000 (15 16:07 +0200)
committerDan McGee <dan@archlinux.org>
Sun, 20 Sep 2009 16:56:46 +0000 (20 11:56 -0500)
treed680c5144e14ec021523d7d9e58edb1b4cc78420
parent95cb4b6874424c7109df0f8cebefc17d3756d65f
sync.c : duplicate the target before modifying it

It was probably a bad idea to modify the target directly in case of
repo/pkg syntax.

Duplicating it also allows us to keep the original target string, which
is more informative when printing errors.

Also remove a duplicated error message from libalpm, and improve the
message already returned to the frontend.

$ pacman -S foo/bar

before
error: repository 'foo' not found
error: 'bar': no such repository

after
error: 'foo/bar': could not find repository for target

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
lib/libalpm/error.c
lib/libalpm/sync.c
src/pacman/sync.c