tools/librpm-tizen.git
13 years agoEliminate dead NULL-assignments on argvFree() and argiFree()
Panu Matilainen [Sat, 28 May 2011 16:42:54 +0000 (19:42 +0300)]
Eliminate dead NULL-assignments on argvFree() and argiFree()

13 years agoClean up spec %files -f <manifest> processing
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

13 years agoRemove pointless variable and a dead assignment to it
Panu Matilainen [Sat, 28 May 2011 08:34:51 +0000 (11:34 +0300)]
Remove pointless variable and a dead assignment to it

13 years agoClean up checkFiles() a bit
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

13 years agoEliminate bunch of obvious dead NULL-assingments from misc build parts
Panu Matilainen [Fri, 27 May 2011 13:46:23 +0000 (16:46 +0300)]
Eliminate bunch of obvious dead NULL-assingments from misc build parts

13 years agoRip hysterical hoop-jumping on spec/pkg cpiolist freeing
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?

13 years agoEliminate dead NULL-assignments on parsePolicies() exit
Panu Matilainen [Fri, 27 May 2011 13:20:45 +0000 (16:20 +0300)]
Eliminate dead NULL-assignments on parsePolicies() exit

13 years agoEliminate bunch of obvious dead NULL-assignments from build script code
Panu Matilainen [Fri, 27 May 2011 12:49:09 +0000 (15:49 +0300)]
Eliminate bunch of obvious dead NULL-assignments from build script code

13 years agoEliminate bunch of obvious dead NULL-assignments from rpm generation
Panu Matilainen [Fri, 27 May 2011 12:38:54 +0000 (15:38 +0300)]
Eliminate bunch of obvious dead NULL-assignments from rpm generation

13 years agoEliminate dead NULL-assignments in parseFiles()
Panu Matilainen [Fri, 27 May 2011 11:44:03 +0000 (14:44 +0300)]
Eliminate dead NULL-assignments in parseFiles()

13 years agoEliminate dead NULL-assignments from rpmSpecFree()
Panu Matilainen [Fri, 27 May 2011 11:37:44 +0000 (14:37 +0300)]
Eliminate dead NULL-assignments from rpmSpecFree()

13 years agoEliminate dead NULL-assignments on OFI frees on spec parsing
Panu Matilainen [Fri, 27 May 2011 11:35:14 +0000 (14:35 +0300)]
Eliminate dead NULL-assignments on OFI frees on spec parsing

13 years agoMove build restriction header copying to local scope
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

13 years agoClean up + plug memleak in parseDescription()
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

13 years agoEliminate dead NULL-assignments on exit from parseScript()
Panu Matilainen [Fri, 27 May 2011 11:10:51 +0000 (14:10 +0300)]
Eliminate dead NULL-assignments on exit from parseScript()

13 years agoClean up + fix memleaks in readIcon()
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.

13 years agoEliminate bunch of obvious dead NULL assignments in preamble parsing
Panu Matilainen [Fri, 27 May 2011 10:53:36 +0000 (13:53 +0300)]
Eliminate bunch of obvious dead NULL assignments in preamble parsing

13 years agoMore dead NULL assignments of local variables in filelist processing
Panu Matilainen [Fri, 27 May 2011 10:45:58 +0000 (13:45 +0300)]
More dead NULL assignments of local variables in filelist processing

13 years agoEliminate dead NULL assignments on processMetadataFile() exit
Panu Matilainen [Fri, 27 May 2011 10:33:00 +0000 (13:33 +0300)]
Eliminate dead NULL assignments on processMetadataFile() exit

13 years agoMinor cleanup to doUntar() to eliminate dead assignments on free()
Panu Matilainen [Fri, 27 May 2011 10:25:32 +0000 (13:25 +0300)]
Minor cleanup to doUntar() to eliminate dead assignments on free()

13 years agoClean up rpmfcGenerateDependsHelper() (aka external depgen) a bit
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

13 years agoEliminate a few more dead rpmdsFree() NULL assignments
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...

13 years agoDon't bother NULL'ing everything on rpmfcFree()
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)

13 years agoMinor cleanup to rpmfcExec()
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

13 years agoMinor cleanups to rpmfcGenerateDepends()
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

13 years agoEliminate some dead assignments on rpmdsFree()
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.

13 years agoAdd a helper function for creation namespaced dependency sets, use it
Panu Matilainen [Fri, 27 May 2011 08:52:27 +0000 (11:52 +0300)]
Add a helper function for creation namespaced dependency sets, use it

13 years agoMinor cleanups to rpmfcHelper()
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.

13 years agoEliminate dead assignment, early exit means failure already
Panu Matilainen [Fri, 27 May 2011 08:05:15 +0000 (11:05 +0300)]
Eliminate dead assignment, early exit means failure already

13 years agoCosmetics: rewrap/indent to fit 80 columns
Panu Matilainen [Fri, 27 May 2011 07:59:44 +0000 (10:59 +0300)]
Cosmetics: rewrap/indent to fit 80 columns

13 years agoSanitize handlePreambleTag() error returns
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.

13 years agoEliminate a couple more dead increments in spec parsing code
Panu Matilainen [Fri, 27 May 2011 06:59:55 +0000 (09:59 +0300)]
Eliminate a couple more dead increments in spec parsing code

13 years agoEliminate bunch of dead increments in spec filelist parsing
Panu Matilainen [Fri, 27 May 2011 06:47:38 +0000 (09:47 +0300)]
Eliminate bunch of dead increments in spec filelist parsing

13 years agoClean up rpmrc include processing a bit
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.

13 years agoEliminate two dead increments in rpmrc platform processing
Panu Matilainen [Fri, 27 May 2011 06:35:22 +0000 (09:35 +0300)]
Eliminate two dead increments in rpmrc platform processing

13 years agoHandle readlink() failure in genCpioListAndHeader() correctly
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.

13 years agoAdd test-cases for three RhBug:705115 scenarios
Panu Matilainen [Thu, 26 May 2011 11:24:46 +0000 (14:24 +0300)]
Add test-cases for three RhBug:705115  scenarios

13 years agoAdd tests for multilib file state dependencies
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

13 years agoAdd two basic multilib conflict resolution tests
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.

13 years agoColored conflict resolution part II
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

13 years agoBoth files must be colored for multilib conflict resolution (RhBug:705115)
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.

13 years agoAdd -r flag to find-debuginfo.sh to invoke eu-strip --reloc-debug-sections.
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>
13 years agoDisable all scriptlets and collections centrally on --test and --justdb
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.

13 years agoPermit %verifyscript from non-installed packages
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)

13 years agoDon't run collections on script stages like %pre/posttrans, ugh.
Panu Matilainen [Wed, 25 May 2011 11:03:57 +0000 (14:03 +0300)]
Don't run collections on script stages like %pre/posttrans, ugh.

13 years agoIssue an error on failure to replace original package on signing
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.

13 years agoAdd support for nested Lua macro expansion (RhBug:490740)
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.

13 years agoPlug a memory leak on Lua rpm.expand()
Panu Matilainen [Tue, 24 May 2011 16:59:36 +0000 (19:59 +0300)]
Plug a memory leak on Lua rpm.expand()

13 years agoBail out of debuginfo if stabs format encountered (RhBug:453506)
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.

13 years agoFix %prep parse error to abort build
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.

13 years agoCosmetics: remove redundant/empty doxygen markup, comments etc
Panu Matilainen [Tue, 24 May 2011 12:42:27 +0000 (15:42 +0300)]
Cosmetics: remove redundant/empty doxygen markup, comments etc
- No functional changes.

13 years agoRemove unused length return variables on doHeaderUnload()
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()

13 years agoHandle HEADERFLAG_SORTED bit correctly in headerUnsort()
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.

13 years agoReturn explicit NULL on errors + frees in header code
Panu Matilainen [Tue, 24 May 2011 10:47:25 +0000 (13:47 +0300)]
Return explicit NULL on errors + frees in header code

13 years agoDo not die on empty changelog section
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>
13 years agoDistinguish between macro primitives with and w/o arguments
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

13 years agoAdd support for fileattr dependency namespacing
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.

13 years agoWhoops, flags needs to be sorted for argvSearch() to work correctly
Panu Matilainen [Mon, 23 May 2011 09:32:27 +0000 (12:32 +0300)]
Whoops, flags needs to be sorted for argvSearch() to work correctly

13 years agoUnify fileattr include- and exclude-rule handling
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.

13 years agoDon't fetch missing sources on spec query
Panu Matilainen [Fri, 20 May 2011 12:20:49 +0000 (15:20 +0300)]
Don't fetch missing sources on spec query

13 years agoUnbreak %if, %if(n)arch, %if(n)os handling
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

13 years ago-D is for --define, not --predefine (RhBug:706161)
Panu Matilainen [Fri, 20 May 2011 07:05:02 +0000 (10:05 +0300)]
-D is for --define, not --predefine (RhBug:706161)

13 years agoSupport "magic_and_path" flag in fileattrs
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>
13 years agoRemove redundant NULL checks
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.

13 years agoFix error handling in payload copying
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...)

13 years agoEliminate dead cpio_copy() + related stuff
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

13 years agoUpdate translations to pick up changes from the script file cleanups
Panu Matilainen [Wed, 18 May 2011 10:37:18 +0000 (13:37 +0300)]
Update translations to pick up changes from the script file cleanups

13 years agoFurther simplify & cleanup script file (error) handling
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.

13 years agoClean up addFileToTagFoo() helpers
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.

13 years agoMinor cleanups to cpio_doio()
Panu Matilainen [Wed, 18 May 2011 09:04:12 +0000 (12:04 +0300)]
Minor cleanups to cpio_doio()
- Remove redundant rpmtsEmpty(), this is done from rpmtsFree() anyway
- Dont bother NULL'ing local variables at exit

13 years agoSimplify rpmio flags handling in writeRPM() / cpio_doio()
Panu Matilainen [Wed, 18 May 2011 08:55:59 +0000 (11:55 +0300)]
Simplify rpmio flags handling in writeRPM() / cpio_doio()
- The payload macros are already expanded in writeRPM(), no point
  re-expanding in cpio_doio() and handle fallback to default gzdio
  in writeRPM() already in case the payload is not set in config
  or is bogus. Also rpmExpand() cannot return NULL so there's no
  point in checking for that.

13 years agoPlug a minor memleak on writeRPM() error paths
Tero Aho [Wed, 18 May 2011 08:10:09 +0000 (11:10 +0300)]
Plug a minor memleak on writeRPM() error paths

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoEliminate bogus ferror() checks
Panu Matilainen [Wed, 18 May 2011 07:59:54 +0000 (10:59 +0300)]
Eliminate bogus ferror() checks
- 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.

13 years agoAlways copy macro source when expanding it
Michael Schroeder [Wed, 18 May 2011 06:04:40 +0000 (09:04 +0300)]
Always copy macro source when expanding it
- 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>
13 years agoEmpty transaction is not an error (RhBug:699929)
Panu Matilainen [Wed, 18 May 2011 05:28:07 +0000 (08:28 +0300)]
Empty transaction is not an error (RhBug:699929)
- Empty transaction just means we have nothing at all to do,
  but it's not an actual error.

13 years agoDo not abort if chown/chmod fails but the file is already correct
Michael Schroeder [Tue, 17 May 2011 12:46:54 +0000 (15:46 +0300)]
Do not abort if chown/chmod fails but the file is already correct
- This small patch makes rpm not abort the installation if
  chown()/chmod() failed but the files already have the correct
  ownership/mode. It also allows a failed mtime update on directories.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoFix segfault on build with empty %prep section
Michael Schroeder [Mon, 16 May 2011 08:57:44 +0000 (11:57 +0300)]
Fix segfault on build with empty %prep section

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoFix "method not permitted before handle's open method" on --verifydb
Michael Schroeder [Fri, 13 May 2011 12:33:55 +0000 (15:33 +0300)]
Fix "method not permitted before handle's open method" on --verifydb
- In verify mode, the db is not really opened, thus it's an error
  to call dbiFlags() which calls db->get_open_flags().

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoClean up file type verification logic a bit
Panu Matilainen [Tue, 3 May 2011 12:02:42 +0000 (15:02 +0300)]
Clean up file type verification logic a bit
- Non-regular files mostly share the same unverifiable properties,
  no point in listing all the cases separately. Links are a notable
  exception in that they're different from everything else, handle
  that separately.
- Also clean up other formatting: wrap lines at a better point +
  avoid multiline-comments when single line suffices.

13 years agoRemove obsolete timedRead() from API
Jindrich Novy [Tue, 3 May 2011 08:42:53 +0000 (10:42 +0200)]
Remove obsolete timedRead() from API

13 years agoRIP rpmsqFork() + rpmsqWait() and the related bits
Panu Matilainen [Tue, 3 May 2011 08:19:37 +0000 (11:19 +0300)]
RIP rpmsqFork() + rpmsqWait() and the related bits
- Also remove additional thread protection: we're not supporting
  threads anywhere else either. If/when thread-protection is added,
  this is ulikely to be the first place anyway...

13 years agoUse good ol' fork() + waitpid() for running scriptlets
Panu Matilainen [Mon, 2 May 2011 10:00:53 +0000 (13:00 +0300)]
Use good ol' fork() + waitpid() for running scriptlets
- We have no need for anything fancier, this makes 80% of the
  overly complex & subtle semi-threaded and in places just broken
  code in rpmsq.[ch] unused and unnecessary.

13 years agoRemove unneeded regex grouping.
Ville Skyttä [Sun, 24 Apr 2011 12:59:20 +0000 (15:59 +0300)]
Remove unneeded regex grouping.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoComment spelling fix.
Ville Skyttä [Sun, 24 Apr 2011 12:58:40 +0000 (15:58 +0300)]
Comment spelling fix.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoAdd lrzip support.
Ville Skyttä [Sun, 24 Apr 2011 12:57:23 +0000 (15:57 +0300)]
Add lrzip support.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoAdd lzip support.
Ville Skyttä [Sun, 24 Apr 2011 12:56:11 +0000 (15:56 +0300)]
Add lzip support.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoRemove duplicate fpLookup() doxygen annotation
Panu Matilainen [Thu, 28 Apr 2011 12:23:10 +0000 (15:23 +0300)]
Remove duplicate fpLookup() doxygen annotation

13 years agoRemove redundant strlen()'s on sha1 digest verification
Panu Matilainen [Thu, 28 Apr 2011 07:31:23 +0000 (10:31 +0300)]
Remove redundant strlen()'s on sha1 digest verification
- string comparison notices different length anyway, avoid going
  through the same data twice

13 years agoAvoid malloc() + redundant strlen() calls in dbiFindByLabel()
Panu Matilainen [Wed, 27 Apr 2011 13:11:57 +0000 (16:11 +0300)]
Avoid malloc() + redundant strlen() calls in dbiFindByLabel()

13 years agoSimplify findTag()
Jindrich Novy [Thu, 28 Apr 2011 11:22:41 +0000 (13:22 +0200)]
Simplify findTag()

13 years agoFix find-lang so that it finds *@*.qm QT i18n files (RhBug:699945)
Jindrich Novy [Wed, 27 Apr 2011 08:28:43 +0000 (10:28 +0200)]
Fix find-lang so that it finds *@*.qm QT i18n files (RhBug:699945)

13 years agoUnderstand 'PK00' zip archives (RhBug:699529)
Jindrich Novy [Tue, 26 Apr 2011 04:33:19 +0000 (06:33 +0200)]
Understand 'PK00' zip archives (RhBug:699529)
- it is historically used by PKZIP when storing archive to removable
  media (floppy), some java apps still use it
- thanks to Karel Klic

13 years agoDo not compile unused functions when SELinux support is disabled
Jindrich Novy [Fri, 22 Apr 2011 07:30:45 +0000 (09:30 +0200)]
Do not compile unused functions when SELinux support is disabled

13 years agoHandle errors from moving target file into place in rpmSign()
Panu Matilainen [Thu, 21 Apr 2011 08:09:28 +0000 (11:09 +0300)]
Handle errors from moving target file into place in rpmSign()
- Signing isn't successful unless we manage to replace the original
  file with the signed one, take the stat() etc returns into count.

13 years agoheaderPut() and headerDel() returns aren't interesting here
Panu Matilainen [Thu, 21 Apr 2011 07:55:00 +0000 (10:55 +0300)]
headerPut() and headerDel() returns aren't interesting here

13 years agoRemove redundant indentation block from rpmSign()
Panu Matilainen [Thu, 21 Apr 2011 07:47:31 +0000 (10:47 +0300)]
Remove redundant indentation block from rpmSign()
- No code changes, just formatting sanity/prettiness

13 years agoJust ignore miFreeHeader() return on rpmdbNextIterator() too
Panu Matilainen [Thu, 21 Apr 2011 07:13:45 +0000 (10:13 +0300)]
Just ignore miFreeHeader() return on rpmdbNextIterator() too
- There's no meaningful way to return a write-error here,
  rpmdbNextIterator() caller wouldn't know whether NULL at termination
  is early due to error or not. So just ignore the return from
  miFreeHeader(), it can only fail on rewrite mode (ie markReplacedFiles())
  so impact is rather limited anyway.

13 years agoIgnore dbiSync() return code everywhere
Panu Matilainen [Thu, 21 Apr 2011 07:03:11 +0000 (10:03 +0300)]
Ignore dbiSync() return code everywhere
- Since we're not checking the return then dont bother storing it either.
  The sync is fairly unlikely to fail if other operations succeed
  as sync failures generally revolve around invalid file descriptors etc.

13 years agoOops, thinko/typo in commit 8215e17c248f91f501bd8a2968dfadf896a350ce
Panu Matilainen [Wed, 20 Apr 2011 13:11:41 +0000 (16:11 +0300)]
Oops, thinko/typo in commit 8215e17c248f91f501bd8a2968dfadf896a350ce

13 years agoRemove pointless xx tmp return code from dbiAppendSet() result
Panu Matilainen [Wed, 20 Apr 2011 12:50:24 +0000 (15:50 +0300)]
Remove pointless xx tmp return code from dbiAppendSet() result