summaryrefslogtreecommitdiff
path: root/build/rpmfc.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix memleak in rpmfcApplyInternal() in standalone operation (eg rpmdeps)Panu Matilainen2020-03-261-2/+2
| | | | | | | | | | | When called in spec context, the package structs are properly freed but in rpmdeps context, commit 49f2bb7d8fd91f2d8b22bf7128fd3defe4ed5434 only added a "dirty kludgery" to make it not blow up. This causes the rpmds structures created in rpmfcApplyInternal() to leak memory. Make freePackage() internally available and use it for freeing the dummy struct too to fix. (cherry picked from commit df4f6a20c3bbf0d319643c17fb16364f64a1b10a)
* Add actual command + arguments to dependency generator debug output (#338)Panu Matilainen2018-01-161-0/+6
| | | | (cherry picked from commit 1d1ff6c86fc9afb4c6c89b42fdb5be851f13cb7a)
* Add a new option --alldeps to rpmdepsPeter Kjellerstedt2018-01-161-13/+14
| | | | | | | | | | | | This will send the output from rpmfcPrint() to stdout. This is an alternative to using the --rpmfcdebug option, which will send the same output to stderr. The two options have totally different use cases though. While --alldeps is used when the output from rpmfcPrint() is what is wanted, --rpmfcdebug can be used together with the other output options, e.g., --requires, without affecting their output. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@gmail.com> (cherry picked from commit 6cec28ff044ad0246f6b43c20f9fc44800fc892e)
* rpmfc: fix ternary operatorFlorian Festi2017-07-071-1/+1
| | | | | | | Fixes: 9d5bbd9774d00f50749bb045217eaf91c87b6de0 References: https://bugzilla.redhat.com/show_bug.cgi?id=1468476 Tested-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org> Signed-off-by: Florian Festi <ffesti@redhat.com>
* Revert macro argument quotion patchesPanu Matilainen2017-06-271-1/+1
| | | | | | This reverts commits f23821c80be45a9291b007636dccc4783f2f32bd and e2435b093314576230445d68354f7e21e191e9d9 that were accidentally pushed during review.
* Enable double quoting in macro arguments (#222)Pavlina Moravcova Varekova2017-06-191-1/+1
| | | | | | | | | | | | | | | | | | | With double quoting, macro arguments may contain spaces. Every odd occurrence of double quotes denotes begin of an argument. Every even occurrence denotes the end of an argument. Arguments are taken without quotes. Examples: ./rpm --define "%foo() 1:%1 2:%2 3:%3" \ --eval '%foo "Next argument will be empty" "" "Last argument"' 1:Next argument will be empty 2: 3:Last argument or without spaces between arguments: ./rpm --define "%foo() 1:%1 2:%2 3:%3" \ --eval '%foo "Next argument will be empty""""Last argument"' 1:Next argument will be empty 2: 3:Last argument
* Pass proper file index when recording generated dependenciesFlorian Festi2017-05-311-1/+1
| | | | | Resolves regression introduced with 8f509d6 Fixes #224
* Stop NSPR from messing with our signalsPanu Matilainen2017-05-101-2/+0
| | | | | | | | | | | | | | | | | For NSPR, (which NSS uses internally) being portable to Windows and whatnot and centered around apps like Firefox, simply ignoring SIGPIPE is probably a reasonable choice. Rpm however is an old school unix cli piece where SIGPIPE is very much relevant and handled where necessary. Besides we now have not just one but two other, less obnoxious crypto backends which exhibit different core rpm behavior due to the difference, not good. Save and restore the SIGPIPE handler across NSS initialization, and remove all the now redundant calls to reset it after forking. Should've done this ages ago but better late than never, no? Note that the install-time scriptlet thing is different since we set SIGPIPE to SIG_IGN by ourselves there, add a comment.
* add support for rich dependencies from dependency generatorsIgor Gnatenko2017-03-081-64/+26
| | | | | | | Mostly achieved by replacing custom parser with the parseRCPOT(). Closes: https://github.com/rpm-software-management/rpm/issues/167 Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
* Fix check for weak deps in external dependency generatorFlorian Festi2017-03-011-6/+6
|
* Use RPMTAG_*NAME instead of RPMTAG_*FLAGS in parsePreamble.c and parseRCPOT()Florian Festi2017-03-011-1/+1
| | | | | | | Using the FLGS tags is awkward and inconsistent with other part of the code routinly use the NAME tags to denominate the type of dependencies. This is also going to make using parseRCPOT() easier for the rpmfc code that is also based on NAME tags.
* Cosmetics: if, while and switch are followed by a spacePanu Matilainen2017-02-271-2/+2
| | | | | | | | The missing space style-error has been recently coming common enough somebody might think that IS the expected style, its not. Some of these are actually very old, but fix across the board for consistency.. Strictly white-space only change.
* Filter out provides/requires from %_docdir (rhbz:964126)Lubos Kardos2016-05-311-0/+6
|
* Change rpmfcAttrMacro() and rpmfcAttrReg() to accept variable argument listLubos Kardos2016-05-301-17/+66
| | | | Needed for next commit
* Filter unversioned deps if corresponding versioned deps exist (rhbz:678605)Lubos Kardos2016-05-171-55/+118
| | | | | | After automatic dependencies are generated filter out from them unversioned dependencies if versioned dependencies with the same name, type and color already exist.
* Show a warning when external dependency generator is usedLubos Kardos2016-04-181-0/+2
| | | | | | | | Often people have problems which can be solved by using the internal dependency generator instead of the external one (rhbz: 1297557, 1326871, ...) and they are not aware that the external dependency generator is deprecated and it shouldn't be used. So show a warning to inform people about this fact.
* Use pkg->dpaths during dependency generation instead of buildRoot + filenameFlorian Festi2016-02-251-7/+1
| | | | | This passes the filenames with the actual file content to the dependency generators when using RemovePathPostfixes (rhbz#1306559).
* Add missing header filesPeter Eisentraut2016-02-111-0/+1
| | | | They are generating warnings.
* Add support for various types of dependencies to rpmdeps toolLubos Kardos2015-09-211-0/+30
| | | | | | | | | | Options added to rpmdeps tool: --recommends --suggests --supplements --enhances --conflicts --obsoletes
* Fix doxygen warningsFlorian Festi2015-02-171-1/+0
| | | | Make shure parameter descriptions in doc strings match the functions
* Eliminate leftover, commented debugging printf()Panu Matilainen2014-10-081-1/+0
|
* Only add per-file dependencies if we collected themPanu Matilainen2014-10-081-7/+7
| | | | | | | - Legacy generators dont create a dependency dictionary, in which case there's no point adding per-file depends dictionary indexes (all zeros) either. Should've probably been in commit 05636a7db213e8255d6893c638a80d52390c3527 already.
* Move internal vs external depgen decision to rpmfcApply()Panu Matilainen2014-10-081-10/+17
| | | | | - Rename the actual worker functions for consistency, rpmfcApply() is now just a simple wrapper around the two
* Dont bother passing pkg to rpmfcGenerateDependsHelper()Panu Matilainen2014-10-081-5/+5
| | | | - This is already available through fc
* We already have the files with buildroot prepended here...Panu Matilainen2014-10-081-7/+4
|
* Pass file classifier, not spec, to external depgen helperPanu Matilainen2014-10-081-5/+5
|
* Refactor current file index from rpmfc structPanu Matilainen2014-10-081-23/+24
| | | | | | - There's no good reason for having a "current index" within fc, and the code is easier to read when its clear its just an index of a silly for-loop and not something fancier.
* Generate file classes and colors regardless of dependencies (RhBug:1150209)Panu Matilainen2014-10-081-13/+9
| | | | | | | | | | | | | | - File coloring affects ability to install packages on multilib systems when relying on color conflict resolution (eg Fedora, RHEL), and that has zero to do with whether package dependencies are being automatically generated or not. Always generate file classification and the coloring based on that. - Besides fixing coloring where AutoReqProv: 0 is used (ie RhBug:1150209), this also fixes two issues when the legacy external dependency generator is used: file coloring (RhBug:lotsa) and config() dependency generation. So in default configuration, internal vs external depgen now only affects whether dependencies are recorded on file or package level, otherwise the produced packages should be fully equivalent now.
* Dirty kludgery to fix rpmdeps segfault (RhBug:1131892)Panu Matilainen2014-08-251-0/+5
| | | | | | - Another regression from the recent rpmfc work, in rpmdeps context there's no spec or packages from it. Allocate a dummy package so we have some place to store the dependencies. And yes its ugly.
* Resurrect dependency spew during buildPanu Matilainen2014-08-251-5/+3
| | | | | | | - Since commit a357c99c58a5e1367160dfa692f26d14bd3a3df1 the dependencies are no longer in the header so there's little to print from there. As it happens things are much saner this way, we no longer need to create rpmds'es just to print stuff.
* Add weak deps to the dependency generatorsFlorian Festi2014-07-081-0/+18
|
* Make calling the dependency generators more genericFlorian Festi2014-07-081-47/+28
|
* Do not write the dependencies to the header instantly.Florian Festi2014-07-081-94/+36
| | | | Add the dependencies generated from the files to the package and write them to the header at the end.
* Fix creation of file manifest in rpmfcGenerateDependsHelper()Tomas Mlcoch2014-03-241-1/+2
| | | | | | - Fixes regression from commit 0c2a5d58688699115503a1fc54dab40f80e4caab Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
* Use a common string pool for rpmds'es within file classifierPanu Matilainen2013-11-291-11/+15
| | | | | | | | - Avoid pool setup + teardown for each and every dependency we create, and string copy between pools on subsequent rpmdsMerge(). Probably wont make much of a difference in practise since the number of dependencies per package isn't *that* big, but wont hurt either (and who knows what kind of texlive-monsters we get thrown at...)
* Make pkg->cpioList rpmfiles instead of rpmfiPanu Matilainen2013-11-251-1/+3
| | | | so rpmPackageFilesArchive() has only one rpmfi object.
* Sanitize archive creationPanu Matilainen2013-11-191-1/+2
| | | | | | | | | | | | | | - Get rid of the crazy tag-tango around rpmfi in genCpioListAndHeader(): pkg->cpioList is an rpmfi with the actual in-package paths, and on-disk package paths are passed around as a separate array. This simplifies and sanitizes things a lot... and also finally gets rid of fi->apath entirely. - Dependency generation wants on-disk paths, but it can generate those by prepending buildroot, which actually makes it more obvious what's going on. - This also kills %{_noPayloadPrefix} ancient-history compatibility flag. We could honor it in rpmfiArchiveWriteHeader() if we cared but we're talking about rpm < 3.0.5 compatibility here ... so we dont.
* Detect and report invalid characters in dependency range operatorsPanu Matilainen2013-09-041-2/+5
| | | | | | | - Previously we just silently ignored any junk thrown at us, try to do a little better than that. This still merrily accepts things like << as equal to < but at least we now issue errors on totally bogus garbage in range.
* Require strict one dependency per line output from generatorsPanu Matilainen2013-09-041-7/+14
| | | | | | | | | | | | | - Split dependency generator output by lines, not just any whitespace. This is what all known dep generators do anyhow, and gives us a much better chance at validating the input on rpm-side. - Further split each line into components with poptParseArgvString() and let parseDep() take care of the details and actually report any errors we find. - Using popt's argv parsing has the nice bonus of handling quotes, so we can now sanely handle cases like RhBug:503846 as we now a) accept whitespace in dependencies if properly quoted b) report errors on bad generator output
* Refactor dependency string (flags etc) parsing to separate functionPanu Matilainen2013-09-041-28/+54
| | | | | - This should behave pretty much identically to how we always did things, just paving way for actual sanity checking and error reporting here.
* Add placeholder return code to rpmfcHelper()Panu Matilainen2013-09-041-2/+3
|
* Propagate return codes from rpmfcHelper() in rpmfcHelperFoo()Panu Matilainen2013-09-041-8/+6
| | | | | - Doesn't affect anything yet as currently rpmfcHelper() always returns 0 and rpmfcHelperFoo() returns are ignored...
* Utilize the existing rpmds'es from packages when merging generated depsPanu Matilainen2013-04-161-8/+4
| | | | | | - We already have the manually added dependencies in the per-package rpmds'es so we can just merge, no need to reconstruct them from the header.
* Print out %pretrans and %posttrans dependencies too when buildingPanu Matilainen2013-04-101-0/+6
|
* Freeze the rpmfc string pools once all additions are donePanu Matilainen2012-09-261-0/+4
| | | | | - Memory use isn't typically that critical during build, but saving a little bit of it doesn't hurt anyway...
* Dont waste time with argi for rpmfc file class indexesPanu Matilainen2012-09-261-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.
* Dont waste time with argi for rpmfc file colorsPanu Matilainen2012-09-261-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)
* Dont waste time with argv for rpmfc file namesPanu Matilainen2012-09-261-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.
* Use a string pool for the build-time file dependency string storagePanu Matilainen2012-09-261-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...
* Use a string pool to build file class dictionary and indexesPanu Matilainen2012-09-261-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)