summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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
2011-06-06Cosmetics: function blocks start on a new linePanu Matilainen1-4/+8
2011-06-01Lift Dijkstra algorithm out of collectSCC() to separate functionPanu Matilainen1-21/+24
- This splits outs nicely, moving queue allocation into separate scope and making collectSCC() less of an heavy-weight. No functional changes.
2011-06-01Eliminate struct copy in collectSCC(), use a pointer insteadPanu Matilainen1-8/+8
- collectSCC() doesn't actually modify the SCC struct it looks at so operating on a copy is harmless, but using a (const) pointer to the original makes the idea more clear (we're not modifying the scc struct here, only its members)
2011-06-01Clean up + simplify pgpsigFormat()Panu Matilainen1-32/+18
- Don't do manually what the computer can do for you, let rasprintf() calculate the string sizes - Handle possible date conversion errors: if we can't format the date correctly then at least show the integer value along with a complaint
2011-06-01Split the --replacepkgs hack to a helper function and document itPanu Matilainen1-23/+29
- Makes the huge rpmpsmStage() that little bit smaller, this special-case code does not belong inline there. Also gets rid of couple of dead assignments and unnecessary variable. - Don't bother unless RPMPROB_FILTER_REPLACEPKG is set, it's not terribly expensive but its also wholly unnecessary in the normal case - Document how the dang thing "works"
2011-06-01Make test-case for --replacepkgs stricterPanu Matilainen1-2/+7
- Actually verify we got the expected result, ie exactly one instance of the pkg installed after successful reinstall.
2011-06-01Reset cli configured flag on rpmcliFini() (RhBug:709421)Panu Matilainen1-0/+1
2011-05-31Cleanup rpmpsmNew() and rpmpsmFree()Panu Matilainen1-25/+10
- Remove redundant checks and other fluff, including dead NULL-assignments on free