<span style='font-family:Verdana'><span style='font-size:12px'>Hello,<div> </div><div>I'm attaching a big patch refactoring deeply the current setprogname() and getprogname() feature.</div><div> </div><div>Change-log explains everything:</div><div><div>The RPM code contains setprogname()/getprogname() support implemented through compatiblity layer with very old GLIBC (internals supported back to '95 and earlier), before stabilization of the GNU C library. This compatiblity layer (__progname, __assert_progname, setprogname()) is supposed to support well archaic GLIBC, but on the other hand it pollutes the library namespace and introduces unpredicable compillation errors on BSD systems.</div><div> </div><div>The functions setprogname() and getprogname() are natively supported in NetBSD and work the same way as __progname from the GNU C library (they are even implemented in the same way - but with a slightly changed logic). The support for very old (20 years and older) GNU C Library is obfuscating the code, because it uses defines over defines without a word of explaination why to do so.</div><div> </div><div>It's important to note that the setprogname()/getprogname() was inconstiently implemented in the codebase, duplicating the code and/or functionality.</div><div> </div><div>Add new generic functions getprogname() and setprogname() and bind it to:</div><div>- the current and for two decades stable GNU LIB C implementation,</div><div>- the current NetBSD implementation (introduces to NetBSD in 2002),</div><div>- fallback reimplementation functions of the setprogname() and getprogname() functionality for other systems.</div><div> </div><div>Don't support anymore old GNU Lib C internals and don't support older NetBSD systems, as they aren't supported for many years.</div><div> </div><div>Add to the codebase comments explaining the relevant codeparts.</div></div><div> </div><div> </div><div> </div><div> </div><div>PLEASE DOUBLE CHECK the patch and changes.</div><div> </div><div>The patch was originally prepard against RPM 4.11.0.1 (as is my working version) and was just matched against the current git repository revision. I want to upstream these changes as soon as possible -- as it will allow me to work with the vanilla source sooner -- for an upstream developer this is very important to work without layer of dozen compatiblity patches around the whole code-base.</div><div> </div><div>As, I'm now away from my working machine, now and I will be away for some time -- I can't currently develop it farther (introducing support of other Unices, it was really tested and made run on NetBSD-6.1).</div><div> </div><div>If you agree with the changes, please commit it as it is. If there are any bugs introduced (like compilation errors) -- please commit it as it is and fix them with a new patch.</div><div> </div><div>Thank you and regards!</div></span></span>