diff --git a/Doxyfile b/Doxyfile index 5344f9a..3b79afb 100644 --- a/Doxyfile +++ b/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = pkgin # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.5 +PROJECT_NUMBER = 0.6 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/actions.c b/actions.c index f09ecd8..90ed7d5 100644 --- a/actions.c +++ b/actions.c @@ -341,7 +341,7 @@ pkgin_install(char **opkgargs, uint8_t do_inst) char *unmet_reqs = NULL; char pkgpath[BUFSIZ], pkgurl[BUFSIZ], query[BUFSIZ]; char h_psize[H_BUF], h_fsize[H_BUF], h_free[H_BUF]; - struct stat st; + struct stat st; /* transform command line globs into pkgnames */ if ((pkgargs = glob_to_pkgarg(opkgargs)) == NULL) { diff --git a/main.c b/main.c index 9289108..31e2414 100644 --- a/main.c +++ b/main.c @@ -234,7 +234,7 @@ main(int argc, char *argv[]) break; case PKG_SRCH_CMD: /* search for package */ missing_param(argc, 2, MSG_MISSING_SRCH); - search_pkg(argv[1]); + rc = search_pkg(argv[1]); break; case PKG_CLEAN_CMD: /* clean pkgin's packages cache */ clean_cache(); diff --git a/pkgin.h b/pkgin.h index 2191b3b..bbe7fe1 100644 --- a/pkgin.h +++ b/pkgin.h @@ -234,7 +234,7 @@ Plisthead *init_head(void); Plistnumbered *rec_pkglist(const char *, ...); int pkg_is_installed(Plisthead *, Pkglist *); void list_pkgs(const char *, int); -void search_pkg(const char *); +int search_pkg(const char *); void show_category(char *); void show_pkg_category(char *); void show_all_categories(void); diff --git a/pkglist.c b/pkglist.c index 6689309..0c2303d 100644 --- a/pkglist.c +++ b/pkglist.c @@ -288,7 +288,7 @@ list_pkgs(const char *pkgquery, int lstype) free(plisthead); } -void +int search_pkg(const char *pattern) { Pkglist *plist; @@ -336,9 +336,12 @@ search_pkg(const char *pattern) if (matched_pkgs == 1) printf(MSG_IS_INSTALLED_CODE); - else + else { printf(MSG_NO_SEARCH_RESULTS, pattern); + return(EXIT_FAILURE); + } } + return(EXIT_SUCCESS); } void @@ -348,7 +351,7 @@ show_category(char *category) SLIST_FOREACH(plist, &r_plisthead, next) { if (strcmp(plist->category, category) == 0) - printf("%-20s %s\n", plist->full, plist->comment); + printf("%-20s %s\n", plist->full, plist->comment); } }