pm

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

commit f1f8bd5a1a8fa4f66843096c09570ea0f52a3951
parent a4da3809f1d5c9ca4a1646bfabab7c121728247f
Author: z3bra <willyatmailoodotorg>
Date:   Wed Jan 13 08:16:35 2016

Action to update installed packs

Diffstat:
 pm.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/pm.c b/pm.c @@ -634,6 +634,9 @@ main (int argc, char **argv) if (argc > 1) n = ARGF(); break; + case 'u': + action = ACTION_UPDATE; + break; case 'v': verbose = 1; break; @@ -651,6 +654,16 @@ main (int argc, char **argv) } break; + case ACTION_UPDATE: + while (*argv) { + if ((p = pack_load(*(argv++)))) { + if (delete(PACK_ROOT, PACK_DATA, p->name) == 0) + r += install(PACK_ROOT, PACK_DATA, p); + pack_free(p); + } + } + break; + case ACTION_DELETE: while (*argv) r += delete(PACK_ROOT, PACK_DATA, *argv++); @@ -661,8 +674,6 @@ main (int argc, char **argv) return ERR_INSPECT; break; - /* handle me, Octave */ - case ACTION_UPDATE: default: usage(argv0); return ERR_INVALID_ACTION;