summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-07-01Fix the totally broken rpm.fd() read methodPanu Matilainen1-20/+25
2011-07-01Add basic test for rpmio python bindingsPanu Matilainen1-0/+24
2011-06-28Fix explicit directory %attr() when %defattr() is active (RhBug:481875)Panu Matilainen2-31/+22
- parseForAttr() doesn't know whether it's dealing with a directory or a file, so it can't know which defaults it should use. Move all the decision making on which of the explicit/default/implicit attributes into addFile() where we do know what kind of entry we're dealing with, and only parse in parseForAttr(). - Update the test-case status to expect success now.
2011-06-28Add a test-case for various %attr and %defattr combinationsPanu Matilainen3-0/+101
- Currently this fails expectedly due to RhBug:681540 on the last directory of the test rpm.
2011-06-28Enable GLOB_ONLYDIR of the bundled glob() on platforms that support itPanu Matilainen2-2/+2
2011-06-27Pay attention to dir vs file when building (RhBug:505995)Panu Matilainen1-3/+18
- Preserve trailing slash if it exists, and also add one on explicit %dir entires. This lets rpmGlob() and friends to skip any matching files that might be present, fixing both test-cases in RhBug:505995.
2011-06-27Honor trailing slash in rpmGlob()Panu Matilainen1-1/+16
- Only return directories if a pattern contains a trailing slash. Use GLOB_ONLYDIR hint if available but as this is unreliable, we need to stat the paths to be sure. - Hysterically enough, rpm bundles its own copy of glob() which does have GLOB_ONLYDIR but ATM it doesn't get build because HAVE_D_TYPE isn't defined outside glibc build environment which is where our glob originally came from...
2011-06-27Remove ugly isDir recurse prevention hack on buildPanu Matilainen1-6/+2
- We know if we're already fts-walking by the way addFile() gets called, dont corrupt fl->isDir for no good reason.
2011-06-23Eliminate static BUFSIZ use in filelist parsingPanu Matilainen1-1/+1
- In the unlikely event of filelist line being longer than BUFSIZ we'd previously end up truncating the line, which is stupid since we can just as easily make the buffer large enough.
2011-06-21Use ARGV_t for filelist current locale storagePanu Matilainen1-75/+32
- Avoids having to manually do search, sort, join, free etc for no good reason. Could be further simplified with argvSplit() etc and sanitized overall but leaving that for another day...
2011-06-21Eliminate redundant noGlob member from filelistPanu Matilainen1-9/+2
- Since the only thing where globs are not permitted are %dev entires, check for device explicitcly in the glob part. Doh.
2011-06-21Eliminate redundant special docs tracking members in filelistPanu Matilainen1-12/+2
2011-06-21Eliminate unused fileCount member from FileList structPanu Matilainen1-3/+0
2011-06-17Add DWARF-4 support to debugedit (RhBug:707677)Jakub Jelinek1-7/+20
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-06-17Avoid extra newlines in parsed spec output outside preamblePanu Matilainen1-1/+1
2011-06-17Add --parse option to rpmspec tool to dump parsed spec contentsPanu Matilainen1-0/+20
- This is somewhat like 'gcc -E', useful for analyzing/troubleshooting what happens inside the preprocessing.
2011-06-17Support retrieving the spec contents in parsed formatPanu Matilainen4-1/+15
- Collect the preprocessed (conditionals, macros etc evaluated) lines to a separate stringbuf, make rpmSpecGetSection() return that on RPMBUILD_NONE "section" (hack, but so is abusing RPMBUILD_FOO for the section here so shrug)
2011-06-16Error on unclosed macros & trailing line continuations in spec (RhBug:681567)Panu Matilainen1-1/+11
- Track the starting line in case copyNextLineFromOFI() indicates a multiline-construct. If we get an EOF from readLineFromOFI() while inside multiline read, its an illegal construct of some kind and we can even spit out a reasonably meaningful error pointing out the starting line number of the bad construct.
2011-06-16Try to generate fileclass in the tag ext at runtime if missing from headerPanu Matilainen1-21/+55
- For non-regular files we can easily generate this information based on file mode + in case of symlinks, the link target is available in the header elsewhere. This also means --fileclass will return at least partial data for packages built with the external depgen. - Clean up fileclassTag() a bit while at it, removing redundant fluff. - Arguably this "magic" should be done inside rpmfiFClass() instead, but that'd require changing the API to return malloced data.
2011-06-16Export rpmteFailed() to python bindingsPanu Matilainen1-0/+7
- Kinda related to RhBug:661962, yum relies on callbacks to catch install/erase errors but this is not accurate: on erase the element can be ambiguous as the callback only gives a name (sigh). In addition, elements can be skipped entirely if "parent" element fails, in which case no callbacks are issued so these cases would go completely unnoticed when relying on callbacks alone. te.Failed() gives users such as yum a chance to have a look at the real status of elements (after the transaction).
2011-06-13Don't remove buildroot docdir on %doc usage (ticket #836)Panu Matilainen1-1/+0
- Some software installs its own documentation and if you try to combine it with %doc, rpmbuild will abort with mysterious "cpio bad magic" or such errors because what was assumed to be there was not, as %doc would 'rm -rf' the docdir upon first invocation. I don't see any good reason to disallow sharing the same directory for %doc and documentation installed by software "make install" - the other alternative would be forcing %doc to go to some other location, only making docs harder to find. - Also at least Mageia (and prior to that Mandriva) has been doing this for quite some time now.
2011-06-10Adjust script detection rules to work with file >= 5.07 too (RhBug:712251)Panu Matilainen2-3/+4
- Somewhere between file 5.05 and 5.07 it started adding encoding to script descriptions, eg "<mumble> script text executable" became "<mumble> script, <encoding> text executable" breaking what had been working for 10+ years in the case of old find-requires. - Permit either comma or space after "script", this works for both old and new file.
2011-06-09Add bunch of further rpm-python tests for this and thatPanu Matilainen1-0/+68
2011-06-09Eww, python ds.Instance() doesn't take any argumentsPanu Matilainen1-1/+1
- ...means its been broken all along, sigh
2011-06-09Add a bunch of db match/key iterator test-cases in pythonPanu Matilainen1-0/+72
- This would've caught the breakage introduced in commit 7e4415fcc5e11cfd4cd9d0dfe19568be73f15d74, but better late than never...
2011-06-09Rearrange test-suite python helper macros a bitPanu Matilainen3-8/+14
- Handle double [] "escaping" at RPM_PYRUN to avoid surprises when its used on its own - Spin python-wrapped AT_CHECK into a macro of its own (RPMPY_CHECK) - What formerly was RPMPY_CHECK is now RPMPY_TEST: this represents one entire testcase with all its setup and cleanup, whereas RPMPY_CHECK (the new one) might be used several times within a single test
2011-06-09Fix the non-keyed match iteration case wrt DB_NOTFOUNDPanu Matilainen1-0/+4
- This broke in commit 7e4415fcc5e11cfd4cd9d0dfe19568be73f15d74, the cases are not identical afterall: With non-keyed cursor retrievals DB_NOTFOUND is returned when there's nothing more to get, this is not an error situation.
2011-06-09Use dbiCursorGetToSet() for the non-keyed match-iterator case tooPanu Matilainen1-21/+3
2011-06-09Support set append in dbiCursorGetToSet()Panu Matilainen1-1/+9
- If called with an existing set, results are appended. Otherwise return a newly allocated set.
2011-06-09If key not specified, use DB_NEXT cursor mode (DB_SET wouldn't make sense)Panu Matilainen1-2/+4
2011-06-09Only honor keylen if keyp is also specifiedPanu Matilainen1-2/+4
2011-06-09Make it an error to call dbiGetToSet() with NULL keypPanu Matilainen1-2/+2
- All current callers always supply non-NULL keyp, and requiring this gives useful possibilities elsewhere
2011-06-08Move the remaining DBT's in rpmdbInitIterator() to (more) local scopePanu Matilainen1-4/+4
2011-06-08Error/notfound case is handled the same for both these casesPanu Matilainen1-9/+5
2011-06-08Take advantage of dbiCursorGetToSet() in dbiFindByLabel() & friendsPanu Matilainen1-31/+13
- Reduces the number of arguments to somewhat saner level and eliminates another reincarnation of the dbt2set() + error handling code littered all over the place.
2011-06-08Split actual cursor get + set-conversion to separate functionPanu Matilainen1-9/+22
- Allows multiple retrieves on a single cursor instance, dbiGetToSet() is just a convenience wrapper around dbiCursorGetToSet() now. - Creating and tearing down cursors isn't exactly terrifyingly expensive but still measurable when lots of lookups are done.
2011-06-08Add cursor method for retrieving the underlying db index handlePanu Matilainen2-0/+12
2011-06-08Add tests for the most common nvra query combinationsPanu Matilainen1-2/+9
2011-06-08Use dbiGetToSet() in rpmdbFindByFile(), lose now unnecessary argumentsPanu Matilainen1-25/+4
2011-06-08Use dbiGetToSet() for the common case in rpmdbInitIterator()Panu Matilainen1-23/+2
2011-06-08Simplify + cleanup rpmdbExtendIterator()Panu Matilainen1-35/+14
- Use the new dbiGetToSet() for doing the actual work, reducing fluff considerably - Don't bother checking for NULLs where the lower levels do it already (mi and keyp NULL-checks are necessary here though)
2011-06-08Simplify + cleanup rpmdbCountPackages()Panu Matilainen1-32/+9
- Use the new dbiGetToSet() for doing the actual work, reducing fluff considerably - Dont bother checking for NULL db, rpmdbOpenIndex() does this anyway - Return an error, not 0 (ie "not found") for NULL db and name - Remove redundant dbtag variable, this is always RPMDBI_NAME
2011-06-08Add a helper function to convert cursor retrievals to dbiIndexSetsPanu Matilainen1-0/+33
- This stuff is repeated in rpmdb.c all over the place, to some this suggests making it into a function: - Hide the DBTs inside the function - Handle keylen fixups, set conversions and error logging centrally
2011-06-08Rename dbiFreeIndexSet() to dbiIndexSetFree() for naming style consistencyPanu Matilainen1-17/+17
2011-06-08Minor cleanup to rpmdbFindByFile()Panu Matilainen1-10/+7
- Pass the dbi we already opened in rpmdbInitIterator() as argument instead of unnecessarily reopening in rpmdbFindByFile() - Adjust the argument order to match that of dbiFindByLabel() for consistency - Remove redundant error code assignment, we are already assuming error
2011-06-08Push cursor init+free down to dbiFindByLabel()Panu Matilainen1-6/+7
- The cursor is fully local to dbiFindByLabel() so there's no point passing it as an argument
2011-06-08Handle EINTR on the spot instead of restarting the entire loopPanu Matilainen1-14/+20
- The previous code was violating the "golden rules of select()" by possibly skipping processing of fd's that were included in the select() set. Also restarting the entire loop should not be necessary in case of EINTR select(), our conditions do not change in that situation.
2011-06-08Kick out self-pipe trick from depgen helperPanu Matilainen1-43/+1
- As we're not actually /doing/ anything with signals here, the self-pipe is not needed: select() will get interrupted and re-evaluated when the child exits so we can't get stuck there. - Free "I spotted a classic dailywtf overcomplication" t-shirt goes to Michael Schroeder for pointing this out.
2011-06-08Abort depgen output reading on EOF, not child exitingPanu Matilainen1-2/+2
- There could, at least in theory, still be data to read after we receive SIGCHLD. Stop the loop on EOF on read instead. Thanks to Michael Schroeder for pointing this out.
2011-06-06Return explicit NULL from dbiFreeIndexSet()Panu Matilainen1-3/+4
- Explicit NULL is much more obvious here, also eliminate the (now) dead NULL-assignments and add a trash-n-burn memset() just in case