Commit Graph

971 Commits

Author SHA1 Message Date
Panu Matilainen 61a3fc4523 Let expandMacro() allocate its own buffer
- More pre-requisites for dynamic buffer resizing, callers have no
  clue how much expandMacro() is going to need.
2010-09-27 14:55:12 +03:00
Panu Matilainen dc258bac41 Track current expansion point via distance to buffer start
- Supposedly no functional changes, just paving way for dynamic
  buffer resizing which is impossible when accessing pointers directly.
2010-09-27 14:55:12 +03:00
Panu Matilainen 568ba0d242 Push the macro buffer size limit down by one level
- Turn expandMacros() into a wrapper around internal doExpandMacros()
  which returns the expanded string in a newly allocated buffer, use
  the internal version for rpmExpand() too.
2010-09-27 14:55:12 +03:00
Panu Matilainen a931202422 Eliminate unused spec field from macro expansion state struct 2010-09-27 14:55:11 +03:00
Panu Matilainen 8082eb48db Avoid calloc() in macro findEntry()
- It's just the macro name we're grabbing here, that ought to fit
  on stack comfortably enough.
2010-09-27 14:55:11 +03:00
Panu Matilainen ebc4ceaaeb Avoid unnecessary round-trip through expandT() where possible
- In the cases where expandT() was called with strlen(source) we can
  now just bypass it and call expandMacro() directly, avoiding an
  unnecessary string copy.
2010-09-27 14:55:11 +03:00
Panu Matilainen ccba5236a0 Use function arguments to pass, duh, arguments into functions. Duh.
- No functional changes, just eliminating mindless save-and-restore
  ping-pong through macro expansion state struct.
2010-09-27 14:55:11 +03:00
Panu Matilainen 79301695ce Remove double const in urlstring struct 2010-09-22 09:22:39 +03:00
Panu Matilainen 5d5cb6dce7 Make rpmsqAction compatible to sa_sigaction 2010-09-22 09:22:39 +03:00
Panu Matilainen 8b7ff12b4e Add "c++ protection" to (hopefully) all of our internal headers 2010-09-21 15:21:12 +03:00
Panu Matilainen 7d0790d2fe Add "C++ protection" to the public rpmutil.h header, oops... 2010-09-21 15:13:02 +03:00
Panu Matilainen a43c15eadf Return typed pointers from rpmluaFree() and rpmluavFree() 2010-09-21 14:22:29 +03:00
Panu Matilainen b50c537b5c Adjust pgpMpiSet() dest type to match actual use 2010-09-21 14:04:44 +03:00
Panu Matilainen 0ebc7a4e39 Error string is const char *, not void pointer 2010-09-21 14:03:43 +03:00
Panu Matilainen 0ccbd8fe6e Adjust internal io read, write and digest update to take buf as void pointer
- This matches ffread() and read() much better, avoiding pile of casts.
- By some stroke of genious, glibc cookie interfaces disagree with the
  other file stream protos by using char * for buf. Argh. Add explicit
  cast for the schizophrenia.
2010-09-21 13:43:48 +03:00
Panu Matilainen a82633c2a3 Avoid using void pointer when we have a real type for the memfail function 2010-09-21 13:41:25 +03:00
Panu Matilainen d712fcb5c1 Change fdstat functions to take fdOpx enum to fix int/enum mismatches 2010-09-21 12:07:27 +03:00
Panu Matilainen a9e039edb4 Fix up silly int/enum and type vs variable name mixups in urlPath() 2010-09-21 12:06:24 +03:00
Panu Matilainen 2fb15a5443 Stop abusing enum typedefs for bitfield types
- Enums are fine for defining the bitfield flags, but the bitfield
  itself is not an enumeration. Add a separate typedef on "rpmFlags"
  type (presenting a bitfield of flags) for all of these. Compilers
  hardly care, but the typedefs give a nice visual clue for
  us humans using these flags far away from ho^H^H definitions.
2010-09-21 11:10:14 +03:00
Panu Matilainen 92c12d1a8e Eliminate all fooUnlink() functions out of the API
- These are internal helpers only, all refcount users need to use
  fooFree() or similar for correct operation. Add fwd declarations
  where necessary to avoid moving code around unnecessarily.
- We could add these back later as aliases to fooFree() but for now,
  just get them out of the way.
2010-09-13 13:08:33 +03:00
Panu Matilainen 18d1d9fc7a Fix _USE_LIBIO test
- Commit 05b2d979e8 caused the
  _USE_LIBIO test in rpmio.c to always fail as <stdio.h> wasn't included
  yet at the time of the check, causing silent fallback to not
  using libio even if actually available. Which in turn revealed
  funky other little bugs, addressed in commits
  d960e8c187 and
  be3c34dd15. Ptooey.
2010-09-08 13:41:03 +03:00
Jindrich Novy 7f220202f2 Redirect macro stack backtrace printing to debug log. 2010-07-13 13:35:22 +02:00
Jindrich Novy 60be56e317 Fix cryptic macro evaluation error message (RhBug:613010) 2010-07-13 13:34:05 +02:00
Jiri Kastner 20cfa7d2b4 Tell rpm about SHA-224 existence (RhBug:608599)
- Fixes "Unknown hash algorithm" message but this is cosmetic only as
  NSS doesn't currently support SHA-224.
2010-06-29 09:48:43 +03:00
Panu Matilainen 15c0c4e7a1 Fix "empty reply from server" curl-syndrome with url retrieval (RhBug:598988)
- We were adding a trailing newline to urlhelper command line passed
  to execvp(), with the newline ending up in the URL passed to curl.
  Many servers dont seem to mind the extra newline, but some do. Oh well...
2010-06-03 16:22:09 +03:00
Panu Matilainen cadab3afa5 Permit DOS line-endings in PGP armors (RhBug:532992)
- RFC-4880 doesn't requires unix-style line-endings, we shouldn't either.
  This is probably still oversly strict as RFC-4880 appears to permit
  any whitespace to follow armor headers but ... shrug.
2010-06-01 11:58:42 +03:00
Panu Matilainen 2be413810c Add public pgpValString() function + enum for the various types
- The equivalent used to be possible in 4.4.x era as the value tables
  were all exported, but this way we need to export far less
  and the implementation details stay internal.
2010-05-19 15:32:54 +03:00
Panu Matilainen 072815887f Bury struct pgpValTbl_s definition inside rpmpgp.c
- as all the value tables are static inside rpmpgp.c, exposing this
  is pointless (should've been unexported long time ago)
2010-05-19 14:59:02 +03:00
Panu Matilainen cb5b70be4e Lose long since unused fdReadable() and fdWritable()
- these have been unused since rpm 4.6.0, and can be implemented
  without access to rpmio internals too if somebody cares...
2010-03-29 15:33:03 +03:00
Panu Matilainen de5ec1af47 Lose long since unused url control structure and related functions
- these have been unused since rpm 4.6.0, and rpm is not in the
  url business, rip.
2010-03-29 15:27:43 +03:00
Panu Matilainen e1e323558c Further rpmio NULL sanity checks
- instead of blowing up with asserts, return error codes / NULLs
2010-03-22 14:23:05 +02:00
Panu Matilainen c0d4420f00 Lose FDSANE() macro, check in c2f() and callers instead 2010-03-22 14:09:58 +02:00
Panu Matilainen 00fb04f708 Change most of the FDSANE() asserts into good old NULL-checks
- blowing up with an assert failure deep inside io "library" is not
  a very friendly thing to do...
2010-03-22 13:47:32 +02:00
Panu Matilainen d71964bda5 Lose the useless rpmio refcounting debug junk
- the rpmio API always had this goo, should've gotten rid of it
  back in commit dbdbe8010c but .. oh well
2010-03-22 13:25:57 +02:00
Panu Matilainen ad43e72d70 Bury FTS inside librpmbuild and eliminate from public ABI 2010-03-19 18:23:52 +02:00
Panu Matilainen 35052b9623 Add an enhanced argvSplitString() function for splitting strings to argv's
- Returns the newly created argv instead of useless "this always returns 0"
- By default make a "real" split, including empty strings
- Flags argument allows controlling behavior, for now only flag is to
  preserve argvSplit() behavior but leaves room for future enhancements
  such as quoted splitting etc
2010-03-15 11:54:55 +02:00
Panu Matilainen 87c237bebf Split elf dependency extraction out of librpmbuild to external helper
- Elf dependency extraction code code lifted from rpmfcELF() and refactored
  to saner pieces. Having it in separate executable also frees librpmbuild
  of libelf dependency, clean up the unnecessary linkage etc from
  autofoo
- This lets internal dependency generator for elf files be
  overridden without losing file coloring (which is required for
  correct multilib handling). It also permits non-native elf files
  (eg when cross-building) to be handled by providing a custom
  elf dependency helper
- On the flip side, this inevitably slows down builds somewhat as
  two fork-exec's are needed for every elf file, but unlike invoking
  something like the python interpreter, this is a slim helper...
- All dependency extractors of the internal dependency generator are now
  external helpers (how twisted is that, huh? :) and thus can be customized
  and filtered through %__foo_provides|requires macros
2010-02-10 11:20:51 +02:00
Florian Festi 51c96db046 Kill RPMTAG_FSNAMES and RPMTAG_FSSIZES and everything implementing them 2010-02-03 16:27:00 +01:00
Panu Matilainen c16cde7a4d Revert "Always free locally defined macros when they go out of scope"
- the "fix" breaks seemingly legitimate use in fedora font package
  macros, possibly some funky interaction with %{lua: } macros or something
- this reverts commit f895acd285.
2010-01-07 12:04:53 +02:00
Panu Matilainen 05b2d979e8 Move <stdio.h> includes out of system.h to the places that need it 2010-01-05 16:06:02 +02:00
Panu Matilainen 8fe27d49e1 Move <ctype.h> include out of system.h to the places that need it 2010-01-05 15:33:47 +02:00
Panu Matilainen dd58384ede Move <errno.h> include out of system.h to the places that need it 2010-01-05 15:25:31 +02:00
Panu Matilainen e3638c2c86 Remove <string.h> include from system.h into the few places that still need
- most of the places get it through <rpm/rpmstring.h> already
2010-01-05 15:17:34 +02:00
Panu Matilainen 0c15e5feb3 Include <stdlib.h> as necessary instead of system.h
- also loose the related ancient compatibility goo
2010-01-05 15:04:20 +02:00
Panu Matilainen 0ff81ace79 fts.h requires <stdint.h>, include it there explicitly
- this has been masked by system.h including <netdb.h> which apparently
  brought in <stdint.h> as a side-effect
- commit 5c084f842a broke compilation
  without capability support as <sys/capability.h> also happens to bring
  in <stdint.h>
2010-01-05 13:09:38 +02:00
Panu Matilainen 2c6120755c Unconditionally include <sys/wait.h> where needed
- no point conditionalizing what we cant live without
2010-01-05 12:35:54 +02:00
Panu Matilainen 5085ae9923 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
2010-01-05 12:16:52 +02:00
Panu Matilainen 5c084f842a 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
2010-01-05 11:26:14 +02:00
Panu Matilainen 834551d246 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...)
2010-01-04 17:15:26 +02:00
Panu Matilainen 8dfd8f2a82 Use MAP_FAILED instead of hardwired (void *)-1 2010-01-04 16:22:56 +02:00