struct zpm *zpmdb;
glob_t repos;
int matchallpkgfile;
+ int verbose;
};
char *pathcat(char *dir, char *path) {
return NULL;
}
- pkgid = zpm_findpkg(&pkgfile, pkgstr, "hash is not null");
+ pkgid = zpm_findpkg(&pkgfile, pkgstr, NULL);
zpm_close(&pkgfile);
return pkgid;
return NULL;
}
- pkgid = zpm_findlib(&pkgfile, soname, "hash is not null");
+ pkgid = zpm_findlib(&pkgfile, soname, NULL);
if (pkgfile.error) {
fprintf(stderr, "sql error: %s\n", pkgfile.errmsg);
}
if (opt->localdb) {
installed = zpm_findlib(opt->zpmdb, soname, "status = 'installed'");
if (installed) {
+ if (opt->verbose > 1) {
+ fprintf(stderr, "library %s installed via %s\n", soname, installed);
+ }
/* we're done, the lib is installed */
return 2;
}
}
for (i = 0; i < opt->repos.gl_pathc; i++) {
+ if (opt->verbose > 1) {
+ fprintf(stderr, "checking %s for %s\n", opt->repos.gl_pathv[i], soname);
+ }
found = checkfileforlib(soname, opt->repos.gl_pathv[i]);
if (found) {
+ if (opt->verbose > 1) {
+ fprintf(stderr, "found %s\n", found);
+ }
rv = zpm_vercmp(found, latest);
if (rv == 1) {
latest = found;
free(pkgfile);
pkgfile = strdup(opt->repos.gl_pathv[i]);
}
+ } else if (opt->verbose > 1) {
+ fprintf(stderr, "not found\n");
}
}
int found;
struct pkgloc pkginfo;
+ if (opts->verbose > 1) {
+ fprintf(stderr, "checking for %s\n", soname);
+ }
/* if it's in checked_libs, we've already looked at this one */
if (jsw_afind(checked_libs, soname)) {
+ if (opts->verbose > 1) {
+ fprintf(stderr, "already checked for %s\n", soname);
+ }
continue;
}
*/
int output = 1;
- while ((option = getopt(ac, av, "ljqPRDp:r:d:M")) != -1) {
+ while ((option = getopt(ac, av, "ljqPRDvp:r:d:M")) != -1) {
switch (option) {
case 'l': findlibs = 1; break;
case 'j': json = 1; break;
case 'R': opt.repodir = 0; break;
case 'D': opt.localdb = 0; break;
case 'M': opt.matchallpkgfile = 1; break;
+ case 'v': opt.verbose++; break;
default:
exit(EXIT_FAILURE);
break;
return 3;
}
+ if (opt.verbose > 1) {
+ unsigned int i;
+ fprintf(stderr, "globs:");
+ for (i = 0; i < opt.repos.gl_pathc; i++) {
+ fprintf(stderr, " %s", opt.repos.gl_pathv[i]);
+ }
+ fprintf(stderr, "\n");
+ }
+
packages = jsw_hnew(ac,NULL,(cmp_f)strcmp,(keydup_f)strdup,
(itemdup_f)strdup,free,free);
check = jsw_hnew(ac,NULL,(cmp_f)strcmp,(keydup_f)strdup,