summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Always check for rdToken() return codes in expression parsingPanu Matilainen2019-11-181-4/+6
| | | | (cherry picked from commit 968c53cd3de01e16e8be3da800c8cd0d8e25fcbe)
* Add 'string' into query format extensions in man-pagesPavlina Moravcova Varekova2019-11-181-0/+3
| | | | (cherry picked from commit cead442ecf6f85521c9c64ba93ea44e0f084131d)
* Suppress inhibition lock warning message when DBus service is not availableShogo Matsumoto2019-11-181-1/+3
| | | | | | | | | | | | The message may just confuse users if DBus is not running as default, e.g. single-user mode. We suppress it when DBus is not available, which is done by checking two cases: socket does not exist (DBUS_ERROR_FILE_NOT_FOUND), or unable to connect to server (DBUS_ERROR_NO_SERVER). Note that this is an approximate but not an exact way to detect whether DBus service should be running in the environment or not. (cherry picked from commit 708e61307bc3fd027b016fdf5a1d1a5274c1843c)
* Add description of comments in spec documentationPavlina Moravcova Varekova2019-11-181-0/+22
| | | | (cherry picked from commit 22c26c7444c32dfe6b75b250b247b5d57f989ba6)
* Improve description of conditionals in spec documentationPavlina Moravcova Varekova2019-11-181-14/+36
| | | | (cherry picked from commit 07be45f2023b7b59d6880a9b577b339c439b1018)
* Support libgrypt as crypto libraryMichael Schroeder2019-11-183-1/+430
| | | | (cherry picked from commit 037106ecc899bad6d6e6f9d95768699542b871ea)
* Correct and update Query formats documentationPavlina Moravcova Varekova2019-11-181-27/+11
| | | | | | | | | | | | | | | | | | | | | | | - in a majority of examples in the manual the text after the --queryformat argument is in double quotes - thus it does not look good to wrote that "A query format is passed to RPM after the --queryformat argument, and normally should be enclosed in single quotes". - in the case of: rpm -qa -i --queryformat "%{NAME} %{SIZE}\n" -i is not ignored, so this is omitted in the text. - language correction - added a link to a formatting tags documentation - added an explicit example of a query expression - removed example of "viewing the verify flags', that does not have any purpose here (cherry picked from commit 0cb0e69eafa069c2a6150ae2f573a4373ab058d1)
* Disable marker on multiline expression error messagesPavlina Moravcova Varekova2019-11-181-0/+5
| | | | | | | | | | | If an expression multiline like: %{expr: 0 || 0 || 0 || 0 |o| 0 || 0 || 0 || 0 } then it is better not to support marker pointing to the exact place of the error. (cherry picked from commit 076e3ea2a3ec121c62298a2b6ec9d4750b68bf05)
* Free memory leak in unary op handlingMichael Schroeder2019-11-181-17/+31
| | | | | | | Also reduce the number of alloc/free calls by adding ValueSetXXX() variants that change a value. (cherry picked from commit 765fa386bd462432a3836f970b65366ed8b6ae00)
* Ensure expression syntax errors get at least a generic error messagePanu Matilainen2019-11-181-0/+1
| | | | (cherry picked from commit f008f8c70a586e7687f4e71c2df557a0e5be56df)
* Do not expand %{expr:} again after evaluating the expressionMichael Schroeder2019-11-181-3/+7
| | | | (cherry picked from commit 7659f40cfe2f78d3a256e2952a0a4f91ff21eb88)
* Trap division by zero in expression parserPavlina Moravcova Varekova2019-11-182-0/+6
| | | | | (cherry picked from commit 715ce7ce2eb6028553f8ce268a2f6cc76b9d5251) (cherry picked from commit 7c2900e682c95e89d0fc7daf5f4040fd3deb0241)
* Fix type error introduced in commit 1d055ae1df90fe54cf5c056de085cd987f0f6bbfPanu Matilainen2019-11-182-1/+3
| | | | | | | "state" is a pointer in this function, we don't want a pointer to it. Fixes garbage getting printed in the error message. Add a testcase too. (cherry picked from commit e79d1feb6d8111c462eb13403cf0b7ca36b09ff1)
* Print an error for expressions with missing operandsMichael Schroeder2019-11-181-0/+5
| | | | | | Expressions like '5 +' did not print an error message before. (cherry picked from commit 1d055ae1df90fe54cf5c056de085cd987f0f6bbf)
* Log debug messages upon entering and exiting chrootPanu Matilainen2019-11-181-0/+2
| | | | (cherry picked from commit 858d6babd6d9af3c91a152c3abc67122f80990e6)
* Multiple fixes in rpmxdb.c for the ndb database backendMichael Schroeder2019-11-181-2/+6
| | | | | | | | | | | | | | | | | Found by torture-testing the ndb database. * Usedslots was allocated with the wrong size This did not matter for rpm because rpm uses only a small number of index databases * The addslotpage function did not enqueue the new free slots correctly It never gets called in rpm * The protection bits were not set if moveblobto needed to map a blob This can happen if it is called from the moveblobstofront() function, it will just not shrink the database in the current call. (cherry picked from commit 62e6a750710293dde19d6de5e804f22601238b01)
* Use xdb's pagesize instead of sysconf(_SC_PAGE_SIZE)Michael Schroeder2019-11-183-4/+9
| | | | | | Our xdb may use a different page size for some reason. (cherry picked from commit 20fd80802098fe91e85dbe37d1857f6af1e91193)
* Don't report unimplemented db ctrl and verify ops as errorsPanu Matilainen2019-11-182-3/+3
| | | | | | | | | | ndb doesn't implement a specific verify option, but that doesn't mean the data within should be considered invalid. This causes ndb to fail the test-suite on "rpmdb --rebuilddb and verify empty database" for no good reason. Similar arguments could be made for dummydb although it matters much less there. (cherry picked from commit 7ba4b9bdcfc84e7e4740ede0c834581d3be1d865)
* Increase lmdb DB size from 256M to 1GIgor Kanyuka2019-11-181-1/+1
| | | | (cherry picked from commit a623c45ac7a566ee9c33325ef7a318e5ef7d248a)
* Refactor mmap/munmap/mremap handling in ndbMichael Schroeder2019-11-182-45/+67
| | | | | | | Also emulate mremap with mmap/munmap in ndb if it is not available. (cherry picked from commit 3625ca14c752fa229c79891fcc6374df40b5b588)
* Use fdatasync in ndb if availableMichael Schroeder2019-11-182-5/+23
| | | | | | No need to always sync the inode metadata. (cherry picked from commit 9ac6c427d240dca7375dfff596f8a84012c32169)
* Do not always fsync the database directoriesMichael Schroeder2019-11-182-51/+48
| | | | | | Only call fsync when new database files got created. (cherry picked from commit 09cc8ebad29aeaca58d009fd9d1a789919282cc7)
* Delete all the IDXDB_FILESUPPORT code in the ndb backendMichael Schroeder2019-11-181-260/+30
| | | | | | | Rpm will always use xdb instead of plain files for the database indexes. (cherry picked from commit 1c45d96b3218b4ecedb290f89d5230ed1acdd5ff)
* Implement fsync disabling for the ndb backendMichael Schroeder2019-11-181-1/+14
| | | | | | | For some reason this never got implemented. Spotted by Jeff Johnson, thanks! (cherry picked from commit af64fe18ff03440502abc27b09d8db2b911b7d69)
* Preparing for rpm 4.15.0 finalrpm-4.15.0-releasePanu Matilainen2019-09-2630-796/+284
| | | | Pull updated translations from Zanata, bump version to final.
* Update CREDITS for last years new contributorsPanu Matilainen2019-09-261-1/+16
| | | | (cherry picked from commit da5a9bb92d2d9794fbcbd7709bc869c23e795736)
* Preparing for rpm 4.15.0-rc1rpm-4.15.0-rc1Panu Matilainen2019-08-2837-5833/+6187
|
* Cap number of threads on 32bit platforms, add tunables (RhBug:1729382)Panu Matilainen2019-08-282-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | On 32bit plaforms, address space is easily exhausted with multiple threads, causing arbitrary builds failure regressions (RhBug:1729382). Simply cap the number of threads to maximum of four on any 32bit platform to play it safe. It's still three more than we were able to use on older releases... In addition, introduce tunables for controlling the number of threads used similarly to what is available for number of CPUs: forced number and a separate ceiling. The max logic gets surprisingly tricky with the mixed OMP and rpm tunables and different semantics. Notably, OMP does not have a nice way to set a maximum from inside a program (this is only possible from an environment variable so we can't use it here), so we need to jump through a lot of hoops to figure out whether an *unlimited* setting would go above the platform limitation. I'm not entirely convinced this is 100% bulletproof, but then it's all going to change and become even more complicated when we start taking memory limitations into account... (cherry picked from commit 0488fdc927e6d31a0af55646fe51effe9592cb26)
* Fix build code thread cap logic for unlimited CPUsPanu Matilainen2019-08-281-3/+2
| | | | | | | | If there's no clear cap set from rpm configuration, just let OMP do its own thing (ie use all available CPUs) instead of artificially limiting to 1. (cherry picked from commit 0b9af49c022e9187a9befa08c80d74f7097b763c)
* Make dependency generation test payload-compression agnosticPanu Matilainen2019-08-281-0/+1
| | | | | | | | | Non-gzip compression introduces extra dependencies to packages, force gzip compression on the dependency generation test to avoid basically false failures. This lets us run the test-suite with other compression methods as needed (but not changing any defaults here) (cherry picked from commit 3f166028b13219697809c060d4297612cd4743e6)
* Document zstd compression in main macros filePanu Matilainen2019-08-281-0/+1
| | | | (cherry picked from commit 53fafdbe07361ebb921deec29b431f9e861f6e8d)
* Remove unused variable id in find-debuginfo.shTom de Vries2019-08-281-4/+0
| | | | | | | | | | | | | | | There's code setting variable id in scripts/find-debuginfo.sh, but there's no subsequent use. The only use of $id in the script is in do_file, where it is a local variable. The variable setting was introduced in commit 6b3b435fa "Add dwz debuginfo compression support" in combination with a subsequent make_id_link using the variable, but the make_id_link was removed in commit bbfe1f86b "Add build-id links to rpm for all ELF files". Remove the unused variable. (cherry picked from commit 08ca76f1cac5b1f203b687520ecaea005983274e)
* Add %{expr:...} macro for parsing expressionsPanu Matilainen2019-08-283-0/+49
| | | | | | | | Supports the same expressions as spec %if conditions because, well, it's the same expression parser. Only this returns the result as a string instead of a boolean. (cherry picked from commit 3a6a7cf69142cbccd0f33236a4407e4f358696c4)
* Improve expression error messagesPanu Matilainen2019-08-282-19/+31
| | | | | | | | | | | | | The error messages created by the parser have been truly lame and with zero context. No to mention typos such as multiple instances of "suported". Add an error reporting helper which uses the parse state to report not only the expression where the error occurred but also pinpoints the exact character in the cases where we easily can, eg: error: syntax error in expression: (1 && 0)) + 5 error: ^ (cherry picked from commit 4fc0370c56f301c228d592a35b52b76023479953)
* Move %if tests where they belong and fix their keywordsPanu Matilainen2019-08-282-115/+116
| | | | | | | | %if, %else and friends are not macros but spec syntax, these belong to rpmbuild tests. AT_KEYWORDS are separated with spaces, not commas, fix that and add build keyword to all. (cherry picked from commit 0113b734dc77508abc88a744b69d5103e93e7b33)
* Export the expression parsing functions and move to librpmioPanu Matilainen2019-08-287-24/+22
| | | | | | | | Rename to rpmExprBool/Str() for namespace's sake, drop internal visibility and move to librpmio for wider usability. No functional changes here but needed for the next step. (cherry picked from commit 66c3df005f28650e1b6910891a5aa9578b699994)
* Resurrect parseExpressionString()Panu Matilainen2019-08-282-0/+53
| | | | | | | | This essentially reverts commit 398df91274be4e6a9fae0cbbc59f95f6e490ed0f, with a few changes to account for other changes that happened in the meanwhile and establish a single point of return. (cherry picked from commit 8936960d7f15e728b60fa1ea73b0d8a6eff97ad6)
* Drop the no longer needed rpmfcExec() output duplication supportPanu Matilainen2019-08-284-12/+9
| | | | | | | This effectively reverts commit 5fe8c9e6d55fe101c81399423a1e1b0f42882143, but no functional changes as nothing was using this anymore. (cherry picked from commit d472c20a5f6f4046d461c1148a29fba154b2e78b)
* Restore strict order of build scriptlet stdout/stderr output (#794)Panu Matilainen2019-08-281-8/+11
| | | | | | | | | | | | | | | | | | | | | Commit 18e8f4e9b2dd170d090843adf5b5084658d68cf7 and related changes caused us to capture and re-emit stdout of all build scriptlets, whether we actually use the output for anything or not. Besides doing a whole bunch of work for nothing, this can disrupt the output of build scriptlets by making the output jerky and out of order, at least inside mock and other tools which in turn grab rpm output. This makes troubleshooting failed builds unnecessarily hard for no good reason. Handle the whole thing in a different way: on regular builds, don't capture anything where we don't actually need to. This restores the natural flow of output. We still need to somehow handle quiet builds though, and we can't use redirect to /dev/null from %___build_pre like we used to, because dynamic buildrequires need to provide output even on quiet builds. So somewhat counter-intuitively, we need to capture the output in order to discard it. Closes: #794 (cherry picked from commit 3a510926449f1dd779a2933dfaa17de3d03a4ea4)
* Support running rpmfcExec() without any piped input/outputPanu Matilainen2019-08-281-1/+6
| | | | | | | | | Having a function called getOutputFrom() which doesn't is a wee bit weird but what the hey... No behavior changes here, but this is needed for the next steps. (cherry picked from commit ad4673589428db6e3b9fecd6f151eb899500336d)
* Eliminate use of ambiguous logical operators in script conditionalsPavlina Moravcova Varekova2019-08-2816-26/+26
| | | | | | | | | | | | | Prefer '[] && []' to '[ -a ]' and '[] || []' to '[ -o ]' in tests. -a and -o to mean AND and OR in a [ .. ] test expression is not well defined, and can cause incorrect results when arguments start with dashes or contain !. Moreover binary -a and -o are inherently ambiguous. test(1) man page recommends to use 'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2' instead. It corrects warnings [SC2166] spotted by covscan. (cherry picked from commit e9c13c6565cf4782d1f73255ee9144dd9bd2aca7)
* Add a dummy line to CI setup to allow controlling dnf gpgcheck per buildPanu Matilainen2019-08-281-0/+2
| | | | | | | | | | This doesn't do anything at all in itself because all the repositories have gpgcheck=1 by default. However adding this line allows disabling the gpgcheck for individual builds via Semaphore build settings, which allows us work around signatures on rawhide breaking semi-regularly, blocking our CI for no fault of our own. (cherry picked from commit f50e26f1f3d520b9b5955f278822cdb35ea668d4)
* Fix segfault regression on empty script or description at end of specPanu Matilainen2019-08-285-5/+34
| | | | | | | | | | | | | | | | More ripples from the parseLines() unification (commits 91e8d826e473c98209ba9db0ea06ab884557076c to 783e2dc0b424afdf0a5d2add368279cb63016897), the callers used to explicitly allocate an empty string buffer, but with lazy allocation from parseLines() they're getting NULL in the special circumstance of being last in the spec, and no "body". Specifically this happens with empty %description or scriptlet without a body, eg "%post -p /sbin/ldconfig". The script regression report + reproducer and a preliminary patch originally from RhBug:1732276 by nvwarr. (cherry picked from commit 99b9ded5dd7d1118aea528600fcf20ba89dbab9b)
* Drop %_lto_cflags macro afterallPanu Matilainen2019-08-282-4/+1
| | | | | | | | | | | | | | This was only added in commit 2bb7b0cf066c97a9d92eb0bf59618896000cb29d, but turns out that this kind of usage is bad for build reproducability because the system-specific CPU count gets recorded RPMTAG_OPTFLAGS and the resulting binaries too (depending on gcc flags). In addition, gcc upstream has decided to make -flto default to autodetected parallelism. Since -flto can be overridden with by simply appending -fno-lto for the packages that need to disable it, there's no practical need for us to provide such a macro for disabling either. (cherry picked from commit 7faf8eda1358f8a877b9b3d6e1197b814e80b50b)
* rpmpgp: Handle EOF without EOL better at END PGPStepan Broz2019-08-281-2/+3
| | | | (cherry picked from commit 655c4c72a3467037abd51aab29f0300e97caf54c)
* Add a testcases for filenames with weird + invalid charactersPanu Matilainen2019-08-283-0/+82
| | | | | | | | | | Rpm itself has traditionally been able to handle pretty much anything you throw at it, the surrounding scripts less so. Do a basic smoketest that the scripts can handle what rpm can (the rules changed recently in commit ee3126dd3d4ca609f254ac5d647c9ff3e413e9dd) and another test to catch some invalid filenames. (cherry picked from commit 4c3e3706e7eaf6a970f671b5e6ed8986d923fa8c)
* Split verbose make flags to a separate macroJason Tibbitts2019-08-281-1/+5
| | | | | | | Adding V=1 is known to break at least one upstream Makefile, so move the verbosity options to a separate macro to simplify the workaround. (cherry picked from commit c7e0b61c05878868300653d5892425c6c41fdba0)
* Fix memleak during transaction verify step in the NOKEY case.Panu Matilainen2019-08-281-1/+3
| | | | | | | Found during RhBug:1714657 QA testing. In addition, add a comment to clarify the fallthrough as intentional. (cherry picked from commit 5188a7b35eb3672c9b15e96433e033ee36f8e6a8)
* Fix off-by-one in hdrblobGet() making last entry unreachable (RhBug:1722921)Panu Matilainen2019-08-281-1/+1
| | | | | | | | | | | | | | | | hdrblobGet() introduced in commits acfde0d0e812e9f8e153ab6be8c9f2682bdd4763 and 9821de18811db97238c34a564221e315f5f35b44 has an off-by-one thinko (perhaps the idea was to skip the first, region tag) which causes the last entry to be unreachable. In typical packages, that is RPMSIG_PAYLOADSIZE which is not used at all in this context so it doesn't matter, but in large packages use RPMSIG_LONGARCHIVESIZE which has a lower tag number and leaves either RPMSIGTAG_MD5 or RPMSIGTAG_GPG last, unreachable and thus unverifiable. Oops. This fixes the regression introduced in rpm 4.14, affecting verification of large packages (ie having RPMSIG_LONGARCHIVESIZE) (cherry picked from commit e219c9548d16a3c18dd261f7043bb8d221b87c77)
* Prefer '[] && []' to '[ -a ]' in test in find-debuginfo.sh (RhBug:1720590)Pavlina Moravcova Varekova2019-08-281-1/+1
| | | | | | | | | | Spotted by covscan: warning: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. [SC2166] Originally introduced in commit 9aae21d. Thanks to Florian Festi for spotting this and proposing the solution. (cherry picked from commit 7b76b2c0624492cd06d5d1d61f438beb1e4ef3be)