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.
- Grab the uncompressed payload size from header and compare number
of bytes copied to that for exit code. Previously, truncated
payloads could have returned with success. This also fixes the
exit code for large payloads (RhBug:790396)
- "lzma alone" is superseeded by XZ but it's used by Suse and Mandriva
distros so it's nice to have as it doesn't need much, only open differs
from XZ
- rpmlib() dependency versions are an uuuuuuuugly mess here: Suse used
"PayloadIsLzma = 4.4.2-1" so that's what we provide to be most compatible
(hopefully). Built packages require "PayloadIsLzma <= 4.4.6-1" however
to be compatible with Mandriva 2008.0. Did I already say it's ugly?
- Based on similar patch in Mandriva by Per Øyvind Karlsen, but avoiding
unnecessary renames in rpmio
- what we support now in payloads is XZ, not the former LZMA format, rename
user- and header-visible parts to match this
- rpmlib(PayloadIsXz) dependency versioned 5.2-1 to avoid unnecessary
incompatibility with what rpm5 has and what Mandriva is already using
- only provide the rpmlib dependency if actually built with xz support
- rpmFileIsCompressed() attempts to guess the magicless old lzma format
by file suffix, so it can handle both right now
lib/rpmio.c: Add fd{Get,Set}{Io,Fp,Fdno} abstraction wrappers.
lib/rpmio.c: Start rationalizing debug output by using fdbg to display the
fd layer stack.
rpm.c: Add --nolibio to disable libio if desired.
rpm2cpio.c: Use Fdopen(..., gzdio) and ufdCopy().
build/build.c: Use Fdopen(..., fpio) rather than fdio.
build/files.c: Use Fdopen(..., fpio) rather than ufdio.
build/parseSpec.c: ditto.
lib/macro.c: ditto.
lib/rpmrc.c: ditto
lib/macro.c: Use Fopen(..., ufdio) in isCompressed() rather that fdOpen().
lib/misc.c: ditto.
lib/misc.c: Avoid fstat by using Stat.
build/pack.c: Add persist fdLink() and use fdFree() in package{Sources,Binaries}
build/pack.c: Try to remove the fdDup before cpioBuildArchive() call.
build/pack.c: Use rpmGenPath with %{_builddir}.
build/parsePreamble.c: Use fdSize rather than Stat to get icon file size.
lib/rpmrc.c: ditto
lib/ftp.c: start capturing ufdio layer syserrno/errcookie.
CVS patchset: 3424
CVS date: 1999/11/14 19:15:18
Use Fstrerror to retrieve fd->syserrno.
Make ftpFileDoneNeeded per-fd rather than per-url.
Make data fd unique rather than per-url.
Use appropriate protocol commands for ufdio writing.
CVS patchset: 3421
CVS date: 1999/11/10 22:09:49
Rip out --enable-bzip2-payload, we'll use Fopen w macros instead.
Work out ref counting for ftpControl so that control channel is persistent.
build/build.c: Use fpio to write build stage script.
parseSpec.c: Rework include stack to use FD_t, not FILE *.
tread.c: Delete, use ufdio->read instead.
rpmio.c: Filter out fdio fd == NULL assertion failures.
rpmrc.c: Don't fail if HOME is not environment.
rpmrc.c: Rework ufdio FTP rcfile I/O to be more similar to stdio.
CVS patchset: 3417
CVS date: 1999/11/04 21:26:08
Make ufdClose() static, use Fclose() with ufdio cookie throughout.
rpm.c: Clean urlinfoCache and rpmBuildArgs leaks.
url.c: urlIsURL() should be here, not in rpmio.c.
url.c: Preserve FD_t abstraction by creating ufdGetUrlinfo().
url.c: Create freeUrlinfoCache().
rpmio.c: Create ufdio cookie.
CVS patchset: 3407
CVS date: 1999/10/30 16:43:29