diff options
author | Dan McGee <dan@archlinux.org> | 2007-05-31 01:12:17 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-05-31 01:12:17 -0400 |
commit | 722db4535ae6690d8834ffebf3a0de3a880188f9 (patch) | |
tree | c58d84cc25232eba713bcc22f3a678d1e76a20e9 /src/pacman/sync.c | |
parent | cad44221c811af0c528589bd087531f8ece6257e (diff) |
Set an error exit status on -Qi or -Si failure
Regression from 2.9.8 where a failed -Qi lookup did not return an error
on exit. The exit status is now incremented for each error encountered.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/sync.c')
-rw-r--r-- | src/pacman/sync.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 4f11bb4c..f013d45f 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -325,6 +325,7 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets) static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) { alpm_list_t *i, *j, *k; + int ret = 0; if(targets) { for(i = targets; i; i = alpm_list_next(i)) { @@ -367,6 +368,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) if(!foundpkg) { fprintf(stderr, _("error: package '%s' was not found in repository '%s'\n"), pkgstr, repo); + ret++; } } else { pkgstr = target; @@ -387,6 +389,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) } if(!foundpkg) { fprintf(stderr, _("error: package '%s' was not found\n"), pkgstr); + ret++; } } } @@ -401,7 +404,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) } } - return(0); + return(ret); } static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) |