tools/librpm-tizen.git
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

13 years agoEliminate last three assert()'s from the backend
Panu Matilainen [Wed, 20 Apr 2011 12:41:53 +0000 (15:41 +0300)]
Eliminate last three assert()'s from the backend
- We can trivially handle these "can't happen" cases as EINVAL returns
  instead of blowing up, do so.

13 years agoAnd finally at six feet, the old cursor api is officially dead
Panu Matilainen [Wed, 20 Apr 2011 12:38:40 +0000 (15:38 +0300)]
And finally at six feet, the old cursor api is officially dead
- Inline the last remains into the new api, handling NULL pointers
  more gracefully than the old version

13 years agoAnd another foot deeper...
Panu Matilainen [Wed, 20 Apr 2011 12:22:42 +0000 (15:22 +0300)]
And another foot deeper...
- Inline dbiGet(), dbiPut(), dbiDel() and dbiCount() implementations
  to the new interface

13 years agoBury the old cursor api one foot deeper
Panu Matilainen [Wed, 20 Apr 2011 12:04:44 +0000 (15:04 +0300)]
Bury the old cursor api one foot deeper
- Make it static and move doxygen bits to the new API, adjust as necessary

13 years agoConvert the other (rpmdb iterators etc) uses to the new cursor api
Panu Matilainen [Wed, 20 Apr 2011 11:49:14 +0000 (14:49 +0300)]
Convert the other (rpmdb iterators etc) uses to the new cursor api

13 years agoConvert local-only uses of DBC to dbiCursor interface
Panu Matilainen [Wed, 20 Apr 2011 11:23:37 +0000 (14:23 +0300)]
Convert local-only uses of DBC to dbiCursor interface

13 years agoAdd a db cursor abstraction and interfaces for using it
Panu Matilainen [Wed, 20 Apr 2011 10:52:41 +0000 (13:52 +0300)]
Add a db cursor abstraction and interfaces for using it
- Callers are currently required to pass all sorts of unnecessary
  gunk to the cursor operations just for performance statistics
  etc, and the interface doesn't match the uses inside rpmdb.c
  very well. This adds a more "rpm-style" interface around the
  BDB API.
- Cursor open + close can only fail on invalid arguments (which would
  be programmer errors), and various conditions on replication which
  we dont care about. So we essentially ignore the errors, except
  for cursor open which will return NULL to indicate an error.
- As an intermediate step, these are just wrappers to the older
  dbiFoo interfaces to permit converting things to the new interfaces
  piece by piece.

13 years agoRename _dbConfig and _dbiIndex structs to common foo_s style
Panu Matilainen [Wed, 20 Apr 2011 10:23:57 +0000 (13:23 +0300)]
Rename _dbConfig and _dbiIndex structs to common foo_s style
- No functional changes, just renaming to be in line with everything
  else (for better or worse)

13 years agoRemove non-cursor support from dbiDel(), dbiPut() and dbiGet()
Panu Matilainen [Wed, 20 Apr 2011 10:18:54 +0000 (13:18 +0300)]
Remove non-cursor support from dbiDel(), dbiPut() and dbiGet()
- Previously these functions would silently fall back to non-cursor
  access when (accidentally) called with NULL cursor. This can lead
  to different results for cases where cursor is actually required,
  without any indication of it being an error. Make them fail
  with EINVAL for NULL cursors so it gets trapped in rpmdb.c uses.

13 years agoReturn explicit NULL's from db iterator free functions for clarity
Panu Matilainen [Tue, 19 Apr 2011 10:46:41 +0000 (13:46 +0300)]
Return explicit NULL's from db iterator free functions for clarity

13 years agoIgnore error codes in rpmdbIndexIteratorFree()
Panu Matilainen [Tue, 19 Apr 2011 10:42:46 +0000 (13:42 +0300)]
Ignore error codes in rpmdbIndexIteratorFree()
- Similarly to commit b35081600135b4a3d54fa7e832125a89d3bdee48,
  we can't do anything about dbiCclose() failure here, just ignore.

13 years agoIgnore error codes in rpmdbFreeIterator()
Panu Matilainen [Tue, 19 Apr 2011 10:34:02 +0000 (13:34 +0300)]
Ignore error codes in rpmdbFreeIterator()
- We can't do anything about miFreeHeader() or dbiClose() errors
  here, no point storing them to temp variable either. Error on
  miFreeHeader() will at least log something on header rewrite-failure.

13 years agoAttempt to fetch sources/patches when they are missing from %_sourcedir
Jindrich Novy [Tue, 19 Apr 2011 11:24:34 +0000 (13:24 +0200)]
Attempt to fetch sources/patches when they are missing from %_sourcedir
- use _default_source_url macro to specify default URL when it is
  missing from the spec Source/Patch line
- this feature can be disabled by defining _disable_source_fetch to 1

13 years agoGive at least some indication of error from fchdir() failures
Panu Matilainen [Tue, 19 Apr 2011 10:21:36 +0000 (13:21 +0300)]
Give at least some indication of error from fchdir() failures
- Failure to return to current dir is likely to be lethal, at least
  log an error and return a different code for it.

13 years agoUse rpmsqFork() return code instead of semi-private struct member for pid
Panu Matilainen [Tue, 19 Apr 2011 10:08:28 +0000 (13:08 +0300)]
Use rpmsqFork() return code instead of semi-private struct member for pid
- rpmsqFork() behaves like regular fork() in this regard so this
  just makes the code more obvious and eliminates an set-but-unused
  warning while at it.

13 years agoFclose() and unlink() errors aren't fatal here, just ignore
Panu Matilainen [Tue, 19 Apr 2011 10:04:28 +0000 (13:04 +0300)]
Fclose() and unlink() errors aren't fatal here, just ignore

13 years agoCatch write errors when generating scriptlet temporary files
Panu Matilainen [Tue, 19 Apr 2011 09:59:07 +0000 (12:59 +0300)]
Catch write errors when generating scriptlet temporary files
- If the write fails scripts are likely to fail anyway, but executing
  partial scriptlets (unlikely as that might be) could have funny
  side-effects besides just failing.
- Also cleans up runExtScript() a little bit by moving the
  tmp file creation to a separate function.

13 years agoImprove fsm error code handling in psm
Panu Matilainen [Tue, 19 Apr 2011 08:37:11 +0000 (11:37 +0300)]
Improve fsm error code handling in psm
- Move the fsm execution to separate helper function, returning
  the most relevant exit code: if fsmSetup() failed then teardown
  return doesn't matter, but fsmTeardown() can report errors
  from missing hardlinks which we haven't checked until now.
- This also fixes enum vs int abuse on the exit code: fsm return
  codes are cpio error codes whereas psm codes are simple ok/fails.

13 years agoActually handle headerGet() / pgpPrtPkts() failure on signature verify
Panu Matilainen [Tue, 19 Apr 2011 07:32:31 +0000 (10:32 +0300)]
Actually handle headerGet() / pgpPrtPkts() failure on signature verify
- Failure to decode the hash algo here would probably trip up something
  later on in the verification but...

13 years agoEliminate unused variable in rpmpluginsAdd()
Panu Matilainen [Tue, 19 Apr 2011 07:21:26 +0000 (10:21 +0300)]
Eliminate unused variable in rpmpluginsAdd()
- dlsym() can return NULL without it being an error, and since we
  use dlerror() for determining the error anyway, supportedHooks
  is simply unneeded here.

13 years agoRestore previous vsflags on return from rpmInstall() and rpmErase()
Panu Matilainen [Tue, 19 Apr 2011 07:09:22 +0000 (10:09 +0300)]
Restore previous vsflags on return from rpmInstall() and rpmErase()
- Nobody is going to care really but since we bother remembering
  them we might as well restore them too, silencing another two
  set-but-unused warnings (this time semi-meaningful even)

13 years agoEliminate another set-but-unused xx warning
Panu Matilainen [Tue, 19 Apr 2011 07:02:23 +0000 (10:02 +0300)]
Eliminate another set-but-unused xx warning
- There's no meaningful way to return error from rpmdbExtendIterator()
  in rpmFindBaseNamesInDB() so dont bother collecting the result.
  At least there'll be rpmlog spew on errors so it wouldn't be
  silently failing.

13 years agoReflect file classifier errors in rpmdeps exit code
Panu Matilainen [Mon, 18 Apr 2011 09:25:43 +0000 (12:25 +0300)]
Reflect file classifier errors in rpmdeps exit code
- rpmfcClassify() or rpmfcApply() failing is pretty fatal to rpmdeps,
  exit with error code
- OTOH argvAdd() and argvSort() can't really fail, ignore their return
  codes, shutting up another set-but-not-used whine

13 years agoRemove yet another pointless tmp variable
Panu Matilainen [Mon, 18 Apr 2011 09:08:24 +0000 (12:08 +0300)]
Remove yet another pointless tmp variable
- Since we're not really interested in rpmdbClose() or
  rpmdbRemoveDatabase() error codes when rebuilding, just ignore
  their returns

13 years agoCollect proper exit status from rpmdbRemoveDatabase()
Panu Matilainen [Mon, 18 Apr 2011 09:04:34 +0000 (12:04 +0300)]
Collect proper exit status from rpmdbRemoveDatabase()
- The single caller doesn't actually care about its exit code
  as its not particularly important in that case but .. shrug,
  at least it silences a warning.

13 years agoIgnore rpmdbClose() return on failed rpmdbOpen()
Panu Matilainen [Mon, 18 Apr 2011 09:00:44 +0000 (12:00 +0300)]
Ignore rpmdbClose() return on failed rpmdbOpen()
- We can't do anything about it so just ignore and remove the
  unused variable

13 years agoClean up urlGetFile() return values
Panu Matilainen [Mon, 18 Apr 2011 07:13:24 +0000 (10:13 +0300)]
Clean up urlGetFile() return values
- Its callers only care about success vs failure, so only ever return
  0 or -1 and take waitpid() errors into account too. As a side effect
  shuts up a set-but-unused compiler warning too

13 years agoRemember to free db index iterators too on forced termination
Panu Matilainen [Fri, 15 Apr 2011 07:35:34 +0000 (10:35 +0300)]
Remember to free db index iterators too on forced termination

13 years agoFix dangling databases from iterators (ticket #820)
Panu Matilainen [Fri, 15 Apr 2011 07:11:41 +0000 (10:11 +0300)]
Fix dangling databases from iterators (ticket #820)
- Call rpmdbClose() instead of rpmdbUnlink() on iterator free to
  actually close the db when refcount goes to zero. This
  fixes the situation where a caller closes a database handle
  while iterators are active: the iterators stay usable and close
  the db when the last one exits.

13 years agoOnly muck with signals on first and last db open/close
Panu Matilainen [Fri, 15 Apr 2011 06:18:15 +0000 (09:18 +0300)]
Only muck with signals on first and last db open/close
- Signals are per-process global, as long as there are other
  databases open (or references to the same db) we shouldn't mess
  with them. Less important on open, but if somebody is changing
  rpmsq-handling we shouldn't override that either.

13 years agoExtract perl dependecies from "use parent qw(Foo)".
Ville Skyttä [Wed, 6 Apr 2011 17:56:31 +0000 (20:56 +0300)]
Extract perl dependecies from "use parent qw(Foo)".

parent is a successor to base, with similar functionality.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoHonor $TMPDIR in various scripts.
Ville Skyttä [Tue, 1 Mar 2011 15:23:17 +0000 (17:23 +0200)]
Honor $TMPDIR in various scripts.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoUnbreak obsoletes from commit b1a4b57315d31ba98bc0e5803db1ebc2517f6bb5
Panu Matilainen [Wed, 13 Apr 2011 07:04:28 +0000 (10:04 +0300)]
Unbreak obsoletes from commit b1a4b57315d31ba98bc0e5803db1ebc2517f6bb5
- rpmdsMatchesDep() only works with RPMDBI_PROVIDES, not RPMDBI_NAME.
  Revert that part of the change.

13 years agoDont reference transaction set from transaction elements
Panu Matilainen [Tue, 5 Apr 2011 14:33:12 +0000 (17:33 +0300)]
Dont reference transaction set from transaction elements
- Elements referencing ts prevents rpmtsFree() from freeing anything
  unless the caller does rpmtsEmpty() first. Oops. Undo the braindamage
  from commit 8f7c2d7063df6d1057425d014ce4168d46c5e7d9.

13 years agoDon't list packages which will not be created in spec query (RhBug:693338)
Jindrich Novy [Mon, 4 Apr 2011 14:03:11 +0000 (16:03 +0200)]
Don't list packages which will not be created in spec query (RhBug:693338)
- particularly, while doing "rpm -q --specfile <a spec file>"

13 years agoUpdate INSTALL a bit, include blurb about the test-suite + fakechroot
Panu Matilainen [Mon, 4 Apr 2011 11:39:19 +0000 (14:39 +0300)]
Update INSTALL a bit, include blurb about the test-suite + fakechroot

13 years agoOnly enable test-suite if fakechroot is available
Panu Matilainen [Mon, 4 Apr 2011 11:31:17 +0000 (14:31 +0300)]
Only enable test-suite if fakechroot is available

13 years agoExecute all non-compilation rpmbuild tests in fakechroot
Panu Matilainen [Mon, 4 Apr 2011 11:05:17 +0000 (14:05 +0300)]
Execute all non-compilation rpmbuild tests in fakechroot
- Except for four rpmbuild tests which rely on an actual compiler
  being available (faking *that* would get entertaining...), the entire
  test-suite is now executing everything in the fakechroot environment.

13 years agoAdd more stuff to test-suite root environment
Panu Matilainen [Mon, 4 Apr 2011 11:00:23 +0000 (14:00 +0300)]
Add more stuff to test-suite root environment
- Build needs a whole bunch of utilities there, including file + its
  magic database. The exact location of the magic db varies between
  systems but file -C lets us basically make a copy of the system magicdb
  into the fakechroot env and then we can override the location with MAGIC

13 years agoSwitch more test-suite builds to run under fakechroot
Panu Matilainen [Mon, 4 Apr 2011 09:13:56 +0000 (12:13 +0300)]
Switch more test-suite builds to run under fakechroot
- This leaves only the "real" builds where the packages contain files
  to be executed outside fakechroot

13 years agoRun dependency tests entirely in fakechroot
Panu Matilainen [Mon, 4 Apr 2011 09:03:38 +0000 (12:03 +0300)]
Run dependency tests entirely in fakechroot
- All the packages here have no files making them "easy" to build
  inside the chroot

13 years agoPrepare the test root entirely from Makefile, add missing bits
Panu Matilainen [Mon, 4 Apr 2011 09:01:43 +0000 (12:01 +0300)]
Prepare the test root entirely from Makefile, add missing bits
- Running builds in fakechroot needs a whole lot of things.. add symlinks
  to various system config + dev files to give some trivial packages
  a chance to build under fakechroot

13 years agoRemove redundant data copying into test-suite root
Panu Matilainen [Mon, 4 Apr 2011 08:39:25 +0000 (11:39 +0300)]
Remove redundant data copying into test-suite root

13 years agoAvoid leaking our compilation directory into test-suite
Panu Matilainen [Mon, 4 Apr 2011 08:27:03 +0000 (11:27 +0300)]
Avoid leaking our compilation directory into test-suite
- Since they're running in fakechroot there's no need to arrange
  user writable directories this way

13 years agoAdjust rpmdb path for all remaining non-fakeroot runs
Panu Matilainen [Fri, 1 Apr 2011 14:48:07 +0000 (17:48 +0300)]
Adjust rpmdb path for all remaining non-fakeroot runs
- Executing rpmbuild in the fakeroot gets fairly tricky, especially
  for the tests that actually compile things. Overriding the dbpath
  prevents it from accessing system rpmdb for keyring and build-requires.
- With this patch, the test-suite now passes the smoke-test of
  "chmod go-rx /var/lib/rpm" on system rpmdb.

13 years agoAdjust rpmdb path in python tests
Panu Matilainen [Fri, 1 Apr 2011 14:44:35 +0000 (17:44 +0300)]
Adjust rpmdb path in python tests
- We can't run python easily in the chroot so override the dbpath
  to our test area instead of potentially accessing the system db
  for keyring etc