[Rpm-maint] PATCH 4/2013 Reimplement setprogname() and getprogname() to be generic and portable

Kamil Rytarowski n54 at gmx.com
Sat Aug 17 19:36:33 UTC 2013


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 functionality.

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 (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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20130817/28b9244a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Reimplement-setprogname-and-getprogname-to-be-generi.patch
Type: application/octet-stream
Size: 14536 bytes
Desc: Attachment: 0001-Reimplement-setprogname-and-getprogname-to-be-generi.patch
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20130817/28b9244a/attachment-0001.obj>

More information about the Rpm-maint mailing list