-@@ -739,9 +823,16 @@
- /**
- * Extract Elf dependencies.
- * @param fc file classifier
-+ * @param findprov 1 to enable provides
-+ * @param findreq 1 to enable requires
-+ * @param noautoprov _noautoprov regexps
-+ * @param noautoprov_c # of _noautoprov regexps
-+ * @param noautoreq _noautoreq regexps
-+ * @param noautoreq_c # of _noautoreq regexps
- * @return 0 on success
- */
--static int rpmfcELF(rpmfc fc)
-+static int rpmfcELF(rpmfc fc, int findprov, int findreq,
-+ regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c)
- /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
- /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/
- {
-@@ -844,26 +935,31 @@
- && !(filter_GLIBC_PRIVATE != 0
- && !strcmp(s, "GLIBC_PRIVATE")))
- {
-+ int doauto;
-+
- buf[0] = '\0';
- t = buf;
- t = stpcpy( stpcpy( stpcpy( stpcpy(t, soname), "("), s), ")");
-
-+ doauto = findprov && !rpmfcMatchRegexps(noautoprov, noautoprov_c, buf, 'P');
- #if !defined(__alpha__)
- if (isElf64)
- t = stpcpy(t, "(64bit)");
- #endif
- t++;
-+
-+ if (doauto) {
-+ /* Add to package provides. */
-+ ds = rpmdsSingle(RPMTAG_PROVIDES,
-+ buf, "", RPMSENSE_FIND_PROVIDES);
-+ xx = rpmdsMerge(&fc->provides, ds);
-+
-+ /* Add to file dependencies. */
-+ xx = rpmfcSaveArg(&fc->ddict,
-+ rpmfcFileDep(t, fc->ix, ds));
-
-- /* Add to package provides. */
-- ds = rpmdsSingle(RPMTAG_PROVIDES,
-- buf, "", RPMSENSE_FIND_PROVIDES);
-- xx = rpmdsMerge(&fc->provides, ds);
--
-- /* Add to file dependencies. */
-- xx = rpmfcSaveArg(&fc->ddict,
-- rpmfcFileDep(t, fc->ix, ds));
--
-- ds = rpmdsFree(ds);
-+ ds = rpmdsFree(ds);
-+ }
- }
- auxoffset += aux->vda_next;
- }
-@@ -904,25 +1000,30 @@
- && !(filter_GLIBC_PRIVATE != 0
- && !strcmp(s, "GLIBC_PRIVATE")))
- {
-+ int doauto;
-+
- buf[0] = '\0';
- t = buf;
- t = stpcpy( stpcpy( stpcpy( stpcpy(t, soname), "("), s), ")");
-
-+ 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 @*/