Panu Matilainen [Tue, 5 Jan 2010 10:14:37 +0000 (12:14 +0200)]
Move sys/mman.h include out of system.h to the places that care
- just two places where needed, dont pollute system.h needlessly
- include depending on HAVE_MMAP instead of separately checking for
sys/mman.h, if sys/mman.h doesn't exist or is broken HAVE_MMAP wont be set
Panu Matilainen [Tue, 5 Jan 2010 09:52:56 +0000 (11:52 +0200)]
Move libacl.h include out of system.h to the only place that cares
Panu Matilainen [Tue, 5 Jan 2010 09:45:28 +0000 (11:45 +0200)]
Eliminate SEEK_FOO and [RWXF]_OK definitions from system.h
- systems not defining these constants are broken beyond our caring
Panu Matilainen [Tue, 5 Jan 2010 09:33:51 +0000 (11:33 +0200)]
Remove unnecessary and broken time.h related configure + system.h checks
- the AC_HEADER_TIME check is unnecessary for any remotely recent systems,
and the HAVE_SYS_TIME_H conditional in system.h is just broken as we
dont even check for <sys/time.h> header in configure
- dont include from system.h, the time.h and sys/time.h get already
included through our public headers where necessary
Panu Matilainen [Tue, 5 Jan 2010 09:26:14 +0000 (11:26 +0200)]
Unconditionally include <netdb.h> where needed instead of system.h
- there's no fallback for missing netdb.h so there's little point
conditionalizing it
- avoid yet more system.h pollution
Panu Matilainen [Tue, 5 Jan 2010 08:56:56 +0000 (10:56 +0200)]
Remove pointless & unused configure checks
- vprintf(), vsnprintf() and snprintf() are in C99, no point checking
especially as we dont have fallbacks for them
- no point testing for inline capability as we dont try to work around
Panu Matilainen [Tue, 5 Jan 2010 08:45:23 +0000 (10:45 +0200)]
Sanitize signature checking formatResult() a bit
- whole lotta unnecessary wankery here (what have I been thinking)
- avoid using the non-standard strndup(), we checked for it in configure
but didn't provide an alternative so checking was just bogus
Panu Matilainen [Tue, 5 Jan 2010 08:19:52 +0000 (10:19 +0200)]
Oops, ftok() is really optional
Panu Matilainen [Mon, 4 Jan 2010 15:15:26 +0000 (17:15 +0200)]
Clean up poll() vs select() tests
- move the includes out of system.h, not commonly needed
- <poll.h> is conditional as we actually provide a fallback through select(),
but for <sys/select.h> missing there's no fallback so doesn't make
much sense to test for (and both poll.h and sys/select.h are posix anyway...)
Panu Matilainen [Mon, 4 Jan 2010 14:59:39 +0000 (16:59 +0200)]
Remove unused header checks from configure
- maybe these have been used at some point but not anymore...
Panu Matilainen [Mon, 4 Jan 2010 14:31:10 +0000 (16:31 +0200)]
Eliminate unused id -u tests
- this was used by _fixowner and _fixgroup macros back in the day but they
no longer exist as they're unusable without building as root
Panu Matilainen [Mon, 4 Jan 2010 14:22:56 +0000 (16:22 +0200)]
Use MAP_FAILED instead of hardwired (void *)-1
Panu Matilainen [Mon, 4 Jan 2010 14:20:11 +0000 (16:20 +0200)]
Re-enable mmap test in configure & fix the code build again
- this stuff has been disabled for years, lets see what breaks...
Panu Matilainen [Mon, 4 Jan 2010 14:10:44 +0000 (16:10 +0200)]
Remove unnecessary stdint check from configure
- a leftover from pre-C99 requirement times
Panu Matilainen [Mon, 4 Jan 2010 14:07:11 +0000 (16:07 +0200)]
Remove S_IFSOCK and S_IFLNK kludgery for ancient unixes
- these are specified by POSIX 2001, it's not really rpm's job to
provide them if the system doesn't
Panu Matilainen [Mon, 4 Jan 2010 13:58:55 +0000 (15:58 +0200)]
Require lchown() and remove ancient broken chown kludgery
- lchown() is POSIX 2001, we dont care about older / nonconformant stuff
Panu Matilainen [Mon, 4 Jan 2010 12:58:51 +0000 (14:58 +0200)]
Check for our POSIX 2001 requirements and abort if not found
Panu Matilainen [Mon, 4 Jan 2010 12:44:26 +0000 (14:44 +0200)]
Lose the hysterical fakefork hack
- we're not particularly interested in AmigaOS quirks from 1996
Panu Matilainen [Mon, 4 Jan 2010 13:27:05 +0000 (15:27 +0200)]
Remove further replacement functions for POSIX 2001 required bits
- getwd(), getcwd(), basename() and realpath() are all POSIX 2001
defined, we dont care about older stuff
Panu Matilainen [Mon, 4 Jan 2010 12:21:42 +0000 (14:21 +0200)]
Remove unnecessary setenv() replacement function
- setenv() and unsetenv() are required by POSIX 2001, we dont care about
older systems
Panu Matilainen [Mon, 4 Jan 2010 12:15:20 +0000 (14:15 +0200)]
Remove largely unnecessary putenv() replacement
- only the lua posix extension "uses" this by providing putenv()
to Lua, make it conditional and return error if not supported by
the underlying operating system
Panu Matilainen [Mon, 4 Jan 2010 11:46:43 +0000 (13:46 +0200)]
Eliminate myrealloc() replacement function
- realloc(NULL, size) is defined as equal to malloc(size) in C99 and
POSIX 2001, we dont care about anything older than that
Panu Matilainen [Mon, 4 Jan 2010 11:34:39 +0000 (13:34 +0200)]
Remove unneeded strdup() replacement in misc/
- rpmio's own version is always there and portable, this is not needed
Panu Matilainen [Mon, 4 Jan 2010 11:30:14 +0000 (13:30 +0200)]
Use rpm's own strdup() clone everywhere
Panu Matilainen [Mon, 4 Jan 2010 10:20:09 +0000 (12:20 +0200)]
Always free locally defined macros when they go out of scope
- Prior to this, local defines in constructs like %{!?foo: %define foo bar}
would remain defined until a parametrized macro gets called, causing
obscure and confusing errors in specs such as RhBug:551971 and countless
others. Use of %global is now always required for such constructs.
Panu Matilainen [Mon, 4 Jan 2010 08:52:22 +0000 (10:52 +0200)]
Remove -98 vintage ifdef'ed dead code
Panu Matilainen [Mon, 4 Jan 2010 07:12:19 +0000 (09:12 +0200)]
error.c was getting translated too, duh
- should've been in commit
5741334a857a783b033c647223f206a7ca43cef3
Panu Matilainen [Wed, 23 Dec 2009 13:02:00 +0000 (15:02 +0200)]
Oops, update stubs.c too for the removed replacements
Panu Matilainen [Wed, 23 Dec 2009 12:52:49 +0000 (14:52 +0200)]
Remove replacements for C99 mandated functions
- rpm requires C99 compiler anyway, no point in carrying these around
Panu Matilainen [Wed, 23 Dec 2009 12:36:36 +0000 (14:36 +0200)]
Remove unneeded replacement error/warn functions
Panu Matilainen [Wed, 23 Dec 2009 12:19:54 +0000 (14:19 +0200)]
Include <utime.h> where needed instead of system.h
- include unconditionally as we dont try to deal with utime() missing
Panu Matilainen [Wed, 23 Dec 2009 12:14:35 +0000 (14:14 +0200)]
Move major, minor + makedev portability stuff out of system.h, simplify
- only cpio.c needs, move it there
- if none of the standard headers define these, its not our headache anymore
Panu Matilainen [Wed, 23 Dec 2009 12:02:19 +0000 (14:02 +0200)]
Move getopt() portability fiddles out of system.h
- only macro.c needs, no point polluting includes everywhere
Panu Matilainen [Wed, 23 Dec 2009 11:40:10 +0000 (13:40 +0200)]
Dont include <pwd.h> from system.h, dont bother checking for it either
- no much point conditionalizing something we can't live without
- just three places need, no point polluting include space everywhere
Panu Matilainen [Wed, 23 Dec 2009 11:36:29 +0000 (13:36 +0200)]
Dont bother including <sys/socket.h>, we dont use anything from there
Panu Matilainen [Wed, 23 Dec 2009 11:32:53 +0000 (13:32 +0200)]
Dont bother including <err.h>, we dont use anything from there
Panu Matilainen [Wed, 23 Dec 2009 11:31:57 +0000 (13:31 +0200)]
Only rpmrc.c cares about utsname.h, move out of system.h
Panu Matilainen [Wed, 23 Dec 2009 11:15:59 +0000 (13:15 +0200)]
Dont include grp.h from system.h, dont bother checking in configure either
- no much point conditionalizing something we can't live without
- just two places need, no point polluting include space everywhere
Panu Matilainen [Wed, 23 Dec 2009 10:58:17 +0000 (12:58 +0200)]
Dont bother checking and including a header we dont use or need
Panu Matilainen [Wed, 23 Dec 2009 10:55:45 +0000 (12:55 +0200)]
Move malloc portability tweaks out of system.h
- only rpmmalloc.c needs, no need to pollute system.h
Panu Matilainen [Wed, 23 Dec 2009 10:47:59 +0000 (12:47 +0200)]
We dont use memchr() anywhere
Panu Matilainen [Wed, 23 Dec 2009 10:41:38 +0000 (12:41 +0200)]
Move getpass() portability tweaks out of system.h
- only signature.c needs, no need to pollute system.h
Panu Matilainen [Wed, 23 Dec 2009 10:37:37 +0000 (12:37 +0200)]
Dont bother checking for a header we dont use
Panu Matilainen [Wed, 23 Dec 2009 10:25:32 +0000 (12:25 +0200)]
Dont bother checking for functions we dont use
- some of this stuff was used in 4.4.x but not anymore
- additionally we dont even use getdomainnname(), check for gethostname()
instead
Panu Matilainen [Wed, 23 Dec 2009 09:40:55 +0000 (11:40 +0200)]
Use AC_PROG_MKDIR_P for testing mkdir -p capability
- for rpmbuild's purposes MKDIR_P doesn't cut it though, we need to
point it to something that exists on an installed system
Panu Matilainen [Tue, 22 Dec 2009 13:32:17 +0000 (15:32 +0200)]
Use %{__mkdir_p} macro in build instead of hardwired RPM_MKDIR_P
Panu Matilainen [Tue, 22 Dec 2009 12:55:54 +0000 (14:55 +0200)]
Remove unused h_errno test from configure.ac
Panu Matilainen [Tue, 22 Dec 2009 12:36:35 +0000 (14:36 +0200)]
Kill off last remaining uses of _constfree()
- practially all the data in rpmfi needs to be treated as const, these
are just a funky special case which point to header memory for the
couple of cases where KEEPHEADER is still used
Panu Matilainen [Tue, 22 Dec 2009 11:25:48 +0000 (13:25 +0200)]
Make header struct really opaque outside header.c
- the low-level stuff in signature.c and package.c need entryInfo_s
and indexEntry_s but not the header itself
- also move the other defines which have no use outside header.c there
Panu Matilainen [Tue, 22 Dec 2009 11:11:00 +0000 (13:11 +0200)]
Remove redundant NULL-check
Panu Matilainen [Tue, 22 Dec 2009 11:01:36 +0000 (13:01 +0200)]
Eliminate unnecessary url parsing from rpmtsRootDir()
- url's in transaction root hasn't been permitted since rpm 4.6.0 days
Panu Matilainen [Tue, 22 Dec 2009 10:34:19 +0000 (12:34 +0200)]
Lose the now empty header_internal.c source
Panu Matilainen [Tue, 22 Dec 2009 10:33:16 +0000 (12:33 +0200)]
Move htonll() into header.c and make static, not needed elsewhere
Panu Matilainen [Tue, 22 Dec 2009 10:30:45 +0000 (12:30 +0200)]
Move the legacy compatibility goo into legacy.c
- no functional changes
- headerGetRawEntry() hasn't had a public prototype since rpm 4.0 days
but there are some 3rd party users still (sigh), leave it alone as
exposing the proto now would only cause *more* trouble to the external
users
Panu Matilainen [Tue, 22 Dec 2009 10:11:42 +0000 (12:11 +0200)]
Move the higher level convenience functions out of header.c
- header.c is big enough as it is, and none of these things needs
header struct internals for anything
- no functional changes, just moving stuff around
Panu Matilainen [Tue, 22 Dec 2009 10:07:12 +0000 (12:07 +0200)]
Rename hdrNVR.c to more obvious and generic headerutil.c
- no functional changes
- remove it from translation list, there's nothing here to translate...
Panu Matilainen [Mon, 21 Dec 2009 13:01:27 +0000 (15:01 +0200)]
Work on tsortinfo instead of ts elements when ordering everywhere
- ...except addRelation() which still needs rpmteTSI() for grabbing
tsort info from elements in rpmal
Panu Matilainen [Mon, 21 Dec 2009 12:13:35 +0000 (14:13 +0200)]
Work on tsortInfo nodes directly when detecting SCC's
- pass the local order info struct to detectSCC() and work on that
instead of ping-ponging to the TSI's through transaction elements
Panu Matilainen [Mon, 21 Dec 2009 10:59:38 +0000 (12:59 +0200)]
Record relations to tsortInfos instead of transaction elements
Panu Matilainen [Mon, 21 Dec 2009 10:30:04 +0000 (12:30 +0200)]
Save pointer to ts element in the tsort info struct
Panu Matilainen [Mon, 21 Dec 2009 10:18:22 +0000 (12:18 +0200)]
Avoid a bunch of redundant rpmteTSI() calls
Panu Matilainen [Mon, 21 Dec 2009 10:12:29 +0000 (12:12 +0200)]
Eliminate unnecessary depth member from tsortinfo
- its only used for debug log formatting and we can calculate it from
the number of parents in the debug case
Panu Matilainen [Mon, 21 Dec 2009 08:41:03 +0000 (10:41 +0200)]
Eliminate unnecessary npreds member from tsort info
- this is the same as tsi_count
Panu Matilainen [Mon, 21 Dec 2009 08:37:48 +0000 (10:37 +0200)]
Eliminate unused tree index and degree from ordering calculations
Panu Matilainen [Mon, 21 Dec 2009 06:17:05 +0000 (08:17 +0200)]
Avoid a few unnecessary rpmteTSI() calls in addRelation()
Panu Matilainen [Fri, 18 Dec 2009 13:28:36 +0000 (15:28 +0200)]
Remove unused ordering related members from rpmts struct
Panu Matilainen [Mon, 21 Dec 2009 07:20:09 +0000 (09:20 +0200)]
Bury ordering structures and their alloc+free inside order.c
- nothing outside order.c needs this stuff, TSI alloc+free routines
have no business being exported
- for now we need to store a pointer to tsortInfo in the elements,
its just an opaque pointer for ping-ponging the data through ts elements
- all allocation + freeing is local to ordering code
Panu Matilainen [Fri, 18 Dec 2009 10:20:05 +0000 (12:20 +0200)]
Eliminate the rpmte tsort info manipulation public API
- its not useful outside the ordering internals and API users have no
business messing with it
Panu Matilainen [Fri, 18 Dec 2009 10:16:25 +0000 (12:16 +0200)]
Convert rpmtsOrder() to manipulate the tsort data from tsortInfo directly
Panu Matilainen [Fri, 18 Dec 2009 10:12:44 +0000 (12:12 +0200)]
Convert addRelation() to manipulate the tsort data from tsortInfo directly
Panu Matilainen [Fri, 18 Dec 2009 10:10:01 +0000 (12:10 +0200)]
Convert collectTE() to manipulate the tsort data from tsortInfo directly
Panu Matilainen [Fri, 18 Dec 2009 10:05:30 +0000 (12:05 +0200)]
Avoid some unnecessary rpmteTSI() calls in collectTE()
- we have q's TSI in local variable already, use it
- also rename tsi -> q_tsi so it's obvious which one we're manipulating
Panu Matilainen [Fri, 18 Dec 2009 09:56:04 +0000 (11:56 +0200)]
Move tsort data out of rpmte into, duh, tsortInfo
Panu Matilainen [Fri, 18 Dec 2009 07:04:57 +0000 (09:04 +0200)]
Move transaction element iterator into rpmts.c where it logically belongs
- make rpmtsi_s really opaque, move rpmtsi typedef to rpmtypes.h
along with all the other commonly used types
Panu Matilainen [Thu, 17 Dec 2009 15:33:05 +0000 (17:33 +0200)]
Eliminate unused and unnecessary rpmteBreadth() and rpmteSetBreadth()
Panu Matilainen [Thu, 17 Dec 2009 15:28:37 +0000 (17:28 +0200)]
Eliminate unnecessary rpmtsiOc()
- it used to be called from ordering code but now there's precisely
one caller which used it as a fancy way to do increment an integer... rip
Panu Matilainen [Thu, 17 Dec 2009 14:47:12 +0000 (16:47 +0200)]
Eliminate unused + unnecessary transaction element iterator mode
Panu Matilainen [Thu, 17 Dec 2009 14:17:45 +0000 (16:17 +0200)]
Eliminate unnecessary ts ping-pong inside rpmte
- rpmteNew() and the stuff it calls doesn't need the transaction set
for anything since a long time
- document ts argument to be unused
Panu Matilainen [Thu, 17 Dec 2009 14:10:37 +0000 (16:10 +0200)]
Fix ts element package file size on large packages
- RPMTAG_SIGSIZE is limited to 4GB, grab RPMTAG_LONGSIGSIZE through
headerGetNumber() grabs the correct tag automatically and simplifies
the code a bit
Panu Matilainen [Thu, 17 Dec 2009 13:51:58 +0000 (15:51 +0200)]
Eliminate now unnecessary rpmteFd()
- ...which should've never been exported in the first place
Panu Matilainen [Thu, 17 Dec 2009 13:50:09 +0000 (15:50 +0200)]
Move payload open into rpmte (internal) method
- the transaction element has all the necessary info to do this,
having it in psm just requires exposing otherwise unnecessary methods
Panu Matilainen [Thu, 17 Dec 2009 09:35:11 +0000 (11:35 +0200)]
Hardwire lead major version to 3 (RhBug:546663)
- besides the logic being backwards wrt intended --nodirtokens linkage,
LSB wants this to be 3 and .. it just makes no difference whatsover
anyway
Ville Skyttä [Wed, 16 Dec 2009 21:14:04 +0000 (23:14 +0200)]
Use grep -E and grep -F instead of egrep and fgrep.
egrep and fgrep are deprecated in GNU grep and "historical" in POSIX.
Panu Matilainen [Thu, 17 Dec 2009 08:38:08 +0000 (10:38 +0200)]
Move python ts element key refcounting back to C-side of things
- it's really the C-side that needs this, doing it in C avoids nasty
surprises when subclassing rpm.ts
- partial revert of commit
92d18d1d7139b37065ea742cfe0e8cee5e9c3500
Panu Matilainen [Thu, 17 Dec 2009 06:43:31 +0000 (08:43 +0200)]
Permit unexpanded macros to slip through spec tag sanity checks (RhBug:547997)
- For now, let %{} characters through our valid character set checks
on specs. This isn't right really, but unexpanded, unrelated macros
in spec can now cause failure to parse out buildrequires which would
allow those macros to be expanded. This needs a better fix.
Panu Matilainen [Wed, 16 Dec 2009 08:30:17 +0000 (10:30 +0200)]
Avoid mucking with fsm->rdbuf in fsmRmdirs() and fsmMkdirs()
- we already calculate the string length, just use a variable local array
Panu Matilainen [Wed, 16 Dec 2009 08:09:26 +0000 (10:09 +0200)]
Remove now unnecessary const-avoidance construct
Panu Matilainen [Wed, 16 Dec 2009 07:52:59 +0000 (09:52 +0200)]
Const-correctness on fsmRmdirs() and fsmMkdirs()
- both functions need to copy the data anyway as they modify, just use
a helper variable to cleanly avoid the const strings from iterator
Panu Matilainen [Wed, 16 Dec 2009 07:43:55 +0000 (09:43 +0200)]
Remove bogus const from fsm [o]path members and use of _constfree()
- in reality the paths point to allocated memory at all times
Panu Matilainen [Wed, 16 Dec 2009 07:25:55 +0000 (09:25 +0200)]
Simplify fsmFsPath()
Panu Matilainen [Tue, 15 Dec 2009 12:43:40 +0000 (14:43 +0200)]
Kill of ancient unused kludgery over buggy packages
Panu Matilainen [Tue, 15 Dec 2009 12:42:12 +0000 (14:42 +0200)]
Kill off stillborn fsm threading stuff
Panu Matilainen [Tue, 15 Dec 2009 12:39:57 +0000 (14:39 +0200)]
Kill off stillborn "not yet" code from 2001
Panu Matilainen [Mon, 14 Dec 2009 13:23:28 +0000 (15:23 +0200)]
Eliminate transaction disk space checking functions from the API
- The DSI stuff runs from deep inside rpmtsRun() with no chance for
API users to do anything with it. Bury into transaction.c and
make static to let us change the way it works without API constraints...
Panu Matilainen [Wed, 9 Dec 2009 13:11:39 +0000 (15:11 +0200)]
Fix memleak in python ts.hdrFromFdno()
- the python object holds reference to header here, decref the header
so it gets freed eventually
Panu Matilainen [Wed, 9 Dec 2009 12:42:03 +0000 (14:42 +0200)]
Fix a few list-related memleaks in python bindings
- PyList_Append() bumps the object reference count, callers need to
explicitly decref them... oops :)
Panu Matilainen [Wed, 9 Dec 2009 09:17:04 +0000 (11:17 +0200)]
Kick out one remaining sqlite reference (in the translations)
Florian Festi [Wed, 9 Dec 2009 08:50:58 +0000 (09:50 +0100)]
Remove sqlite hacks from rpmdb.c
Panu Matilainen [Tue, 8 Dec 2009 14:22:42 +0000 (16:22 +0200)]
Avoid exposing libmagic dependency in public headers
Panu Matilainen [Tue, 8 Dec 2009 13:58:51 +0000 (15:58 +0200)]
Avoid noise from python bytecompile on non-python pkgs (RhBug:539635)
- If a pattern doesn't match, we'd prefer an empty list instead of
unexpanded garbage thank you... nullglob shell option is just what the
doctor ordered but unfortunately its a bash-specific thing. Otoh there
are number of other bash-specific scripts in rpm so probably not
much of an issue...