Commit Graph

184 Commits

Author SHA1 Message Date
Panu Matilainen 2d2bda29c1 Add built-in %getconfdir macro for getting rpmConfigDir() value
- define %_rpmconfigdir via %getconfdir in the main macro config, this
  avoids it getting lost on macro reloads as happens when building
  several packages at once
2009-03-27 14:01:47 +02:00
Panu Matilainen 947ad7acb3 Add getenv macro, use instead of $(echo $HOME) for defauls
- inspired by http://lists.rpm.org/pipermail/rpm-maint/2009-January/002332.html
2009-01-16 09:09:40 +02:00
Panu Matilainen da83a562e1 Add function to retrieve rpm config base directory
- one-shot to determine configuration base directory path from
  RPM_CONFIGDIR environement or build-time default
- rpmfileutil is a bit strange place, this would really belong to librpm
  but Lua initialization needs the path so...
2008-11-22 18:06:31 +02:00
Panu Matilainen 49c515179a Permit tab as whitespace between macro arguments (rhbz#467567)
- another dumb regression from macro handling cleanups
2008-10-19 01:53:03 +03:00
Panu Matilainen 9f85707825 Macro argument handling regression regression (rhbz#461180)
- commit f366011c42 is too simplistic and
  broke other stuff in turn...
2008-09-11 16:56:50 +03:00
Panu Matilainen 1d9b4d00d7 Make rpmExpand() smarter wrt memory allocations
- precalculate unexpanded size and allocate enough for that plus MACROBUFSIZ
  for expansion
- typical allocation is way smaller than what gets allocated "just in case",
  calculate expanded size and realloc to actual size to avoid wasting
  memory
2008-07-16 10:52:33 +03:00
Panu Matilainen 889f9f5b41 Eliminate another unnecessary temp variable
- do all the copying inside a loop
2008-07-16 10:33:57 +03:00
Panu Matilainen 1b19676027 Eliminate unnecessary variable
- leftover from static buffer times..
2008-07-16 10:24:05 +03:00
Panu Matilainen f366011c42 Macro argument handling regression (rhbz#455333)
- expandMacro() wants the next \0 character to be returned, which might
  or might not be the same as lastc passed to grabArgs()
- use memcpy() instead of memmove() for the copy, the areas can't overlap
2008-07-16 09:40:10 +03:00
Panu Matilainen af9518dce2 Use correct type for strlen() 2008-06-10 10:02:52 +03:00
Panu Matilainen 485d195488 Plug memleak in macro doFoo() 2008-04-29 17:39:02 +03:00
Panu Matilainen 9ae911eefe Further simplify rpmInitMacros()
- Use argvSplit() for splitting the macro path to components instead of
  manual pointer-parsery.
- If URL's are to be supported or accepted at all (previous code attempted
  to skip them), ':' is a very poor delimiter character.
2008-04-19 16:42:56 +03:00
Panu Matilainen e336146a9e Use argvFree() to free, well, an argv, instead of manual freeing 2008-04-19 16:04:11 +03:00
Panu Matilainen 601b4d0e6a Avoid entirely silly rpmio FD_t use
- rdcl() converts to FILE internally anyway, might as well use fopen()
  to begin with...
2008-04-18 16:14:15 +03:00
Panu Matilainen 38a975b157 Remove unnecessary xstrdup() of dynamically allocated buffer
- leftover from when target buffer was static...
2008-04-18 15:39:07 +03:00
Panu Matilainen 94e64fec18 Cosmetics: group operations more logically... 2008-04-18 15:15:05 +03:00
Panu Matilainen 2d8a27ed16 Simplify macro option + argument processing
- eliminate ninja-voodoo pointer-hackery parsing, replace argvSplit() +
  argvJoin() and friends
- eliminate static sized buffers from the processing
2008-04-18 14:59:03 +03:00
Panu Matilainen 02939c15fa More accurate filtering of .rpmnew etc when reading macros
- strstr() can give false positives, use rpmFileHasSuffix() instead
2008-04-17 17:33:30 +03:00
Panu Matilainen 3c1126b2a5 Missing decompression arguments for bzip in uncompress macro 2008-04-04 15:52:52 +03:00
Panu Matilainen 7ddab3ab8d Dead code removal (macro stuff) 2008-03-31 10:44:23 +03:00
Panu Matilainen c908277be2 Minimal namespacing for locale-insensitive x*() string functions 2008-03-18 09:10:13 +02:00
Panu Matilainen 05129f83dc Make bunch of macro internal variables static 2008-02-26 22:24:28 +02:00
Panu Matilainen cc69dd20b8 Allocate macro buffers dynamically
- avoids some entirely needless overflow cases
- somewhat similarly to rpm5.org but use heap instead of stack
2008-02-01 13:00:40 +02:00
Panu Matilainen 56405587f4 Allocate various macro buffers from heap not stack 2008-02-01 12:11:03 +02:00
Panu Matilainen 54ab76019e Define + use MACROBUFSIZ for macro expansion buffer size
- double the buffer size while at it...
2008-02-01 11:36:13 +02:00
Panu Matilainen d3d60512bd Macro shell expansion fixes (rhbz#431009) 2008-02-01 11:09:13 +02:00
Panu Matilainen eb5dc35c19 Include spring-cleaning
- put some consistency into include ordering
- everything (apart from bits missed ;) is now ordered like this
  1. "system.h"
  2. other system includes
  3. rpm public headers
  4. rpm private headers
  5. "debug.h"
2008-01-30 17:05:29 +02:00
Panu Matilainen 95b03441cc Rename isCompressed() -> rpmFileIsCompressed() for namespacing 2008-01-27 16:39:40 +02:00
Panu Matilainen eec03952be Make uncompress macros match reality (_ vs __ prefix) 2008-01-23 07:56:51 +02:00
Panu Matilainen 8e00018c88 Fix some const issues in macros 2007-12-19 12:49:52 +02:00
Panu Matilainen 78ad426f04 Remove bogus const from rpmGlob argv return type
- it's malloced and must be freed by caller
2007-12-18 10:17:18 +02:00
Panu Matilainen c41f61369e Unconstify macro contents, fully contained within macro module 2007-12-16 21:28:37 +02:00
Panu Matilainen f5a712db5b Remove bogus consts.. 2007-12-14 15:50:17 +02:00
Panu Matilainen 9ce13e09ef Switch to <rpm/foo.h> style for public headers
- adjust include paths accordingly
2007-12-08 14:02:32 +02:00
Panu Matilainen 89527785bb Move logging related macros rpmlog, adjust includes 2007-11-30 23:08:38 +02:00
Ralf Corsépius 8ef0ca213f Expand private include file names to be relative to $(top_srcdir) 2007-11-23 11:41:29 +01:00
Panu Matilainen 7b2a9b3c24 Move rpmGlob() from macros to rpmfileutil.h
- macros is all just macros now
- internal copy of popt stuff needs to go...
2007-11-23 10:27:29 +02:00
Panu Matilainen 2c6905dd9f Move rpmGetPath and rpmGenPath to rpmfileutil.h 2007-11-23 10:20:19 +02:00
Panu Matilainen 178e32a0ba Move rpmCleanPath from macros to rpmfileutil.h 2007-11-23 10:10:19 +02:00
Panu Matilainen ff77bfa2a1 Move file compression stuff from rpmmacro.h to rpmfileutil.h 2007-11-23 10:05:49 +02:00
Panu Matilainen 4ad615daf5 Move the xstr*() string variants from rpmio.h to rpmstring.h 2007-11-23 08:32:08 +02:00
Ralf Corsépius abeea80a38 Use #include <x.h> syntax to include public headers. 2007-11-23 06:46:19 +01:00
Panu Matilainen 17ef8a3082 Lose rpmerr.h for good 2007-11-19 16:32:15 +02:00
Panu Matilainen 43c5de66fb Replace all RPMERR_* etc uses with corresponding RPMLOG_* levels 2007-11-19 16:25:24 +02:00
Panu Matilainen 0781adb1cb Eliminate macro struct internals from the API 2007-11-02 10:40:45 +02:00
Panu Matilainen bdd3cd3ed6 Macros don't need rpmio_internal 2007-10-29 12:55:43 +02:00
Panu Matilainen 46e669f06e Remove bunch of long-dead macro debug stuff 2007-10-29 09:30:45 +02:00
Ralf Corsépius 9735f83012 Include "rpmio_internal.h" instead of <rpmio_internal.h>. 2007-10-28 06:43:19 +01:00
Ralf Corsépius d7c7203182 Include "rpmerr.h" instead of <rpmerr.h>. 2007-10-28 06:43:10 +01:00
Ralf Corsépius b1f8da9252 Include "rpmlua.h" instead of <rpmlua.h>. 2007-10-28 06:36:11 +01:00