summaryrefslogtreecommitdiff
path: root/src/pacman/sync.c
AgeCommit message (Collapse)Author
2019-03-07Make pacman forget deltas existAllan McRae
Dummy callbacks are still present to prevent compiler warnings until libalpm is delta free. Also remove Delta parsing from pacman.conf. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-04Move skipping of duplicate sync/remove targets into libalpmMichael Straube
sync: As pointed out by Andrew Gregory there could be an error when adding duplicates if they are two separate packages with the same name. Add a check in alpm_add_pkg() to test whether the duplicate is actually the same package, and if so, log a debug message and return success to skip the package. If the duplicate is a different package return ALPM_ERR_TRANS_DUP_TARGET and treat that error just like any other error in pacman. remove: Change alpm_remove_pkg() to just log a debug message and return success to skip duplicates. Remove the handling of ALPM_ERR_TRANS_DUP_TARGET in pacman. Also fixes FS#49377. Suggested-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Michael Straube <michael.straube@posteo.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-10-20pacman: don't error when a group exists but all packages are ignoredmorganamilo
Currently when attempting to sync a group where all packages are ignored, either by ignorepkg, ignoregroup or --needed, pacman will error with "target not found". Instead, if a group has no packages check if the group exists before throwing an error. Signed-off-by: morganamilo <morganamilo@gmail.com>
2018-08-10Remove the last traces of the pacman --force optionAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-05-14Remove all modelines from the projectEli Schwartz
Many of these are pointless (e.g. there is no need to explicitly turn on spellchecking and language dictionaries for the manpages by default). The only useful modelines are the ones enforcing the project coding standards for indentation style (and "maybe" filetype/syntax, but everything except the asciidoc manpages and makepkg.conf is already autodetected), and indent style can be applied more easily with .editorconfig Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-03-14Update coyrights for 2018Allan McRae
make update-copyright OLD=2017 NEW=201 Signed-off-by: Allan McRae <allan@archlinux.org>
2017-07-11clarify broken dependency error messagesAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-04-16conflict: include owner for filesystem conflictsAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2017-01-04Update copyright yearsAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-22Represent bitfields as ints, not enumsIvy Foster
Many bitfield variables are declared to be enums, because they are generated using bitwise operations on enums such. However, their actual values aren't necessary members of their parent enum, so declaring them 'int' is more accurate. Signed-off-by: Ivy Foster <ivy.foster@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-05Add colour to group selection dialogXavion
Colour the group name in 'blue' and the repository names in 'magenta'. Signed-off-by: Xavion <Xavion (dot) 0 (at) Gmail (dot) com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-05Remove notification of system upgrade when only printing URLsAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-04Update copyright years for 2016Allan McRae
make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
2015-11-04add detail to broken dependency errorsAndrew Gregory
The difference between a sync target having an unmet dependency and breaking a dependency for an installed package is a common source of confusion. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-27Use ARRAYSIZE macro for non-string array size computationPierre Neidhardt
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15pacman: move database syncing to util.cAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15Add pacman support for .files databasesAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-14Simplify sync_cleandbAllan McRae
1) Remove checks for removing pre-tardb files 2) Remove the long redundant keep_used parameter 3) Fix pacman error due to removing .sig file along with database Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03sync_cleandb: ensure stat call succeedsAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01Update copyright notices for 2015Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-12-18Fix pointer declarations to be globally consistentMicah Saint Germain
Refactored inconsistent pointer declarations to better improve consistency throughout the pacman codebase which will, in turn, increase readability to the user. Expected format of a pointer declaration: `typename *varname` Signed-off-by: Micah Saint Germain <micah@lexme.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-08-04sync.c: fix style violationsAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-04remove check for unused ALPM_ERR_PKG_IGNOREDAndrew Gregory
alpm_add_pkg does not ignore packages. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-03-03Fix warnings with strict-overflow in gcc-4.9Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-02-04alpm: export *_free functionsAndrew Gregory
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>
2014-02-04Give groups display text singular and plural formsAllan McRae
Reported on transifex Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28Remove ts and sw from vim modeline when noet is setFlorian Pritz
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>
2014-01-06Update copyright years for 2014Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-08Remove spaces between the opening "if" and the opening parenthesisJason St. John
Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-09-04pacman: add front end support for repo usage levelDave Reisner
Add a "Usage" key to the repo section of the config which allows for the tokens "Search", "Install", "Upgrade", "All", which correspond to values in the alpm_db_usage_t enum. Users can specify "Usage" multiple times for a given repo, or multiple flags per "Usage" line and they will be OR'd together. If unspecified, the default is full usage of the repo. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21Do not refer to FlySpray numbersAllan McRae
These references to bug numbers assume we will forever be using that bug tracker. It is better to properly comment the code instead (which was done in almost all cases anyway). Signed-off-by: Allan McRae <allan@archlinux.org>
2013-07-22Corrected return codes for Sg flagAshley Whetter
Non-zero is now returned if a group is searched for that doesn't exist. Fixes FS#36097. Signed-off-by: Ashley Whetter <awhetter.2011@my.bristol.ac.uk> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-06-26skip unknown repo names for pacman -SlAndrew Gregory
Brings pacman -Sl behavior in line with other listing operations. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-05-29Clean partial downloads from cacheAllan McRae
When using "pacman -Sc" to clean the cache, it make sense to also remove partially downloaded files. Fixes FS#34317. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07colourize -Sl/-QlSimon Gomizelj
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07remove :: prefix from all messageSimon Gomizelj
This will substantially simplify the logic to add colours to messages. Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-03-07refactor common code in query_search/sync_searchSimon Gomizelj
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-24Perform limited conflict checking with --forceAllan McRae
Pacman currently bails when trying to extract a file over a directory when using --force. Instead of ignoring all conflict, perform the check and skip any file-file conflicts. Conflicts between directories and files are still flagged and cause the transation to abort. As a bonus, we now know about files changing packages when using --force, so we can skip removing them fixing upgrade046. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-02-09Exit with failure status if download or installation is not confirmedMartin Panter
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28add caller prefix to alpm_logactionAndrew Gregory
prefix defaults to "UNKOWN" if null or an empty string is provided. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Fix space between control structure and open parensGerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-04Fix missing spaces in operatorsGerardo Exequiel Pozzi
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-03Update copyright year for 2013Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2012-08-02Allow cleaning only some cachedirsJan Alexander Steffens (heftig)
When cleaning the cache, ask for each cachedir separately. Allan: add some white space in output Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01Clean up exclusion list in sync cache cleanupDan McGee
Make an array out of our various glob skip patterns and loop through them looking for items to skip. Additionally, when doing a full clean, delete all objects rather than respect this skip list. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-01Skip deltas and partial downloads in package cleanupDan McGee
This affects -Sc only, not -Scc. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-12Remove SyncFirst optionDan McGee
This has outlived its usefulness and causes more problems than it solves. It has historically only ever been used to install pacman first. That should not be needed given we provide the vercmp utility (which has no library dependencies) and so calling pacman in install scripts is a sign of poor packaging. Work-duplicated-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-08Various tweaks to support building with excessive GCC warning flagsDan McGee
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>
2012-04-07pacman: show groups once with -SgPierre
Only displays groups that haven't appeared yet.. Previously 'pacman -Sg' iterated over syncs, printed every group. This change does not affect '-Sgg' which still orders by sync first. To reproduce, on a current Arch Linux with [extra] and [community]: $ pacman -Sg|sort|uniq -c|sort -n [...] 1 xorg-fonts 2 vim-plugins 2 xfce4-goodies Signed-off-by: Pierre <pierre@spotify.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-16Reduce calls to getcolsDan McGee
This dramatically improves upon a much older attempt in 2008 in commit ce3d70aa99ab86. We don't need to call it once per line we print unless there is a reasonable expectation of being able to resize the terminal mid-operation; this is really only the case during our callback progress bars. Some before and after numbers of ioctl() calls, gleaned from strace of the following operations (no targets to any of them to maximize the amount of output): pacman -Qii : 37768 -> 2616 (93.1% decrease) pacman -Qs : 2616 -> 4 (99.8%) pacman -Sii : 133036 -> 10926 (91.8%) pacman -Ss : 10926 -> 14 (99.9%) Obviously the search results are astounding; we only call getcols() once in the case of -Qs, and once per repo in the case of -Ss. For -Qii and -Sii we are still calling it once per package, but this is much better than once per line of info output. Signed-off-by: Dan McGee <dan@archlinux.org>