pm

barely a pack manager
git clone git://z3bra.org/pm
Log | Files | Refs | README | LICENSE

commit f4ccf788a420f7764b4ecfc6288a0622e6777e33
parent 8feb8cec683ac7e4bc9105ad3b8829810c9d8ff7
Author: z3bra <willyatmailoodotorg>
Date:   Tue Jan 12 14:11:25 2016

Return errors in case of failed operations

Diffstat:
 pm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pm.c b/pm.c @@ -589,6 +589,7 @@ pack_free(struct pack *p) int main (int argc, char **argv) { + int r = 0; char *n = NULL; struct pack *p = NULL; uint8_t action = ACTION_INSPECT; @@ -616,7 +617,7 @@ main (int argc, char **argv) case ACTION_INSTALL: while (*argv) { if ((p = pack_load(*(argv++)))) { - install(PACK_ROOT, PACK_DATA, p); + r += install(PACK_ROOT, PACK_DATA, p); pack_free(p); } } @@ -624,7 +625,7 @@ main (int argc, char **argv) case ACTION_DELETE: while (*argv) - delete(PACK_ROOT, PACK_DATA, *argv++); + r += delete(PACK_ROOT, PACK_DATA, *argv++); break; case ACTION_INSPECT: @@ -639,5 +640,5 @@ main (int argc, char **argv) return ERR_INVALID_ACTION; } - return 0; + return r; }