summaryrefslogtreecommitdiff
path: root/build/rpmfc.c
AgeCommit message (Collapse)AuthorFilesLines
2013-02-02Find supplementsAnas Nashif1-0/+41
2013-02-02Add support for weak dependencies:Anas Nashif1-0/+14
A) use RPMTAG_SUGGESTS and RPMTAG_ENHANCES to store them. This is different to upstream, which uses RPMSENSE_MISSINGOK and RPMTAG_REQUIRES/RPMTAG_PROVIDES instead. I chose different tags because I wanted to be compatible. The point is that applications that don't know about the new MISSINGOK semantics will mis-interpret the provides/requires otherwise, which I deemed to risky. B) use RPMSENSE_STRONG to support a "strong" version, "Recommends" instead of "Suggests" and "Supplements" instead of "Enhances".
2012-09-26Freeze the rpmfc string pools once all additions are donePanu Matilainen1-0/+4
- Memory use isn't typically that critical during build, but saving a little bit of it doesn't hurt anyway...
2012-09-26Dont waste time with argi for rpmfc file class indexesPanu Matilainen1-9/+6
- argiAdd() isn't as costly as argvAdd(), but it still involves unnecessary reallocation on every addition as the number of files is predetermined, and each file has an associated class index. - Additionally fixes a mostly harmless glitch introduced in commit 65e616cc9fdd00f523939088fab1070021b9f742: the pool id's are one larger than the indexes we store in headers, take this into account in the debug output.
2012-09-26Dont waste time with argi for rpmfc file colorsPanu Matilainen1-15/+11
- argiAdd() isn't as costly as argvAdd(), but it still involves unnecessary reallocation on every addition as the number of files is predetermined, and each file has an associated color (whether its zero or something else)
2012-09-26Dont waste time with argv for rpmfc file namesPanu Matilainen1-5/+8
- argvAdd() gets more and more costly as the number of files increase, use a plain old string array where one is called for: the size is predetermined (from another argv) and we're just copying the strings for internal storage here. We do need to pay a little bit more attention to details now though.
2012-09-26Use a string pool for the build-time file dependency string storagePanu Matilainen1-9/+9
- The pool is mostly just a dumb storage space for this case, but insertion to pool is far more efficient than argv search, add, sort operation. The order does not matter as the actual information is encoded in the string and then painfully parsed out again. This could really use a special-purpose data structure for sanity but...
2012-09-26Use a string pool to build file class dictionary and indexesPanu Matilainen1-25/+17
- The string pool is a natural fit for this and much more efficient when the number of files (and classes) is large. - This does have an effect on the generated classdict array: it's no longer sorted, and we no longer always (possibly unnecessarily) insert an empty string and "directory" in it, but only when they actually exist. Neither change makes any difference for usage, unless some 3rd party software is making assumptions about the classdict contents they shouldn't be making (very unlikely anyway)
2012-09-26Cosmetics: properly indent the rpmfc debug foobarPanu Matilainen1-6/+8
2012-08-01Dont bother asking libmagic about directoriesPanu Matilainen1-1/+1
- There's no (relevant) additional information to be gained from passing directories to libmagic and we already have this info available in the file mode. This permits nice and easy handling of %ghost directories (related to RhBug:839656)
2012-07-12Always print out package dependencies on buildPanu Matilainen1-7/+7
- Previously packages which had no files or for which automatic dependency generation was partially or fully disabled didn't get any of their dependencies printed out at build-time. This doesn't affect the actual recorded dependencies, only the "debugging" output during package builds.
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-05-27Clean up rpmfcGenerateDependsHelper() (aka external depgen) a bitPanu Matilainen1-23/+14
- 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
2011-05-27Eliminate a few more dead rpmdsFree() NULL assignmentsPanu Matilainen1-5/+5
- No real chance of accidental misuse of freed data here...
2011-05-27Don't bother NULL'ing everything on rpmfcFree()Panu Matilainen1-15/+16
- 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)
2011-05-27Minor cleanup to rpmfcExec()Panu Matilainen1-5/+4
- remove redundant xav re-initialization - dont bother NULL'ing local variables on exit
2011-05-27Minor cleanups to rpmfcGenerateDepends()Panu Matilainen1-9/+4
- 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
2011-05-27Eliminate some dead assignments on rpmdsFree()Panu Matilainen1-8/+9
- 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.
2011-05-27Add a helper function for creation namespaced dependency sets, use itPanu Matilainen1-16/+21
2011-05-27Minor cleanups to rpmfcHelper()Panu Matilainen1-6/+8
- 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.
2011-05-23Add support for fileattr dependency namespacingPanu Matilainen1-1/+9
- 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.
2011-05-23Whoops, flags needs to be sorted for argvSearch() to work correctlyPanu Matilainen1-0/+1
2011-05-23Unify fileattr include- and exclude-rule handlingPanu Matilainen1-40/+57
- 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.
2011-05-19Support "magic_and_path" flag in fileattrsMichael Schroeder1-4/+7
- 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>
2011-03-14Clean up rpmfcClassify()Jindrich Novy1-20/+19
- don't check return values of functions that cannot fail - remove "can't happen" asserts - fail in case of empty file classifier
2011-03-10Clean up rpmfcApply() and rpmfcHelper()Jindrich Novy1-40/+44
2011-03-09Clean up rpmfcExec()Jindrich Novy1-7/+4
2011-03-04Yet remove some unused variables to suppress warningsJindrich Novy1-13/+13
2011-02-21Fix braindamage in the depgen helper collector loop (RhBug:675002)Panu Matilainen1-10/+13
- Read any remaining data before exiting on SIGCHLD - Only perform one read() per loop, otherwise it could block - Handle EINTR while read()'ing
2010-12-10Implement filtering of autogenerated dependenciesPanu Matilainen1-5/+18
- This allows both excluding entire paths from dependency generation and also excluding individual generated dependencies by regexes settable from spec or other configuration. - %__(provides|requires)_exclude regex controls is matched against generated dependencies, %__(provides|requires)_exclude_from is matched against the currently processed path, with buildroot stripped out. - We'll probably want some "higher level" macros to go with this, but the mechanism is usable as-is already.
2010-12-10Some further preliminaries for next bitsPanu Matilainen1-21/+18
- Add a helper function for freeing regex pointers - Move regMatch() to top of rpmfc.c, we'll need it shortly
2010-12-10Refactor the helper execution out of rpmfcHelper()Panu Matilainen1-60/+67
- Split the macro name generation and grabbing of argv-style output into yet another helper to reduce the clutter in rpmfcHelper() before adding more stuff in there.
2010-12-10Rename pattern -> path for, duh, path patternsPanu Matilainen1-12/+12
- 4.9 alpha used "pattern" but better fix the stupid name now than have to live with the non-obvious name forever
2010-12-10Support excluding by path or magic in file classificationPanu Matilainen1-0/+18
- %__foo_exclude_pattern and %__foo_exclude_magic regex'es now allow excluding attributes that would otherwise match.
2010-12-10Remove broken versioned provides rpmlib() trackingPanu Matilainen1-13/+0
- Every single package since rpm >= 3.0.4 or so has a versioned provide through the automatically added N = VR provide, which hasn't gotten tracked in all these years. Drop the useless dependency.
2010-12-01Pass RPM_BUILD_ROOT to helper scripts through environment alwaysPanu Matilainen1-5/+10
- Many of the scripts need to know the buildroot in order to figure out correct resulting paths. This permits unifying the current adhoc methods of passing the data to the scripts.
2010-12-01Remember buildroot directory in rpmfc structPanu Matilainen1-4/+14
- New constructor rpmfcCreate() which takes buildroot as an argument, and "flags" argument for future use. Calculate brlen at initialization now that we can. - Preserve rpmfcNew() as a compatibility wrapper as it's something somebody could, in theory, have used legitimately.
2010-12-01Eliminate unused dir argument to getOutputFrom()Panu Matilainen1-9/+2
2010-10-22Brute-force s/rpmTag/rpmTagVal/ in entire librpmbuildPanu Matilainen1-5/+5
- Many of these cases would be true enums from preambleList & similar, except for the list terminating sentinel. Just switch all the remaining rpmTag's to rpmTagVals to bring our enum-whacking to a grande finale.
2010-10-05Require file attribute config to have .attr suffixPanu Matilainen1-2/+4
- Allows for more precise globbing, avoiding potential issues from leftover / accidentally placed files in the fileattrs directory.
2010-10-05Replace __foo_exeonly attribute with a more generic mechanismPanu Matilainen1-5/+6
- Use a list of text keyword tokens to allow for more flags without requiring adding special processing for every new flag we make
2010-09-26Fix segfault in rpmdeps (RhBug:637357)Jindrich Novy1-1/+1
2010-09-21Remove bunch of double consts in librpmbuildPanu Matilainen1-1/+1
2010-09-21Avoid stepping on toes of relatives, part 3Panu Matilainen1-2/+2
- Eliminate remaining (hopefully) C++ reserved keywords in librpmbuild
2010-09-21Use the macro allocator variants within librpm*Panu Matilainen1-1/+1
2010-09-21Use _free() instead of rfree() where "return value" is assignedPanu Matilainen1-3/+3
2010-09-21Fix up bunch of silly int vs rpmRC return code mismatchesPanu Matilainen1-6/+6
2010-08-25Mass eviction of remaining internal helpers in librpmbuild APIPanu Matilainen1-2/+2
- Yank everything qualifying as "internal helper function" into internal-only headers, loosely grouped as follows: 1) Everything involving spec-manipulation goes into rpmbuild_internal.h 2) All other miscellaneous helpers go into rpmbuild_misc.h - This leaves us a rather minimal, and nearly useful API into librpmbuild: Users need to be able to parse a spec, query or build (parts of) it and free up the spec structure when done. This is what we have now, various still exposed structures not counting.