-+ doauto = findreq && !rpmfcMatchRegexps(noautoreq, noautoreq_c, buf, 'R');
- #if !defined(__alpha__)
- if (isElf64)
- t = stpcpy(t, "(64bit)");
- #endif
- 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);
-+ }