summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.c
Commit message (Collapse)AuthorAge
* sortbydeps: rename vptr -> iAndrew Gregory2017-04-16
| | | | | | vptr is a simple list iterator, which are typically named i. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* sortbydeps: rename found -> switched_to_childAndrew Gregory2017-04-16
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* sortbydeps: factor out dep cycle warningAndrew Gregory2017-04-16
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* graph.h: rename childptr -> iteratorAndrew Gregory2017-04-16
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* graph.h: replace hardcoded values with an enumAndrew Gregory2017-04-16
| | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* Update copyright yearsAllan McRae2017-01-04
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* recursedeps: include cyclic dependenciesAndrew Gregory2016-08-30
| | | | | | | | | | | | | | Cyclic dependencies (A depends on B, B depends on A) were not selected because neither package could be removed individually, so can_remove_package would always return false for both. By preselecting all dependencies then filtering back out any dependencies still required by any packages that will not be uninstalled, groups of unneeded cyclic dependencies can be found. Fixes FS#41031 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* fix spelling mistakesEric Engestrom2016-05-05
| | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright years for 2016Allan McRae2016-01-04
| | | | | | make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
* Alpm, check for NULL in free-functionsRikard Falkeborn2015-10-27
| | | | | | | | Also, use FREE() instead of free() in _alpm_backup_free() to set the pointers to NULL. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* sortbydeps: skip local packages being updatedAndrew Gregory2015-09-19
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright notices for 2015Allan McRae2015-02-01
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* initialize pointers passed to _alpm_pkg_dupAndrew Gregory2015-01-02
| | | | | | | | | | _alpm_pkg_dup leaves the destination pointer unaltered in case of fatal errors, so when commits 2f0ca00e and be4198b3 freed the pointer, they fixed a memory leak on non-fatal errors by replacing it with a segmentation fault on fatal errors. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Initialize memory to prevent issues when freeing on errorAllan McRae2014-12-27
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* _alpm_recursedeps: free memory on errorAllan McRae2014-12-27
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm_dep_from_string: free memory on errorAllan McRae2014-12-24
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* _alpm_dep_dup: free memory on errorAllan McRae2014-12-24
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* depmiss_new: free memory on errorAllan McRae2014-12-24
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Add --assume-installed optionFlorian Pritz2014-09-30
| | | | | | This allows to ignore specific dependencies. Signed-off-by: Florian Pritz <bluewind@xinu.at>
* libalpm: export alpm_splitdep as alpm_dep_from_depstring and alpm_dep_freeFlorian Pritz2014-09-30
| | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* deps.c: split _alpm_depcmp into _alpm_depcmp_providesFlorian Pritz2014-09-30
| | | | | | | This allows to reuse the provision checker for a simple list of provisions without a package. Signed-off-by: Florian Pritz <bluewind@xinu.at>
* deps.c: use alpm_list_find_ptrAndrew Gregory2014-08-04
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* dep_graph_init: filter ignored packages by nameAndrew Gregory2014-08-04
| | | | | | | | Ignored packages are from the transaction remove list which consists of duplicated packages so a direct pointer comparison is not appropriate. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update the question callbackOlivier Brunel2014-06-24
| | | | | | | | | | | | Much like with events, instead of using a bunch of void* arguments for all questions, we now send one pointer to an alpm_question_t union. This contains the type of question that was triggered. With this information, a question-specific struct can be accessed in order to get additional arguments. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* alpm: export *_free functionsAndrew Gregory2014-02-04
| | | | | | | Front-ends should be able to free memory that alpm hands them. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* _alpm_resolvedeps: free targ inside loopAndrew Gregory2014-01-30
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Remove ts and sw from vim modeline when noet is setFlorian Pritz2014-01-28
| | | | | | | | | | | | Forcing vim users to view files with a tabstop of 2 seems really unnecessary when noet is set. I find it much easier to read code with ts=4 and I dislike having to override the modeline by hand. Command run: find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} + Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright years for 2014Allan McRae2014-01-06
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* deps.c: remove filtered_depend functionsAndrew Gregory2014-01-06
| | | | | | | | | | | | filtered_dep was duplicating an alpm_depend_t solely for the purpose of overriding its depmod and would effectively cause alpm_checkdeps to ignore ALPM_TRANS_FLAG_NODEPVERSION if the duplication failed. Manually overriding/restoring the depmod for the original depend removes the duplication as a point of failure and fixes a memory leak where the duplicated depend was not being properly freed. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix whitespace and other formatting issuesJason St. John2013-11-15
| | | | | | | | | This commit: -- replaces space-based indents with tabs per the coding standards -- removes extraneous whitespace (e.g. extra spaces between function args) -- adds missing braces for a one-line if statement Signed-off-by: Jason St. John <jstjohn@purdue.edu>
* deps.c: pass alpm_list** to _alpm_recursedepsAndrew Gregory2013-10-31
| | | | | | | | Improves consistency and makes it clear that targs will be modified by _alpm_recursedeps. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* sortbydeps: include local pkgs in dep graphAndrew Gregory2013-10-31
| | | | | | | | | | | | | | | | Detecting indirect dependencies by traversing a package's entire dependency tree is prohibitively slow for larger transactions. Instead add local packages to the dependency graph. This additionally requires delaying dependency ordering for sync operations so that removed packages may be excluded from dependency detection. tests/sync012.py was also updated to ensure that the dependency cycle was actually detected. Fixes FS#37380 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Expose alpm_pkg_should_ignoreAllan McRae2013-10-31
| | | | | | | This function is useful for frontends to annotate package upgrades that will be ignored. Signed-off-by: Allan McRae <allan@archlinux.org>
* libalpm: introduce a usage level for reposDave Reisner2013-09-04
| | | | | | | | | | | | | | | | This defines a level of interest a user has in a repository. These are described by the bitmask flags in the alpm_db_usage_t enum: ALPM_DB_USAGE_SEARCH: repo is valid for searching ALPM_DB_USAGE_INSTALL: repo is valid for installs (e.g. -S pkg) ALPM_DB_USAGE_UPGRADE: repo is valid for sysupgrades ALPM_DB_USAGE_ALL: all of the above are valid Explicitly listing the contents of a repo will always be valid, and the repo will always be refreshed appropriately on sync operations. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* deps.c: check for indirect deps when orderingAndrew Gregory2013-06-26
| | | | | | | | | | | | | | | | | | | | On upgrades, indirect dependencies were not being detected if there was a dependency in between them that was not part of the transaction. For example, with the dependency chain: pkg1 -> pkg2 -> pkg3, if pkg1 and pkg3 are being upgraded but not pkg2 pacman would not order pkg1 and pkg3 properly. This was particularly problematic when replacements were involved because the replaced package(s) would be removed at the start of the transaction. If an install script required the replacer and lacked a direct dependency, it could fail. Fixes FS#32764. Partially fixes FS#23011. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix comment typoAllan McRae2013-05-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix spelling errors using 'codespell' toolAnatol Pomozov2013-04-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright year for 2013Allan McRae2013-01-03
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Make alpm_pkg_find publicAllan McRae2012-12-14
| | | | | | This function is particularly useful, so make it public. Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix overzealous package removal with unmet dependenciesAndrew Gregory2012-12-14
| | | | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> [Allan: Remove expected failure from fixed pactests] Signed-off-by: Allan McRae <allan@archlinux.org>
* fix -Wshadow warnings as reported by gcc 4.4.3Dave Reisner2012-05-20
| | | | | | | | | Apparently gcc 4.7 has decided that -Wshadow warnings aren't worth reporting anymore even with the flag enabled. These were found on an Ubuntu 10.04 install. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Various tweaks to support building with excessive GCC warning flagsDan McGee2012-04-08
| | | | | | | | | This fixes a bunch of small issues in order to enable a clean successful build with a crazy number of GCC warning flags. A lot of these changes are covered by -Wshadow, -Wformat-security, and -Wstrict-overflow=5. Signed-off-by: Dan McGee <dan@archlinux.org>
* Allow alpm_depend_t to have a descriptionDan McGee2012-03-08
| | | | | | | | | | | | | | | This is the first step in parsing and handling optdepends. There is no behavior change introduced in this commit; however, depends that contain a ": " string will now be parsed as having a description and it will be stored in the depend structure. Later patches will utilize this new field as appropriate. This is heavily based on the work of Benedikt, who did something similar but introduced a new type for this rather than only a new field to the existing type. Heavily-influenced-by: Benedikt Morbach <benedikt.morbach@googlemail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2012-02-20
|\ | | | | | | | | | | Conflicts: contrib/pacsysclean.in src/pacman/conf.h
| * Revert "Add -S --recursive operation"Dan McGee2012-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f3fa77bcf1d792971c314f8c0de255866e89f3f3 along with making other necessary changes to fully back this (mis)feature out until we can do it correctly. The quick summary here is this was not implemented correctly; provides are not fully taken into account in this logic, and making that happen exposes a lot of other flaws in this code that are covered up later on in the dependency resolving process by several other pieces of convoluted and conditional logic. Tests have been adjusted accordingly. Some test EXISTS conditions have been removed as we already know the package is installed locally, and we also are checking the VERSION condition anyway. With these two related revert commits, we do have some changes in test pass/fail results: * upgrade078.py: does not pass, this is due to --recursive getting removed for -U/-S operations after this commit. * sync302.py: the version checks have been disabled, so this test continues to pass but has been scaled back in scope. * sync303.py: now passes, was failing before. * sync304.py: still failing, was failing before. * sync305.py: now passes, was failing before. * sync306.py: still passes, was passing before. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Update copyright yearsAllan McRae2012-02-20
| | | | | | | | | | | | | | Add 2012 to the copyright range for all libalpm and pacman source files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | libalpm/deps.c: access trans flags directlyDan McGee2012-01-23
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | include config.h via MakefilesDave Reisner2011-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensures that config.h is always ordered correctly (first) in the includes. Also means that new source files get this for free without having to remember to add it. We opt for -imacros over -include as its more portable, and the added constraint by -imacros doesn't bother us for config.h. This also touches the HACKING file to remove the explicit mention of config.h as part of the includes. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | code syntax cleanupDave Reisner2011-12-12
|/ | | | | | | As per HACKING file, we use 'CTRL(' rather than 'CTRL (' Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Allow sync_prepare to work in certain cases without sync databasesDan McGee2011-11-15
| | | | | | | | | | | | | When doing a bare -U operation on a local package that doesn't pull in any dependencies from the sync databases, we can get away with missing database files. This makes the check conditional on no sync targets found in the target list. This is not the prettiest code here so we have a bit of hackish behavior required to straighten both the behavior and the nonsensical error message out. Addresses FS#26899. Signed-off-by: Dan McGee <dan@archlinux.org>