<p></p>
<blockquote>
<p>The key is not arbitrary "user data", the purpose of the key argument is to allow install callback to locate and open the associated package file and is used and passed around for this very purpose in rpm. There's no counterpart for opening an erasure element because this doesn't seem meaningful.</p>
</blockquote>
<p>From my point of view as a user of the rpm library, the "key" is a pointer to generic user data (arbitrary, a pointer to a void), which I pass to the library and it returns to me in callbacks. I need it to pair the callback with the original transaction element. Specifying an associated package to install is just one reason. I also need to pair during erase surgery. I know purpose for using this argument in rpm. But do all programs have to use this pointer to void by the same way? I think, for rpm library it's just a pointer.</p>
<blockquote>
<p>Any implicitly added erasures (for upgrades and obsoletes) would still not have a key</p>
</blockquote>
<p>Yes. I know. But we have prepared transaction with all elements explicitly added. And we need pair callbacks with these elements.</p>
<blockquote>
<p>I can see a need for carrying "user data" in rpmte, but the key has a very specific meaning in rpm and overloading this to other purposes is not likely to end well.<br>
Thinking about this, I think a more constructive approach would be adding a separate, truly private userdata member to transaction elements and an optional transaction set callback which gets called whenever something changes in the transaction set, which can be used for setting userdata on both explicitly and implicitly added elements (and whatever other purposes, such as easily locate the newly added rpmte element) and doesn't require ugly foo2() functions (or API breakage).</p>
</blockquote>
<p>I'm glad you see the need to transfer "user data". If you add a new better API I will be happy. But until then, at least this small improvement to the old API will help us.<br>
I don't want to break the existing API. So, I was just looking for a way to get a user pointer into erase element in the existing API with minimal code changes and without breaking it. And I introduce new API function.<br>
The name of the new function is ugly ... that is why I wrote note: "better API function name name than rpmtsAddEraseElement2 ?"<br>
Can you suggest a better one?</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/pull/1360#issuecomment-694793202">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZU2FTLMSBXT52GHWGL3SGMZ6FANCNFSM4RRSZ3RQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ADLPZU4BJJUY34ZJCQ4ERBDSGMZ6FA5CNFSM4RRSZ3R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFFU3H4Q.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/1360#issuecomment-694793202",
"url": "https://github.com/rpm-software-management/rpm/pull/1360#issuecomment-694793202",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>