<p>rpmdbOpen() and rpmdbAdd() are internal-only for a reason, for example they bypass all sorts of things like transaction lock. However in rpm >= 4.12 there is rpmtsImportHeader() which is essentially rpmdbAdd() wrapped with all the necessary stuff.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/rpm-software-management/rpm/pull/52#issuecomment-174412312">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ANb809_ajwqKf9AK7tXx6xwkg9X0vTk0ks5pdbGfgaJpZM4HKC9D.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/rpm-software-management/rpm/pull/52#issuecomment-174412312"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>