[Rpm-maint] PATCH 4/2013 Reimplement setprogname() and getprogname() to be generic and portable
ffesti at redhat.com
Thu Feb 11 13:51:14 UTC 2016
Looks like this fell through the cracks back then. I can only guess why.
May be everyone was on vacation...
Anyway this topic came up recently and this looks like the proper
solution. Pushed upstream as 61109446ac67ca8f3d96a5592814561db908d83c
with only very minor corrections as followup patches.
Thanks for the patch!
On 08/17/2013 09:36 PM, Kamil Rytarowski wrote:
> I'm attaching a big patch refactoring deeply the current setprogname()
> and getprogname() feature.
> Change-log explains everything:
> 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.
> 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.
> It's important to note that the setprogname()/getprogname() was
> inconstiently implemented in the codebase, duplicating the code and/or
> Add new generic functions getprogname() and setprogname() and bind it to:
> - the current and for two decades stable GNU LIB C implementation,
> - the current NetBSD implementation (introduces to NetBSD in 2002),
> - fallback reimplementation functions of the setprogname() and
> getprogname() functionality for other systems.
> Don't support anymore old GNU Lib C internals and don't support older
> NetBSD systems, as they aren't supported for many years.
> Add to the codebase comments explaining the relevant codeparts.
> PLEASE DOUBLE CHECK the patch and changes.
> The patch was originally prepard against RPM 22.214.171.124 (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.
> 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).
> 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.
> Thank you and regards!
> Rpm-maint mailing list
> Rpm-maint at lists.rpm.org
Red Hat GmbH, http://www.de.redhat.com/ Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Michael Cunningham, Michael
O'Neill, Charles Peters
More information about the Rpm-maint