Age | Commit message (Collapse) | Author | Files | Lines |
|
'?' is returned by getopt when option is unknown, making hard to
pinpoint the actual bogus option...
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 8192e580a0a962b8eb7f9d8fc07bd3f99ccf0ffe)
|
|
- This might've clashed with %dir in spec %files at some point as
indicated by the comments, but that should no longer be the case.
|
|
Teach %prep and %uncompress how to handle 7zip tarballs, with
the mingw toolchain landing in fedora, this may be useful when
crossbuilding Windows sources compressed using 7zip (CxImage is
one such project).
|
|
- This isn't strictly needed as we're terminating the buffers "just in
case" all over the place but handling this centrally might allow
some day eliminating the other fluff...
|
|
- Oops, remember to reserve space for the trailing \0 when appending.
mb->nb holds the number of actual characters left in the buffer,
not the terminator. Fixes a regression introduced in rpm 4.9.x
dynamic macro realloction work (RhBug:431009 reprise)
|
|
- Actually protect against NULL mep (shouldn't happen but...)
- Remove bogus comment + add actually relevant comments
- Make the *mep reassignment more obvious by taking it out of
the if where its easily missed
- Replace dead NULL-assignments with a trash-n-burn memset()
- Fixup indentation to match general rpm style
|
|
- We already have a function to free macro entries, use it to
remove code duplication
|
|
|
|
- Lift the printbuffer accounting out of rpmlua into a struct of
its own (Funny thing, this looks a whole lot like the macro
expansion buffer and Good Ole StringBuf Brothers ... Boys ... Mam.
Unify them one of these days maybe)
- Replace the simplistic on/off printbuffer with a stack of buffers,
fixup the lone caller to use the new internal push/pop API.
|
|
- fopen() returns NULL on errors, never an opened stream with error
flag set. These are leftovers from past where rpmio fd was used
instead of FILE and probably the checks were bogus even back then too.
|
|
- A macro can undefine itself, and unless we grab a copy of it we'll
end up accessing already freed memory. Fixes a regression from
commit ebc4ceaaeb8bb59019f4635471b28eb5f3eaaaa6 which assumed
a copy is not always needed.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
|
|
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
|
|
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
|
|
|
|
- expandMacro() is big and ugly already, but handling the non-terminated
substrings there once and for all avoids having to ping-pong recurse
through couple of helpers to get there.
|
|
|
|
|
|
- Return the dynamically allocated expansion buffer to callers from
expandU(), except using a slightly less cryptic expandThis() name
for it now. Also deal with non-terminated strings centrally in
expandThis() instead of doing alloc + copy to terminate in every caller.
|
|
- Instead of saving and restoring the bits we'll mess with, just
make a temporary expansion state struct with non-buffer state
copied from "parent".
|
|
- Eliminate the underlying limitation of macro expansion limit by
growing the buffer as needed when adding characters to it. This
doesn't fix the entire issue yet however: expandU() and expandMacros()
are still limited to caller-specified buffer size, and output
from lua-macros isn't dynamically resized. One step at a time...
|
|
- More pre-requisites for dynamic buffer resizing, callers have no
clue how much expandMacro() is going to need.
|
|
- Supposedly no functional changes, just paving way for dynamic
buffer resizing which is impossible when accessing pointers directly.
|
|
- 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.
|
|
|
|
- It's just the macro name we're grabbing here, that ought to fit
on stack comfortably enough.
|
|
- 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.
|
|
- No functional changes, just eliminating mindless save-and-restore
ping-pong through macro expansion state struct.
|
|
|
|
|
|
- the "fix" breaks seemingly legitimate use in fedora font package
macros, possibly some funky interaction with %{lua: } macros or something
- this reverts commit f895acd285366cf58cc3c97b5f188fecbfd782a8.
|
|
- 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.
|
|
|
|
- only macro.c needs, no point polluting includes everywhere
|
|
|
|
|
|
|
|
- should've been in commit 8078d0ba24662308b10d9eb0f0da978584b7e757
|
|
- 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
|
|
- inspired by http://lists.rpm.org/pipermail/rpm-maint/2009-January/002332.html
|
|
- 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...
|
|
- another dumb regression from macro handling cleanups
|
|
- commit f366011c42e4cf13d3acdd1af45127f0a1baec3a is too simplistic and
broke other stuff in turn...
|
|
- 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
|
|
- do all the copying inside a loop
|
|
- leftover from static buffer times..
|
|
- 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
|
|
|
|
|
|
- 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.
|
|
|