aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* qlop: work around Coverity complaintsv0.89Fabian Groffen2020-08-171-10/+9
| | | | | | | Check/search once for colons, it is a bit brittle to assume a colon was found, even though in this case it should have always succeeded. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qlop: recognise logfile naming when PORTAGE_LOGDIR is set, bug #711896Fabian Groffen2020-08-171-10/+30
| | | | | Bug: https://bugs.gentoo.org/711896 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: force FEATURES=-preserve-libs, bug #698462Fabian Groffen2020-08-171-0/+3
| | | | | | | | | We do not support/implement preserve-libs feature (we could), so drop it from FEATURES such that preserve_old_libs kicks in for some of the crucial libs around. Bug: https://bugs.gentoo.org/698462 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qlist: Coverity 212181: guard against NULL-pointersFabian Groffen2020-08-141-2/+4
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: fix syntax error introduced in bafe11f5e8beb6ee1fe5e344aba517a22bc0cf9fFabian Groffen2020-08-141-1/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qlist: add -t (tree) and -m (masks) argumentsFabian Groffen2020-08-144-14/+77
| | | | | | | | | | | -t allow traversing the configured trees -m apply masks from profiles E.g. useful to find the latest available non-masked version of a package: % qlist -Itvm mypackage Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: Impl. einfon()Joakim Tjernlund2020-08-141-0/+1
| | | | | Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: Impl. best_version()Joakim Tjernlund2020-08-141-1/+1
| | | | | Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* read_portage_profile: adapt warning to point to which profileFabian Groffen2020-08-021-1/+2
| | | | | | | | When we fail to resolve a repo match, give the user a better hint by pointing to the profile we were reading. Bug: https://bugs.gentoo.org/735134 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qlop: fix crash when encountering a long option with -E -vFabian Groffen2020-07-081-4/+11
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qpkg: replace allocated buf with stack versionv0.88Fabian Groffen2020-06-281-30/+10
| | | | | | | now we don't use anything that would realloc buf, just stick to a buffer on the stack so we don't have ensure we free it either Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qpkg: use tree_pkg_meta_get instead of direct VDB readFabian Groffen2020-06-281-29/+18
| | | | | | | | qpkg failed to create packages from a different ROOT because the CONTENTS from vdb was read without ROOT support. Avoid this by using tree-based functions that properly use ROOT. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qpkg: fix VDB access method, warn when atoms didn't match anythingFabian Groffen2020-06-272-18/+36
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: ensure tree_foreach_pkg_fast can be run multiple times tooFabian Groffen2020-06-271-0/+2
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qpkg: don't fail when pkgdir doesn't exist yetFabian Groffen2020-06-271-3/+3
| | | | | | | When we implicitly created pkgdir, also try to chmod it, instead of failing on permissions later. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: fix metadata cache after reallocFabian Groffen2020-06-071-6/+15
| | | | | | | | | | | | A realloc caused a relocation of pointers, which also changed the value of Q__md5_ and Q__eclasses_ which are secretly used to store len and pos, so make sure we reset them to correct values after a relocation takes place. While at it, reduce the allocation requirements by only considering the really needed space (over-allocate less here). Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* test/init: qmerge makes valgrind coredump too, Travis--Fabian Groffen2020-05-251-0/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* tests/init: re-enact valgrind block on TravisFabian Groffen2020-05-251-0/+2
| | | | | | | Somehow Travis env cannot be replicated, and still has a coredumping valgrind Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* travis: install compressors we testFabian Groffen2020-05-251-0/+5
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* tests/init: drop valgrind exclusionsFabian Groffen2020-05-251-2/+0
| | | | | | | | After some manual testing and fixes on a Bionic VM, valgrind no longer dumps core there, so let's hope we can finally run the full suite using valgrind on Travis too. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: drop unused argument to pkg_verify_checksumsFabian Groffen2020-05-251-4/+3
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: kill whitespaceFabian Groffen2020-05-251-1/+0
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: properly free meta in tree_match_closeFabian Groffen2020-05-251-1/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: fix package namesFabian Groffen2020-05-251-6/+6
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: avoid invalid (double) fcloseFabian Groffen2020-05-251-1/+0
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/hash: avoid invalid (double) fcloseFabian Groffen2020-05-251-1/+0
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: avoid invalid read in tree_foreach_packagesFabian Groffen2020-05-251-2/+5
| | | | | | | eat_file doesn't return how much data was written, only produced buffer size, so need to calculate length there Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* tests/valgrind-wrapper: use --track-origins for easier debuggingFabian Groffen2020-05-251-0/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: fix Coverity 210534Fabian Groffen2020-05-251-0/+1
| | | | | | | tree_close_pkg can be called from tree_open_pkg, which will then free the pointer de->d_name, which should only be freed by scandir_free. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: fix Coverity 210533Fabian Groffen2020-05-251-1/+1
| | | | | | ensure todo != NULL when attempting to turn into a list Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* README: fix bugzilla auto-urlFabian Groffen2020-05-251-3/+6
| | | | | | | also, simplify PORTDIR retrieval example and add qlop -E hint Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/atom: fixup USE-dep printing in atom_formatFabian Groffen2020-05-251-6/+14
| | | | | Bug: https://bugs.gentoo.org/724892 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* tests: add qmerge tests for different compression schemes in binpkgsFabian Groffen2020-05-251-1/+35
| | | | | | | | | | | While we had support for installing various compressed binpkgs, we never tested this at all. Especially since zstd now became the new standard Portage uses, it is a good idea to ensure we cope well with this. This new blob of tests, checks qtbz2, qlist and qmerge to disassemble, assemble and install binpkgs with all known supported compressors. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: use libq/tree for binpkg/Packages needsFabian Groffen2020-05-251-480/+116
| | | | | | | | | | | Instead of manual parsing of Packages file and traversing binpkgs, use the functionality provided by libq/tree, most notably tree_match_atom(). This is just phase one, where we replace the custom code with libq/tree code and then fill in the Pkg structure. In a next phase we should skip this and directly use tree_match_ctx, with atom and meta in there. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qatom: adjust to changed tree_match_atom interfaceFabian Groffen2020-05-251-5/+11
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: rework tree_match_atom to return a list of resultsFabian Groffen2020-05-252-25/+177
| | | | | | | | | | | | | Major change is that multiple results are returned, somewhat controlled by flags, and that the results are valid until the tree is closed. Each match result needs to be closed individually though. This required some hoops to make it work with Packages file or binpkg repos. The latter are largely simulated now, and do not really benefit from the cheaper point and lookup approach that tree_match_atom tries to provide. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: allow tree_foreach_packages to be called multiple timesFabian Groffen2020-05-251-0/+16
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: have tree_read_file_binpkg populate some meta fieldsFabian Groffen2020-05-251-0/+39
| | | | | | | | The SHA1 and SIZE fields might be necessary, so psuedo fill them in here, as we don't have a meta that contains them, except the file itself. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/tree: slightly optimise tree_open_pkgFabian Groffen2020-05-251-4/+5
| | | | | | | don't construct a new path, but open at the existing filedescriptor instead. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* libq/atom: add atom_clone functionFabian Groffen2020-05-252-0/+107
| | | | | | | atom_clone() does a deep copy of the given atom, such that it lives completely on its own and needs its own atom_implode() call. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qlop: fix inversed logicFabian Groffen2020-05-211-1/+1
| | | | | | | introduced in 20844dc943700cca72bbb6896f42adcd30de41e3, the intention was to suppress the warning, not raise it. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: calculate MD5/SHA1 hashes possibly in parallelFabian Groffen2020-05-171-14/+31
| | | | | | | take advantage of libq/hash's interface to parallelise hash computation if possible Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* hash_multiple_file_fd: return success statusFabian Groffen2020-05-172-13/+20
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qtbz2: drop warning about archive not being bz2 compressedFabian Groffen2020-05-171-3/+1
| | | | | | | | Since we support many compression formats, and Portage is switching to zstd compression by default, it makes no sense to warn about the compression format used. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qmerge: unpack tbz2 file without splitting it firstFabian Groffen2020-05-171-75/+59
| | | | | | | | | To save space, and also gain speed, unpack the archive and xpak contents directly off of the tbz2 file. This prevents us from having to shell out to qxpak and to simply spool the relevant part of the tbz2 file to the decompressor/tar. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* qxpak: reflect changed return value from xpak_processFabian Groffen2020-05-171-1/+2
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* xpak: change xpak_process to return start position of XPAKPACKFabian Groffen2020-05-171-5/+9
| | | | | | | Allow to get the size of the archive by a call to xpak_process, or failure if size is -1. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* travis: disable qcheck for valgrind tooFabian Groffen2020-05-172-3/+3
| | | | | | it's really a shame that valgrind crashes so often in the travis setup Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* travis: address build config validation issuesFabian Groffen2020-05-171-9/+3
| | | | | | | | | root: deprecated key sudo (The key `sudo` has no effect anymore.) root: missing dist, using the default xenial root: missing os, using the default linux root: key matrix is an alias for jobs, using jobs Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* travis: try default/stable ubuntu for valgrind runFabian Groffen2020-05-171-1/+1
| | | | Signed-off-by: Fabian Groffen <grobian@gentoo.org>