Commit Graph

40 Commits

Author SHA1 Message Date
Gleb Fotengauer-Malinovskiy
e9c71b57f4 macro.c: force GNU getopt(3) to reinitialize it's internal data structure
getopt(3) holds pointers to previous argument vector in case you want to
continue or restart parsing.
In grabArgs function argument vector is on the stack, so you are lucky
if this memory is not reused for something else between subsequent calls
to the function.  If you are not lucky, getopt(3) will read new
arbitrary value from the stack and return error.
2019-01-31 22:17:45 +03:00
Gleb Fotengauer-Malinovskiy
62acbd59d6 macro.c: increase maximal macro depth 2018-05-24 16:19:11 +03:00
3f575cf2bc rpmio/macro.c (doShellEscape): fix an off-by-one error in stripping trailing newlines
Reported by Alexey Tourbin.
2013-02-07 14:25:10 +00:00
120ce7358f Add %_tmpdir builtin macro 2012-12-22 16:52:35 +00:00
0f27ba59eb Add %getenv builtin macro 2012-12-22 16:20:47 +00:00
a470a11bac parseSpec: enhance line buffer overflow diagnostics 2012-03-19 18:18:03 +00:00
Alexey Tourbin
05eb59911d macro.c: fixed macroTable corruption in freeArgs 2011-01-06 05:52:17 +03:00
Alexey Tourbin
6370ecd629 macro.c: replaced repeated bsearch+qsort with BSEARCH, 10x faster startup
"rpmquery rpm" callgrind annotations, previous commit:
86,825,432  PROGRAM TOTALS
33,090,616  ???:0x0000000000033080'2
25,635,193  ???:strcmp
11,530,816  ???:compareMacroName
 7,241,913  ???:memcpy
 2,008,600  ???:0x0000000000033080
 1,734,274  ???:sortMacroTable
   774,941  ???:doDefine
   642,062  ???:0x00000000000714c0
   308,897  ???:0x000000000002a7b0
   308,137  ???:do_lookup_x
   259,615  ???:0x0000000000070c50
   245,388  ???:poptReadConfigFile

"rpmquery rpm" callgrind annotations, this commit:
6,249,372  PROGRAM TOTALS
774,941  ???:doDefine
531,291  ???:addMacro
523,434  ???:0x00000000000714c0
388,985  ???:strcmp
308,897  ???:0x000000000002a7b0
308,098  ???:do_lookup_x
245,388  ???:poptReadConfigFile

"rpmquery rpm" repeated 100 times (user time), previous commit:
3.78s

"rpmquery rpm" repeated 100 times (user time), this commit:
0.40s
2011-01-06 04:04:18 +03:00
Alexey Tourbin
1ccf0dd03c 4.0.4-alt95.M41.28
- rpmio, rpmbuild: Added support for .xz/.lzma compressed sources and patches.
- Removed old scripts in /usr/lib/rpm.
2009-09-29 16:20:33 +04:00
Alexey Tourbin
19e6de9d5e added support for .xz/.lzma compressed sources and patches
This also fixes some bugs:
- %uncompress macro never worked;
- %patch -s -b .orig never worked.
2009-09-29 14:18:01 +04:00
4ca252696d Merge branch 'altlinux-4.0' into altlinux-4.1 2009-07-13 23:04:30 +00:00
7e293aed59 rpmio/macro.c (doShellEscape): Fix potential buffer underflow (ALT#11921) 2009-07-13 23:01:04 +00:00
Alexey Tourbin
c1c04912cc Merge 4.0.4-alt77 into mod 2007-08-02 18:56:55 +04:00
20400c24b8 rpmio/macro.c (doFoo): Fix potential buffer overflow in %homedir macro processing 2007-04-11 18:18:01 +00:00
Alexey Tourbin
4d8a11acb6 rpmio/macro.c (rpmInitMacrofileGlob): require last character to be alnum
Rationale: I use 'set patchmode=-' in my ~/.vimrc.
2007-03-19 12:41:26 +03:00
41dcd7cb5f missing macro with length <=2 is not an error 2005-10-13 10:59:05 +00:00
b23ff9b127 implemented rpmSetBuiltinMacroLookupFailedOK 2005-10-12 23:35:17 +00:00
74ce1d569c expandMacro: unparseable macro is now just a warning 2005-10-06 21:50:47 +00:00
32956660df expandMacro: do not return error status due to unparseable macro 2005-10-06 19:15:05 +00:00
a392ed233f Introduced rpmBuiltinMacroLookup 2005-10-06 18:16:57 +00:00
c8f7261883 expandMacro: propagate error status from unrecognized macros 2005-10-06 15:24:04 +00:00
228f52209f when found unknown macro, skip known tags and set error status 2005-10-06 00:55:41 +00:00
71dfbb8215 Enhanced unparseable macro diagnostics in expandMacro() 2005-10-05 23:43:32 +00:00
cb23936968 print error message for unparseable macros 2005-09-29 15:04:43 +00:00
ce031c62d6 reverted previous change 2005-06-29 18:04:46 +00:00
cb69eafd41 rpmInitMacrofileGlob: expand argument before processing 2005-06-23 14:09:04 +00:00
b59df3d771 fix "eats up newline" bug 2004-06-26 17:36:32 +00:00
4dd561a6c8 rdcl: optimized 2004-06-26 15:23:29 +00:00
67fbe0467b backported upstream change (2.107->2.108):
- fix: "/path/foo.../bar" was losing a dot (#123844).
2004-06-26 12:17:21 +00:00
0f82b5c7b9 backported upstream change (-r2.101 -r2.103 macro.c):
Made it so %* does not evaluate with a leading space.  For instance:

        %define xxx() "%{*}"
        %xxx 1 2 3

would evaluate to:

        " 1 2 3"

and now evaluates to:

   "1 2 3"
2004-06-26 12:11:28 +00:00
66c99c7f0d expandMacro: handle single % properly 2004-02-20 21:22:07 +00:00
58e1dad6cc fixed compilation warnings 2003-11-24 18:59:03 +00:00
27bf3c78ed do not skip files when globbing patterns containing ~ 2003-02-01 19:30:50 +00:00
b904bed04f filter out non-alphanumeric macro files, #0001925 2003-02-01 17:44:19 +00:00
6051b691a3 added macrofiles globbing 2002-08-29 17:20:29 +00:00
4cc2386607 fixed %basename, dropped %username, added caching for %homedir 2002-08-13 11:28:42 +00:00
c3a7049f78 added username/homedir support 2002-08-12 15:53:39 +00:00
ed8d065561 sync with rpm4 branch 2002-03-25 23:29:56 +00:00
dee952c2f8 sync with rpm4 branch: include local headers 2002-03-25 22:02:39 +00:00
82a4763c66 Initial revision 2002-03-25 20:16:26 +00:00