repo

List, download and sync packs with remote repositories
Log | Files | Refs

commit 523e7584df1482ff45876c584df693848f03516d
parent a3970bdfaa5cd9b7300827205f9875fc29ec736b
Author: z3bra <contactatz3bradotorg>
Date:   Thu Dec 15 17:31:50 +0100

Remove function local_list()

Diffstat:
repo.c | 28+++++++++++-----------------
1 file changed, 11 insertions(+), 17 deletions(-)
diff --git a/repo.c b/repo.c @@ -33,7 +33,6 @@ void usage(char *); struct pack *pack_load(char *); struct repo *add_repo(struct repos *, char *); int local_load(struct packs *, char *); -int local_list(char *); int remote_sync(char *, FILE *); void @@ -122,18 +121,6 @@ local_load(struct packs *plist, char *local) } int -local_list(char *local) -{ - struct packs plist; - struct pack *p = NULL; - local_load(&plist, local); - TAILQ_FOREACH(p, &plist, entries) { - printf("%s\t%s\n", p->name, p->version); - } - return 0; -} - -int remote_sync(char *url, FILE *fd) { ssize_t len; @@ -175,7 +162,7 @@ remote_sync(char *url, FILE *fd) int main (int argc, char *argv[]) { - int sflag = 0; + int sflag = 0, lflag = 0; char *argv0, *n; char fn[PATH_MAX], url[PATH_MAX]; FILE *fd; @@ -192,9 +179,8 @@ main (int argc, char *argv[]) sflag = 1; break; case 'l': - local_list(LOCALREPO); - return 0; - break; /* NOREACHED */ + lflag = 1; + break; default: usage(argv0); }ARGEND; @@ -218,6 +204,14 @@ main (int argc, char *argv[]) } local_load(&plist, LOCALREPO); + + if (lflag) { + TAILQ_FOREACH(p, &plist, entries) { + printf("%s\t%s\n", p->name, p->version); + } + return 0; + } + while ((n = *(argv++))) { TAILQ_FOREACH(p, &plist, entries) { if (!strncmp(p->name, n, PATH_MAX)) {