<p>Rpm used to rely on the "replacepkgs hack" to get rid of the old<br>
header entry when reinstalling a package. This has a number of<br>
problems when the headers are not identical or different<br>
install flags were used.</p>
<p>To mitigate this, a '--reinstall' option was added that made rpm<br>
use an erase element in this case.</p>
<p>This commit takes this one step further by changing the code to also<br>
use an erase element in the --upgrade case. The code is mostly simpler,<br>
but we need a different implementation for commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rpm-software-management/rpm/commit/fd40d58efa0fbff535f273e5ae5c200d43d28aef/hovercard" href="https://github.com/rpm-software-management/rpm/commit/fd40d58efa0fbff535f273e5ae5c200d43d28aef"><tt>fd40d58</tt></a>, as we now<br>
have erase elements both for --reinstall and --upgrade. Thus we<br>
need to store the addop in the transaction element.</p>
<p>The commit does not change the behaviour of 'rpm --install'.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/rpm-software-management/rpm/pull/770'>https://github.com/rpm-software-management/rpm/pull/770</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Use an erase element to delete packages with same NEVRA</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/770/files#diff-0">lib/depends.c</a>
    (38)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/770/files#diff-1">lib/rpmte.c</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/770/files#diff-2">lib/rpmte_internal.h</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/770/files#diff-3">lib/transaction.c</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/rpm-software-management/rpm/pull/770/files#diff-4">lib/verify.c</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/rpm-software-management/rpm/pull/770.patch'>https://github.com/rpm-software-management/rpm/pull/770.patch</a></li>
  <li><a href='https://github.com/rpm-software-management/rpm/pull/770.diff'>https://github.com/rpm-software-management/rpm/pull/770.diff</a></li>
</ul>

<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/pull/770?email_source=notifications&email_token=ADLPZUYH7AYGNUXZQWLXG4TP4NYYRA5CNFSM4H3SRXD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G32DZ3Q">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZUZKJBKAJBC73XOTZXDP4NYYRANCNFSM4H3SRXDQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ADLPZU36MAFEHVT43KIJXADP4NYYRA5CNFSM4H3SRXD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G32DZ3Q.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/pull/770?email_source=notifications\u0026email_token=ADLPZUYH7AYGNUXZQWLXG4TP4NYYRA5CNFSM4H3SRXD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G32DZ3Q",
"url": "https://github.com/rpm-software-management/rpm/pull/770?email_source=notifications\u0026email_token=ADLPZUYH7AYGNUXZQWLXG4TP4NYYRA5CNFSM4H3SRXD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G32DZ3Q",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>