Panu Matilainen [Tue, 31 May 2011 08:57:45 +0000 (11:57 +0300)]
Remove dead keyp & keylen assignments in rpmdbNextIterator()
- Both get assigned to their values earlier in the loop and neither
is used beyond this point in the loop .. so these are useless.
Panu Matilainen [Tue, 31 May 2011 08:38:38 +0000 (11:38 +0300)]
Clean up + clarify popMacro() a bit
- 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
Panu Matilainen [Tue, 31 May 2011 07:38:17 +0000 (10:38 +0300)]
Use popMacro() when freeing the entire macro table
- We already have a function to free macro entries, use it to
remove code duplication
Panu Matilainen [Tue, 31 May 2011 06:02:29 +0000 (09:02 +0300)]
Pass dbiClose() flags down to db->close()
- BDB of old might not have taken flags there but current ones
do accept DB_NOSYNC to be specified (not that we use it but...)
- As a side-effect this eliminates another dead assignment
Panu Matilainen [Tue, 31 May 2011 05:59:21 +0000 (08:59 +0300)]
Return an explicit NULL from dbiFree(), remove dead assignment
Panu Matilainen [Tue, 31 May 2011 05:38:09 +0000 (08:38 +0300)]
Remove bogus condition on provide checking in query
- RPMQV_WHATPROVIDES only falls through to RPMQV_PATH on absolute
paths, so the only place checking for provides_checked value would
never be reached in the case it was set.
- Add a comment about the fallthrough case
Panu Matilainen [Mon, 30 May 2011 14:13:51 +0000 (17:13 +0300)]
Eliminate dead NULL-assignment by avoiding unnecessary allocation
- cpioHeaderRead() only needs to alloc after successfully reading
the next filename from the cpio header, delay alloc until
we know the read was successful.
Panu Matilainen [Mon, 30 May 2011 12:54:16 +0000 (15:54 +0300)]
Fix a logic error leading to unlink(NULL) call, oops.
- If writing the scriptlet to a file fails, its possible to
end up with non-NULL script but with NULL fn and kaboom in unlink()
Panu Matilainen [Mon, 30 May 2011 12:50:29 +0000 (15:50 +0300)]
Eliminate bunch of dead assignments on ts vsflags
- The common pattern here is grabbing current flags to a local
variable, modifying them for an operation and then restoring,
which is fine... but we dont care about the previous flags
when we're restoring them.
Panu Matilainen [Mon, 30 May 2011 09:38:13 +0000 (12:38 +0300)]
Eliminate dead assignment(s) on rpmfsFree(), memset() wipeout instead
Panu Matilainen [Mon, 30 May 2011 09:37:06 +0000 (12:37 +0300)]
rpmgiFree() cleanup to remove an exit point and dead assignment(s)
Panu Matilainen [Mon, 30 May 2011 09:25:04 +0000 (12:25 +0300)]
Remove trailing dead NULL-assignments from sepoltransFree()
- Replace assignments with a memset() to blast away the contents instead,
taking care of other members too
Panu Matilainen [Mon, 30 May 2011 09:12:24 +0000 (12:12 +0300)]
Minor cleanups to sepolLoadPolicies() in sepolicy plugin
- Having an err label which we fall through on success too seems
a bit funny, rename the label to exit
- Initialize the sepoltrans at declaration already
- Remove redundant RPMRC_FAIL assignment on sepoltransNew() fail
case, this already assumes failure
- Remove redundant jump to exit from sepoltransCommit() error
- Eliminate trailing dead NULL assignment of the local pt variable
Panu Matilainen [Mon, 30 May 2011 09:04:18 +0000 (12:04 +0300)]
Return explicit NULL on sepoltransNew() failure
Panu Matilainen [Mon, 30 May 2011 08:45:41 +0000 (11:45 +0300)]
Remove possibility of abusing freed iterator by moving to local scope
- Eliminates another dead NULL-assignment + makes it "safer"
Panu Matilainen [Mon, 30 May 2011 08:25:51 +0000 (11:25 +0300)]
Eliminate obvious dead NULL-assignment at headerLoad() error exit
Panu Matilainen [Mon, 30 May 2011 08:22:30 +0000 (11:22 +0300)]
Eliminate dead NULL-assignment on lua scriptlet execution
- alloc the luavar on entry, free on exit to remove any abuse
possibilities
Panu Matilainen [Mon, 30 May 2011 08:00:31 +0000 (11:00 +0300)]
Eliminate a few dead NULL-assignment eliminations in rpmgraph
- There are more but leaving the rest as a reminder to clean
up rpmGraph() someday when bored enough...
Panu Matilainen [Mon, 30 May 2011 07:44:43 +0000 (10:44 +0300)]
Spring-cleaning for rpmdeps
- Depgen helpers take nno args, their input comes from stdin. Eliminates
popt vs ARGV_t mismatch which would've caused us to blow up if
it weren't for a memleak on the generated argv.
- Another memleak on the file classifier in case rpmfcClassify()
or rpmfcApply() fails - just free all allocated resources at exit.
- Remove fluff: fgets() is guaranteed to \0-terminate non-NULL returns,
eliminate unused/useless variables
- Fixup indentation where busted
Panu Matilainen [Mon, 30 May 2011 06:36:03 +0000 (09:36 +0300)]
Eliminate dead NULL-assignments at scope-end in main cli utils
Panu Matilainen [Sun, 29 May 2011 10:10:42 +0000 (13:10 +0300)]
A few more dead NULL-assignment eliminations in low-level header code
Panu Matilainen [Sun, 29 May 2011 09:03:56 +0000 (12:03 +0300)]
Move db cursor to local scopes, remove dead NULL-assignments
Panu Matilainen [Sun, 29 May 2011 08:52:17 +0000 (11:52 +0300)]
Eliminate dead NULL-assignments at scope-end in librpmsign
Panu Matilainen [Sat, 28 May 2011 19:30:41 +0000 (22:30 +0300)]
Eliminate dead NULL-assignments at scope-end in librpm, part VI
- Remove NULL-assignments of local variables at the end of scope
in "cli-level" code
Panu Matilainen [Sat, 28 May 2011 19:29:58 +0000 (22:29 +0300)]
Eliminate dead NULL-assignments at scope-end in librpm, part V
- Remove NULL-assignments of local variables at the end of scope
in transaction and database code
Panu Matilainen [Sat, 28 May 2011 19:28:53 +0000 (22:28 +0300)]
Eliminate dead NULL-assignments at scope-end in librpm, part IV
- Remove NULL-assignments of local variables at the end of scope
in the higher level package-related "objects": rpmds, rpmfi, rpmte
Panu Matilainen [Sat, 28 May 2011 19:26:39 +0000 (22:26 +0300)]
Eliminate dead NULL-assignments at scope-end in librpm, part III
- Remove NULL-assignments of local variables at the end of scope
from the low-level helper machinery: fsm, psm, rpmscript and rpmrc
Panu Matilainen [Sat, 28 May 2011 19:24:37 +0000 (22:24 +0300)]
Eliminate dead NULL-assignments at scope-end in librpm, part II
- Remove NULL-assignments of local variables at the end of scope
in package+signature manipulation code
Panu Matilainen [Sat, 28 May 2011 19:12:37 +0000 (22:12 +0300)]
Eliminate dead NULL-assignments at scope-end in librpm, part I
- Remove NULL-assignments of local variables at the end of scope
in header + tag- and format-extension code. While this
NULL-on-free idiom of rpm codebase is harmless as such, these
unnecessary NULL-assignments have the effect of hiding real problems
in the amount of noise they generate on code analysis.
- While the changes are supposedly trivial, doing this in smaller parts
to make bisecting easier in case a some regression slips through.
Panu Matilainen [Sat, 28 May 2011 16:45:07 +0000 (19:45 +0300)]
Eliminate dead NULL-assignments from rpmio fd close functions
Panu Matilainen [Sat, 28 May 2011 16:43:52 +0000 (19:43 +0300)]
Eliminate bunch of obvious dead NULL-assignments around librpmio
Panu Matilainen [Sat, 28 May 2011 16:42:54 +0000 (19:42 +0300)]
Eliminate dead NULL-assignments on argvFree() and argiFree()
Panu Matilainen [Sat, 28 May 2011 14:30:16 +0000 (17:30 +0300)]
Clean up spec %files -f <manifest> processing
- Split the manifest reading into a helper function
- Fix filename memleak when the file couldn't be opened and
also check for ferror() on return from the fgets() loop - fgets()
returns NULL on both EOF and error, previously an error would've
gone silently unnoticed.o
Panu Matilainen [Sat, 28 May 2011 08:34:51 +0000 (11:34 +0300)]
Remove pointless variable and a dead assignment to it
Panu Matilainen [Sat, 28 May 2011 08:30:55 +0000 (11:30 +0300)]
Clean up checkFiles() a bit
- Initialize variables on declaration, eliminate dead rc assignment
Panu Matilainen [Fri, 27 May 2011 13:46:23 +0000 (16:46 +0300)]
Eliminate bunch of obvious dead NULL-assingments from misc build parts
Panu Matilainen [Fri, 27 May 2011 13:27:34 +0000 (16:27 +0300)]
Rip hysterical hoop-jumping on spec/pkg cpiolist freeing
- Just call rpmfiFree() directly, wtf?
Panu Matilainen [Fri, 27 May 2011 13:20:45 +0000 (16:20 +0300)]
Eliminate dead NULL-assignments on parsePolicies() exit
Panu Matilainen [Fri, 27 May 2011 12:49:09 +0000 (15:49 +0300)]
Eliminate bunch of obvious dead NULL-assignments from build script code
Panu Matilainen [Fri, 27 May 2011 12:38:54 +0000 (15:38 +0300)]
Eliminate bunch of obvious dead NULL-assignments from rpm generation
Panu Matilainen [Fri, 27 May 2011 11:44:03 +0000 (14:44 +0300)]
Eliminate dead NULL-assignments in parseFiles()
Panu Matilainen [Fri, 27 May 2011 11:37:44 +0000 (14:37 +0300)]
Eliminate dead NULL-assignments from rpmSpecFree()
Panu Matilainen [Fri, 27 May 2011 11:35:14 +0000 (14:35 +0300)]
Eliminate dead NULL-assignments on OFI frees on spec parsing
Panu Matilainen [Fri, 27 May 2011 11:25:59 +0000 (14:25 +0300)]
Move build restriction header copying to local scope
- Eliminates accidental use of the variables, eliminating any
need for NULL'ing the iterator
Panu Matilainen [Fri, 27 May 2011 11:12:55 +0000 (14:12 +0300)]
Clean up + plug memleak in parseDescription()
- Eliminate dead NULL-assignments of local variables on exit
- Move stringbuf free to exit, previously error on readLine() leaked
memory here
Panu Matilainen [Fri, 27 May 2011 11:10:51 +0000 (14:10 +0300)]
Eliminate dead NULL-assignments on exit from parseScript()
Panu Matilainen [Fri, 27 May 2011 10:59:05 +0000 (13:59 +0300)]
Clean up + fix memleaks in readIcon()
- Assume failure and use single point of exit where all allocations
are freed without dumb dead-assignments. Also fixes a
leak from icon allocation when Fread() fails.
Panu Matilainen [Fri, 27 May 2011 10:53:36 +0000 (13:53 +0300)]
Eliminate bunch of obvious dead NULL assignments in preamble parsing
Panu Matilainen [Fri, 27 May 2011 10:45:58 +0000 (13:45 +0300)]
More dead NULL assignments of local variables in filelist processing
Panu Matilainen [Fri, 27 May 2011 10:33:00 +0000 (13:33 +0300)]
Eliminate dead NULL assignments on processMetadataFile() exit
Panu Matilainen [Fri, 27 May 2011 10:25:32 +0000 (13:25 +0300)]
Minor cleanup to doUntar() to eliminate dead assignments on free()
Panu Matilainen [Fri, 27 May 2011 09:50:54 +0000 (12:50 +0300)]
Clean up rpmfcGenerateDependsHelper() (aka external depgen) a bit
- Remove redundant NULL check, rpmfiNext() handles it
- Move variables to local scope(s) from function scope where
appropriate, remove dead NULL-assignments on free
- Log the "Finding ..." messages /before/ executing the (possibly
long-running) dependency generation helpers
- rpmExpand() never returns NULL, don't bother testing for it
Panu Matilainen [Fri, 27 May 2011 09:36:47 +0000 (12:36 +0300)]
Eliminate a few more dead rpmdsFree() NULL assignments
- No real chance of accidental misuse of freed data here...
Panu Matilainen [Fri, 27 May 2011 09:31:01 +0000 (12:31 +0300)]
Don't bother NULL'ing everything on rpmfcFree()
- Replace umphteen dead NULL-assignments with a trash-n-burn memset()
- Since we're already testing for NULL, dont free NULL fc (not
that it matters)
Panu Matilainen [Fri, 27 May 2011 09:23:55 +0000 (12:23 +0300)]
Minor cleanup to rpmfcExec()
- remove redundant xav re-initialization
- dont bother NULL'ing local variables on exit
Panu Matilainen [Fri, 27 May 2011 09:09:15 +0000 (12:09 +0300)]
Minor cleanups to rpmfcGenerateDepends()
- init genConfigDeps on declaration
- remove redundant NULL-checks: rpmfiNext() and rpmdsNext() check
for and handle NULL cleanly, no need to test here.
- remove pointless local fileattr variable
Panu Matilainen [Fri, 27 May 2011 08:55:31 +0000 (11:55 +0300)]
Eliminate some dead assignments on rpmdsFree()
- Move ds declaration to local scope so there's no chance of
accidental use of already freed data, ds is not needed at
function scope.
Panu Matilainen [Fri, 27 May 2011 08:52:27 +0000 (11:52 +0300)]
Add a helper function for creation namespaced dependency sets, use it
Panu Matilainen [Fri, 27 May 2011 08:23:37 +0000 (11:23 +0300)]
Minor cleanups to rpmfcHelper()
- If runCmd() returns NULL there's no point in further processing,
rearrange things to avoid extra work in that case. As a side-effect
this also silences a false-positive NULL-deference warning from clang.
Panu Matilainen [Fri, 27 May 2011 08:05:15 +0000 (11:05 +0300)]
Eliminate dead assignment, early exit means failure already
Panu Matilainen [Fri, 27 May 2011 07:59:44 +0000 (10:59 +0300)]
Cosmetics: rewrap/indent to fit 80 columns
Panu Matilainen [Fri, 27 May 2011 07:45:28 +0000 (10:45 +0300)]
Sanitize handlePreambleTag() error returns
- Single point of exit, assume failure. There are plenty of calls
here which can fail, each with different int/rpmRC return code
styles when we simply want an RPMRC_OK/RPMRC_FAIL for the return.
Also eliminates some dead rc assignments.
Panu Matilainen [Fri, 27 May 2011 06:59:55 +0000 (09:59 +0300)]
Eliminate a couple more dead increments in spec parsing code
Panu Matilainen [Fri, 27 May 2011 06:47:38 +0000 (09:47 +0300)]
Eliminate bunch of dead increments in spec filelist parsing
Panu Matilainen [Fri, 27 May 2011 06:40:23 +0000 (09:40 +0300)]
Clean up rpmrc include processing a bit
- Eliminate pointless switch-case when we only care about one
possibility here. Also eliminate a dead-increment which becomes
more obvious now with the surroundings unobfuscated.
Panu Matilainen [Fri, 27 May 2011 06:35:22 +0000 (09:35 +0300)]
Eliminate two dead increments in rpmrc platform processing
Panu Matilainen [Fri, 27 May 2011 06:02:38 +0000 (09:02 +0300)]
Handle readlink() failure in genCpioListAndHeader() correctly
- It might be a rare condition but it /can/ happen, and previously
that would cause '\0' written out of bounds (at negative array offset).
Also leave room for the terminating '\0' at the end of buffer when
calling readlink(), previously a link exactly the size of buffer
would've been silently truncated.
Panu Matilainen [Thu, 26 May 2011 11:24:46 +0000 (14:24 +0300)]
Add test-cases for three RhBug:705115 scenarios
Panu Matilainen [Thu, 26 May 2011 11:01:34 +0000 (14:01 +0300)]
Add tests for multilib file state dependencies
- Testcase for the file state consideration implemented in commit
566a15c9c08aa593d05e2f55f1c171a48bc1b1bc
Panu Matilainen [Thu, 26 May 2011 10:49:38 +0000 (13:49 +0300)]
Add two basic multilib conflict resolution tests
- Add colored binary packages (as there's no guarantee we can build
them from test-suite), test that colored conflicts get resolved
to preferred color.
Panu Matilainen [Thu, 26 May 2011 11:16:14 +0000 (14:16 +0300)]
Colored conflict resolution part II
- Same as commit
7bbc9b073d9204f6ffb8a1091c189b80029d27a9 but
within the to-be-installed set
Panu Matilainen [Thu, 26 May 2011 08:40:55 +0000 (11:40 +0300)]
Both files must be colored for multilib conflict resolution (RhBug:705115)
- File conflicts should only be resolved to preferred color when
both files are colored. Prior to this we would happily overwrite
scripts with a clearly conflicting ELF binary.
Mark Wielaard [Wed, 25 May 2011 13:44:42 +0000 (15:44 +0200)]
Add -r flag to find-debuginfo.sh to invoke eu-strip --reloc-debug-sections.
- This is a new option to eu-strip that strips out/resolves relocations
between .debug_* elf sections in ET_REL files. This can save a lot of
space for kernel module.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen [Wed, 25 May 2011 11:52:39 +0000 (14:52 +0300)]
Disable all scriptlets and collections centrally on --test and --justdb
- These are already taken care of in other places but they're littered
a little bit of here and there, eg in case of collections these
modes are only skipped deep down in the plugin code. This should
make the intended behavior more obvious upfront.
Panu Matilainen [Wed, 25 May 2011 11:26:51 +0000 (14:26 +0300)]
Permit %verifyscript from non-installed packages
- Verification from non-installed packages can be useful sometimes:
http://lists.rpm.org/pipermail/rpm-maint/2011-May/003015.html
- %verifyscript is unlike all other scriptlets so might as well
take some shortcuts and bypass rpmteProcess() & all, just
create a lone rpmte, force the header we got and call rpmpsmRun()
directly on it, bypassing rpmteProcess() which is only an
unnecessary complication here (based on patch by Michael Schroeder)
Panu Matilainen [Wed, 25 May 2011 11:03:57 +0000 (14:03 +0300)]
Don't run collections on script stages like %pre/posttrans, ugh.
Panu Matilainen [Wed, 25 May 2011 07:20:45 +0000 (10:20 +0300)]
Issue an error on failure to replace original package on signing
- Previously any failure on replacing the original package with the
newly signed one would silently fail, causing rather confusing
behavior when eg attempting to (re)sign readable but not writable
packages.
Panu Matilainen [Tue, 24 May 2011 17:28:16 +0000 (20:28 +0300)]
Add support for nested Lua macro expansion (RhBug:490740)
- 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.
Panu Matilainen [Tue, 24 May 2011 16:59:36 +0000 (19:59 +0300)]
Plug a memory leak on Lua rpm.expand()
Panu Matilainen [Tue, 24 May 2011 14:23:37 +0000 (17:23 +0300)]
Bail out of debuginfo if stabs format encountered (RhBug:453506)
- The previous "silently ignore" policy produces bogus debuginfo
packages on some architectures and fails with other mysterious
errors on others, better just fail hard until (if ever) somebody adds
stabs support.
Panu Matilainen [Tue, 24 May 2011 13:55:31 +0000 (16:55 +0300)]
Fix %prep parse error to abort build
- Previously in some cases parse error in %prep could emit an error msg
but still continue building due to error code bogosity. Clean up
the mess a bit: assume failure and actually return the res(ult) we
calculated instead of nextPart.
Panu Matilainen [Tue, 24 May 2011 12:42:27 +0000 (15:42 +0300)]
Cosmetics: remove redundant/empty doxygen markup, comments etc
- No functional changes.
Panu Matilainen [Tue, 24 May 2011 12:38:33 +0000 (15:38 +0300)]
Remove unused length return variables on doHeaderUnload()
- doHeaderUnload() is safe to call with NULL lengthPtr, the length
is only of interest to headerRead() and headerWrite()
Panu Matilainen [Tue, 24 May 2011 11:07:12 +0000 (14:07 +0300)]
Handle HEADERFLAG_SORTED bit correctly in headerUnsort()
- Within rpm there's exactly one caller of headerUnsort() which has
kinda taken care of re-sorting the header on exit, but only if it
returns successfully, meaning the header sort status could've been
left in inconsistent state with implications on consequent
operations on that header. Also this is part of the public API
yet callers have no chance of adjusting the flag when they call it
(and why should they).
- Also dont bother sorting if the header is already in unsorted state.
Panu Matilainen [Tue, 24 May 2011 10:47:25 +0000 (13:47 +0300)]
Return explicit NULL on errors + frees in header code
Michael Schroeder [Tue, 24 May 2011 05:51:56 +0000 (08:51 +0300)]
Do not die on empty changelog section
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Jindrich Novy [Mon, 23 May 2011 12:11:43 +0000 (14:11 +0200)]
Distinguish between macro primitives with and w/o arguments
- do argument presence checks only for those requiring arguments
Panu Matilainen [Mon, 23 May 2011 10:40:39 +0000 (13:40 +0300)]
Add support for fileattr dependency namespacing
- This allows automatically wrapping generated dependencies into
macro-expanded namespaces, eg foo(depname) by specifying
__attr_namespace in the file attribute definition.
- Current generator scripts hardcode their namespaces but doing this
on rpm-level gives extra flexibility eg when building for alternative
versions/environments and frees generators from having to take care of
the formatting.
Panu Matilainen [Mon, 23 May 2011 09:32:27 +0000 (12:32 +0300)]
Whoops, flags needs to be sorted for argvSearch() to work correctly
Panu Matilainen [Mon, 23 May 2011 08:11:43 +0000 (11:11 +0300)]
Unify fileattr include- and exclude-rule handling
- Handling both rule-types identically not only makes things more
consistent but also adds exclude_flags support practically for free:
"exeonly" and "magic_and_path" are usable for excludes too now, ditto
for any other flags that might be added in the future.
Panu Matilainen [Fri, 20 May 2011 12:20:49 +0000 (15:20 +0300)]
Don't fetch missing sources on spec query
Jindrich Novy [Fri, 20 May 2011 11:55:04 +0000 (13:55 +0200)]
Unbreak %if, %if(n)arch, %if(n)os handling
- having those expressions without argument is no more allowed
- white space between expression and argument is mandatory
- rpmbuild no more confuses %ifabcd macro with %if abcd
- fix criptic message in case of invalid %if condition
Panu Matilainen [Fri, 20 May 2011 07:05:02 +0000 (10:05 +0300)]
-D is for --define, not --predefine (RhBug:706161)
Michael Schroeder [Thu, 19 May 2011 11:55:55 +0000 (14:55 +0300)]
Support "magic_and_path" flag in fileattrs
- Allow "magic_and_path" flag to configure that files must
match both regexpes to be sent to the dependency generator.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen [Thu, 19 May 2011 08:08:07 +0000 (11:08 +0300)]
Remove redundant NULL checks
- Fclose() handles NULL by itself, no need to check in callers.
Also no need to NULL'ify the local variables here.
Panu Matilainen [Wed, 18 May 2011 12:53:54 +0000 (15:53 +0300)]
Fix error handling in payload copying
- Lift the payload copy into a separate helper function to clean
things up a bit
- The code to handle read errors was unreachable before this,
causing any read error (rare as they might be) to be silently
ignored and package generation considered successful.
- This could/should perhaps use ufdCopy() instead but that ha
its own set of problems (not clean wrt large files, error reporting...)
Panu Matilainen [Wed, 18 May 2011 12:11:42 +0000 (15:11 +0300)]
Eliminate dead cpio_copy() + related stuff
- These code-paths cannot have been hit since readRPM() was
killed, mop out the leftovers
Panu Matilainen [Wed, 18 May 2011 10:37:18 +0000 (13:37 +0300)]
Update translations to pick up changes from the script file cleanups
Panu Matilainen [Wed, 18 May 2011 10:23:29 +0000 (13:23 +0300)]
Further simplify & cleanup script file (error) handling
- Simply always call addFileToFoo() and handle no scriptfile condition
as early success case there (and allocate sb only if actually needed).
- Consolidate error logging into addFileToTagAux(), removing the need
for umphteen nearly identical rpmlog error messages + related logic.
- Eliminate the now pointless addFileToFoo() wrapper functions
and just call the main thing directly.
Panu Matilainen [Wed, 18 May 2011 09:47:50 +0000 (12:47 +0300)]
Clean up addFileToTagFoo() helpers
- Centralize the work into addFileToTagAux(), turning the other
two helpers into dumb wrappers with the only difference being
append or no append. This simplifies and clarifies the exit
codes, stringbuf allocations etc a good deal.