aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* man: fix -S/--slots option description in qlist.1HEADmasterEmanuele Torre2024-09-052-2/+3
| | | | | | | | | | | | | | | | | | | | I noticed that the qlist(1) man page did not mention that -S implies -I, so I wanted to fix that. The man page was actually supposed to mention it, but man/include/qlist.optdesc.yaml was incorrectly using the "slot" key to define --slots's long description, so the man page ended up using the short description from q list --help instead of the longer description that contains "This flag implies -I.". Renaming the key in the yaml file from "slot" to "slots" fixed the problem. I have regenerated the man pages with man/mkman.py, but only included the new version of qlist.1 in this commit. Signed-off-by: Emanuele Torre <torreemanuele6@gmail.com> Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* tests: allow running out of sourcetreeFabian Groffen2024-07-033-3/+5
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* main: respect ROOT when reading profilesFabian Groffen2024-07-031-7/+17
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* main: handle --root and -q early during startupFabian Groffen2024-07-033-29/+51
| | | | | | | Need to handle --root before we read profiles, -q to silence warnings from that profile reading. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/Makefile: fix out-of-srcdir buildFabian Groffen2024-06-292-2/+4
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* build-sys: regenFabian Groffen2024-06-2852-27908/+3449
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* fix Coverity issuesFabian Groffen2024-06-283-6/+7
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* *: remove i18n/gettext supportFabian Groffen2024-06-274-32/+10
| | | | | | | | This looked very rudimentary, and half, there were no translations, and not all strings were covered. It was never enabled, so dummy for many releases. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qwhich: add -r option to limit search to a repositoryFabian Groffen2024-06-251-10/+21
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* autogen: autoconf-archive was moved from sys-devel to dev-buildv0.97Fabian Groffen2024-04-201-2/+2
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/xarray: Handle NULL arrays in xarraysort()Boris Staletic2024-04-081-2/+3
| | | | | | | | | | | | Some invocations of `q` may try to call `xarraysort(NULL, 0)`. One example is `qlop -a foo` where `foo` was never unmerged. Instead of requiring every call of `xarraysort()` to take care of `NULL` arguments, `xarraysort()` now exits early if `arr->eles == NULL`. Closes: https://github.com/gentoo/portage-utils/pull/28 Signed-off-by: Boris Staletic <boris.staletic@protonmail.com> Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* tests: Avoid buffer underflow when checking rmspace resultBoris Staletic2024-04-081-2/+2
| | | | | | | | `s[len - 1]` is not allowed for strings whose length is 0. Caught by clang's UBSAN. PR: https://github.com/gentoo/portage-utils/pull/28 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmanifest: avoid out of bounds access in append_list macroFabian Groffen2024-03-291-2/+4
| | | | | | | | | | | | Empty strings, or those being just whitespace were not handled correctly. Thanks bstaletic in PR #19 for pointing this out. Avoid running under the original string pointer and skip any checks for strings that are too short to match anything in particular. This sweeps an edgecase of just a single whitespace char under the carpet -- which is just about fine, for it needs not to be handled for any legitimate case. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* tests: Avoid leaking buf in copy_file/test.cBoris Staletic2024-03-291-0/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* tests: avoid leaking buf after exiting the loop in atom_explodeBoris Staletic2024-03-291-0/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qlop: Do not leak avgs array in predict modeBoris Staletic2024-03-291-0/+1
| | | | | | | | | | Previously, `values_set(merge_averages, avgs)` would allocate `avgs`, then it would be used in `array_for_each(atoms, i, atom)`, but a call to `xarrayfree_int(avgs)` was missing after the loop. Hopefully, this, along with #26, will solve the issues from #19. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qlop: Properly handle atom_compar_cb when called from qsortBoris Staletic2024-03-293-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | `qsort` passes pointers to elements ("iterators" in C++ lingo) to the callback, not elements directly. Hence `l` and `r` in `atom_compar_cb` actually receives `depend_atom**`, but only when called from `qsort`. The other two call sites (`tree_pkg_compar` and `pkg_sort_cb`) actually apssed `depend_atom*`. This leads to type casting confusion and undefined behaviour for any invocation of `qlop -p`. First discovered by SEGFAULT-ing with the following invocation: qlop -p `cat /var/lib/portage/world` Valgrind and ASAN made triggering the SEGFAULT easier - any invocation with two or more atoms triggered a NULL dereference. This commit addresses the above problem: 1. Expect that `atom_compar_cb` is actually called with two `depend_atom**`. 2. Make `tree_pkg_compar` and `pkg_sort_cb` comply with the above change, by passing `&al` and `&ar`, instead of `al` and `ar`. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: add reminder for myselfFabian Groffen2024-03-291-0/+4
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: handle hypothetical fail in tree_pkg_meta_get_intFabian Groffen2024-02-011-0/+6
| | | | | | | When we cannot read all bytes from a file, return an empty string, not partial garbage. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/contents: fix invalid access problem pointed out by valgrindFabian Groffen2024-02-011-0/+4
| | | | | | | | len represents the entire string length, but we start scanning after the line identifier, so substract that size from len, such that we don't start scanning after the end of the input string. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/contents: add variant specifying buffer lengthFabian Groffen2024-01-312-20/+38
| | | | | | | This seems necessary for PR #21, but keep the original code structure largely in-tact. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/hash.h: update copyright for previous commitFabian Groffen2024-01-311-1/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/hash: add hash_string functionFabian Groffen2024-01-312-24/+114
| | | | | | | | | | Alternative to the implementation in PR #21, so as to reuse the same hashing code. We could add the interface to compute multiple hashes from the same string when that's actually necessary. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/atom: fix atom comparison bugPavel Kalugin2024-01-271-1/+9
| | | | | | | | qlop SEGFAULTed when predict on a package without category was called Closes: https://github.com/gentoo/portage-utils/pull/24 Signed-off-by: Pavel Kalugin <pavel@pavelthebest.me> Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: sloppily circumvent Coverity 125893Fabian Groffen2024-01-021-1/+1
| | | | | | use mkdir_p to avoid Unchecked return value from library Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: fix Coverity 190455 Argument cannot be negativeFabian Groffen2024-01-021-2/+5
| | | | | | Handle case where image dir somehow could not be opened. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* buildsys: regenFabian Groffen2024-01-0268-643/+7486
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* buildsys: no longer use OpenSSL for hash implementationsFabian Groffen2024-01-023-38/+4
| | | | | | | This means, we can always build qtegrity, because we have the required hash impls on board through gnulib. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/hash: switch from OpenSSL/custom to gnulib-based hash implsFabian Groffen2024-01-025-897/+41
| | | | | | | | OpenSSL deprecated most (if not all) of the hashes we use from it, and we don't have our own implementations for e.g. SHA512, so switch to gnulib's versions, which makes this all simpler. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* *: remove WHIRLPOOL hash supportFabian Groffen2024-01-018-59/+26
| | | | | | | WHIRLPOOL has not been in use since mid 2017, and its support is bound to be removed from OpenSSL. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* gnulib: updateFabian Groffen2024-01-01410-7182/+19092
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* man: regen for updated footerFabian Groffen2024-01-0119-38/+92
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* man: fix product/component for reporting bugsFabian Groffen2024-01-011-1/+1
| | | | | Closes: https://bugs.gentoo.org/916949 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qlist: avoid truncation of USE-flags in package viewFabian Groffen2024-01-011-22/+11
| | | | | Closes: https://bugs.gentoo.org/921132 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: Send ewarn, etc., to stderrBrian Norris2023-12-201-4/+4
| | | | | | | | | | | | | | The PMS specifically calls out that ewarn should not display its message to stdout. Portage sends all e{log,info,warn,...} to stderr. Imitate that. This discrepancy causes problems for ghc-package.eclass users, for one, as there are instances where that class purposely dumps a warning and then expects its callers to still use its stdout as a result. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* main: init quiet early for repo checksv0.96.1Fabian Groffen2023-07-181-8/+23
| | | | | | | | For as long as we will pre-load all profile information at every q invocation, respect -q flag so warnings in that code can be suppressed. Bug: https://bugs.gentoo.org/735134 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* initialize_portage_env: init color and quiet defaults earlyFabian Groffen2023-07-171-3/+8
| | | | | | | profile init code may use warn etc so ensure we have colours defined and quiet setup via fallback Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* main: silence repo warnings when quiet is setv0.96Fabian Groffen2023-04-211-6/+11
| | | | | Bug: https://bugs.gentoo.org/735134 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: add commetns on file checks (research for bug #898194)Fabian Groffen2023-04-211-0/+9
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* main: support NO_COLOR environment variableFabian Groffen2023-03-011-0/+6
| | | | | | NO_COLOR apparently is the more standard version of NOCOLOR. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* main: workaround hypothetical resource leakv0.95Fabian Groffen2023-02-071-1/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* set: try to silence CoverityFabian Groffen2023-02-072-4/+11
| | | | | | | | Now add_set_value can allocate a new set, Coverity thinks this will actually happen, despite in these cases the input set not being NULL. Help Coverity by adding a redundant if. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* set: ensure NULL is empty behaviour is retained throughoutFabian Groffen2023-02-076-21/+59
| | | | | | | | Not all set functions respected NULL is empty behaviour, changed add_set_value signature to return a set instead so it can conform. Bug: https://bugs.gentoo.org/893424 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: add some braindump notes about how things could beFabian Groffen2023-02-071-0/+94
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qdepends: add support for IDEPEND, #892533Fabian Groffen2023-01-303-16/+33
| | | | | Bug: https://bugs.gentoo.org/892533 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: add support IDEPENDFabian Groffen2023-01-302-3/+8
| | | | | Bug: https://bugs.gentoo.org/892533 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qkeyword: add -A option to show the current archFabian Groffen2022-12-152-13/+26
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qkeyword: gracefully handle case with no found archesFabian Groffen2022-12-151-1/+7
| | | | | Bug: https://bugs.gentoo.org/885801 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* main: Handle empty repo names in parent filesKrzesimir Nowak2022-12-151-16/+89
| | | | | | | Empty repo name is documented in portage(5). Signed-off-by: Krzesimir Nowak <knowak@microsoft.com> Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* main: Print the ignored parent line in warningKrzesimir Nowak2022-12-151-0/+2
| | | | | | | If repo name in the parent line was empty, nothing was printed. Signed-off-by: Krzesimir Nowak <knowak@microsoft.com> Signed-off-by: Fabian Groffen <grobian@gentoo.org>