- t++;
-
-- /* Add to package dependencies. */
-- ds = rpmdsSingle(RPMTAG_REQUIRENAME,
-- buf, "", RPMSENSE_FIND_REQUIRES);
-- xx = rpmdsMerge(&fc->requires, ds);
--
-- /* Add to file dependencies. */
-- xx = rpmfcSaveArg(&fc->ddict,
-- rpmfcFileDep(t, fc->ix, ds));
-- ds = rpmdsFree(ds);
-+ if (doauto) {
-+ /* Add to package dependencies. */
-+ ds = rpmdsSingle(RPMTAG_REQUIRENAME,
-+ buf, "", RPMSENSE_FIND_REQUIRES);
-+ xx = rpmdsMerge(&fc->requires, ds);
-+
-+ /* Add to file dependencies. */
-+ xx = rpmfcSaveArg(&fc->ddict,
-+ rpmfcFileDep(t, fc->ix, ds));
-+ ds = rpmdsFree(ds);
-+ }
- }
- auxoffset += aux->vna_next;
- }
-@@ -947,23 +1048,30 @@
- /* Files with executable bit set only. */
- if (fc->skipReq || !(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
- /*@innercontinue@*/ continue;
-+ if (!findreq)
-+ continue;
- /* Add to package requires. */
- depsp = &fc->requires;
- tagN = RPMTAG_REQUIRENAME;
- dsContext = RPMSENSE_FIND_REQUIRES;
- s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
- assert(s != NULL);
-+ if(rpmfcMatchRegexps(noautoreq, noautoreq_c, s, 'R'))
-+ continue;
- /*@switchbreak@*/ break;
- case DT_SONAME:
- gotSONAME = 1;
- /* Add to package provides. */
- if (fc->skipProv)
- /*@innercontinue@*/ continue;
-+ if (!findprov) continue;
- depsp = &fc->provides;
- tagN = RPMTAG_PROVIDENAME;
- dsContext = RPMSENSE_FIND_PROVIDES;
- s = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
- assert(s != NULL);
-+ if(rpmfcMatchRegexps(noautoprov, noautoprov_c, s, 'P'))
-+ continue;
- /*@switchbreak@*/ break;
- }
- if (s == NULL)
-@@ -997,7 +1105,7 @@
- /*@=branchstate =uniondef @*/
-
- /* For DSO's, provide the basename of the file if DT_SONAME not found. */
-- if (!fc->skipProv && isDSO && !gotDEBUG && !gotSONAME) {
-+ if (findprov && !fc->skipProv && isDSO && !gotDEBUG && !gotSONAME) {
- depsp = &fc->provides;
- tagN = RPMTAG_PROVIDENAME;
- dsContext = RPMSENSE_FIND_PROVIDES;
-@@ -1015,6 +1123,8 @@
- t = stpcpy(t, s);
- /*@=nullpass@*/
-
-+ if(!rpmfcMatchRegexps(noautoprov, noautoprov_c, buf, 'P')) {
-+
- #if !defined(__alpha__)
- if (isElf64)
- t = stpcpy(t, "()(64bit)");
-@@ -1032,6 +1142,7 @@
- /*@=boundswrite@*/
-
- ds = rpmdsFree(ds);
-+ }
+- xx = rpmfcHelper(fc, 'R', "pkgconfig");
++ if (fc->findreq)
++ xx = rpmfcHelper(fc, 'R', "pkgconfig", fc->noautoreq, fc->noautoreq_c);
+ } else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_BOURNE) {
+ #ifdef NOTYET
+- xx = rpmfcHelper(fc, 'P', "executable");
++ if (fc->findprov)
++ xx = rpmfcHelper(fc, 'P', "executable", fc->noautoprov, fc->noautoprov_c);
+ #endif
+ if (is_executable)
+- xx = rpmfcHelper(fc, 'R', "executable");
++ if (fc->findreq)
++ xx = rpmfcHelper(fc, 'R', "executable", fc->noautoreq, fc->noautoreq_c);
+ } else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_PHP) {
+- xx = rpmfcHelper(fc, 'P', "php");
++ if (fc->findprov)
++ xx = rpmfcHelper(fc, 'P', "php", fc->noautoprov, fc->noautoprov_c);
+ /* not only executable, files run by httpd usually are not */
+- xx = rpmfcHelper(fc, 'R', "php");
++ if (fc->findreq)
++ xx = rpmfcHelper(fc, 'R', "php", fc->noautoreq, fc->noautoreq_c);
+ } else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_MONO) {
+- xx = rpmfcHelper(fc, 'P', "mono");
++ if (fc->findprov)
++ xx = rpmfcHelper(fc, 'P', "mono", fc->noautoprov, fc->noautoprov_c);
+ if (is_executable)
+- xx = rpmfcHelper(fc, 'R', "mono");
++ if (fc->findreq)
++ xx = rpmfcHelper(fc, 'R', "mono", fc->noautoreq, fc->noautoreq_c);