<p>I have some scripts which operate on packages to generate their (build)dependency tree for Fedora Modularity stuff. It relies on normal binary and source RPMs for dependency information. However, with dynamic BuildRequires, I need a way to rebuild sourcerpms with some macros defined. And I found out that there is no way to get src.rpm with dynamic buildrequires without installing them.</p>
<p>So I had to do something like</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff --git a/build/build.c b/build/build.c</span>
index dec7d9608..c1f28b8f5 100644
<span class="pl-md">--- a/build/build.c</span>
<span class="pl-mi1">+++ b/build/build.c</span>
<span class="pl-mdr">@@ -213,10 +213,12 @@</span> static int doBuildRequires(rpmSpec spec, int test)
        *packageDependencies(spec->sourcePackage, RPMTAG_REQUIRENAME),
        spec->sourcePackage->header);
 
<span class="pl-mi1"><span class="pl-mi1">+</span>#if 0</span>
     parseRCPOT(spec, spec->sourcePackage,
               "rpmlib(DynamicBuildRequires) = 4.15.0-1",
               RPMTAG_PROVIDENAME, 0, RPMSENSE_FIND_PROVIDES | RPMSENSE_RPMLIB,
               addReqProvPkg, NULL);
<span class="pl-mi1"><span class="pl-mi1">+</span>#endif</span>
     rc = RPMRC_MISSINGBUILDREQUIRES;
 
  exit:
<span class="pl-mdr">@@ -305,6 +307,8 @@</span> static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
                (rc == RPMRC_MISSINGBUILDREQUIRES))
            rc = doCheckBuildRequires(ts, spec, test);
        if (rc == RPMRC_MISSINGBUILDREQUIRES) {
<span class="pl-mi1"><span class="pl-mi1">+</span>           rc = RPMRC_OK;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#if 0</span>
            if (what & RPMBUILD_DUMPBUILDREQUIRES) {
                /* Create buildreqs package */
                char *nvr = headerGetAsString(spec->packages->header, RPMTAG_NVR);
<span class="pl-mdr">@@ -318,6 +322,7 @@</span> static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
            } else {
                rc = RPMRC_OK;
            }
<span class="pl-mi1"><span class="pl-mi1">+</span>#endif</span>
        } else if (rc) {
            goto exit;
        }</pre></div>
<p>and use <code>rpmbuild -rr -D "_module_build 1" --nodeps /path/to/srpm</code> and it does what I need.</p>
<p>So what I want is to say "I am expert, I know src.rpm will have all dynamic dependencies, just give me src.rpm and not buildreqs.nosrc.rpm.".</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/issues/760?email_source=notifications&email_token=ADLPZU5QOQUEO3J3Y367E4DP3PVUTA5CNFSM4HZ6KBOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2Z6FYA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZUYAMX42V77HBWZUFKTP3PVUTANCNFSM4HZ6KBOA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ADLPZU2A7UHECDG6JFSQSMTP3PVUTA5CNFSM4HZ6KBOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2Z6FYA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/rpm-software-management/rpm/issues/760?email_source=notifications\u0026email_token=ADLPZU5QOQUEO3J3Y367E4DP3PVUTA5CNFSM4HZ6KBOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2Z6FYA",
"url": "https://github.com/rpm-software-management/rpm/issues/760?email_source=notifications\u0026email_token=ADLPZU5QOQUEO3J3Y367E4DP3PVUTA5CNFSM4HZ6KBOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2Z6FYA",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>