summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-04-12add --overwrite option to ignore file conflictsAndrew Gregory3-0/+10
Allows for safer, more fine-grained control for overwriting files than --force's all-or-nothing approach. Implements FS#31549. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-04-04parse stdin as newline-separatedAndrew Gregory1-32/+23
Newline-separated input is more reliable because most of the arguments we accept over stdin can validly contain spaces but not newlines. Resolves FS#52992 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-01-13Introduce a 'disable-download-timeout' optionChristian Hesse3-1/+13
Add command line option ('--disable-download-timeout') and config file option ('DisableDownloadTimeout') to disable defaults for low speed limit and timeout on downloads. Use this if you have issues downloading files with proxy and/or security gateway. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-01-04ini: only recognize comments at beginning of lineAndrew Gregory1-7/+2
Allows the hash sign to be used in values in config files and hooks. Fixes #48702 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-01-04pacman: ensure linkage against libarchiveDave Reisner1-1/+4
Fixes build on ubuntu/debian platforms. Signed-off-by: Allan McRae <allan@archlinux.org>
2017-01-04Update copyright yearsAllan McRae28-29/+29
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-12-05Suppress more output messages on successful -D options with -qAllan McRae1-4/+6
Suppress output on successful use of --asdeps and --asexplicit. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-12-05Give a "success!" message on database checkPatrick Eigensatz2-0/+9
'pacman -Dk' prints a "success!" message if there were no errors. It is possible to suppress the output using the '-q / --quiet' flag. This implements the feature discussed at https://bugs.archlinux.org/task/50087 Signed-off-by: Patrick Eigensatz <patrick.eigensatz@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-12-05Remove pacsortAllan McRae3-558/+1
Moved to the pacman-contrib project Signed-off-by: Allan McRae <allan@archlinux.org>
2016-10-22Represent bitfields as ints, not enumsIvy Foster9-32/+34
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-10-22Remove pactreeAllan McRae3-516/+1
This has been moved to the pacman-contrib project. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-09-25Do not #define _RESERVED_IDENTIFIERSIvy Foster9-27/+27
Signed-off-by: Ivy Foster <ivy.foster@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-08-30Normalize alpm download callback's frontend cb argumentsIvy Foster1-8/+11
When curl calls alpm's dlcb, alpm calls the frontend's cb with the following (dlsize, totalsize) arguments: 0, -1: initialize 0, 0: no change since last call x {x>0, x<y}, y {y>0}: data downloaded, total size known x {x>0}, x: download finished If total size is not known, do not call frontend cb (no change to original behavior); alpm's callback shouldn't be called if there is a download error. See agregory's original spec here: https://wiki.archlinux.org/index.php/User:Apg#download_callback Signed-off-by: Allan McRae <allan@archlinux.org>
2016-08-30Handle all POSIX compliant systems in mbscasecmp.Tobias Stoeckmann1-3/+5
The width of wchar_t is allowed to be of the same width as long, according to standards. The return type of mbscasecmp is int though. On amd64 with a 32 bit int, this means that mbscasecmp can return zero (indicating that strings are equal) even though the input strings differ. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-08-30Remove obsolete TODOAllan McRae1-1/+0
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-08-30Turn off colours once finished using themAllan McRae2-4/+5
The colour of the package version could leak onto the next line in both -Qo and -Fo. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-18Report local file URL for -Sp operations if package is in cacheAllan McRae1-3/+24
When using "pacman -Sp" operation to get URLs of packages to download, it is useful to know which packages are already in the file cache and do not need downloaded. Print packages in the cache with a file:// prefix. e.g $ pacman -Sp glibc file:///var/cache/pacman/glibc-2.23-1-x86_64.pkg.tar.xz Also use package locations in case statements rather than opersations. This allows the ALPM_PKG_SYNCDB to fall thorough to just printing the package name for weird serverless repo setups. Fixes FS#15868 Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-05pacsort help clearly states that files contain inputs to be sortedAshley Whetter1-1/+4
Fixes FS#44121 Signed-off-by: Ashley Whetter <ashley@awhetter.co.uk> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-05Add colour to the output of the "-{F, Q}o" operations.Xavion2-4/+7
Matching output for -s operations, the repository is coloured 'magenta', the package name is 'bold', and the version is outputted in 'green'. Signed-off-by: Xavion <Xavion (dot) 0 (at) Gmail (dot) com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-05Add colour to group selection dialogXavion2-4/+6
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-05Handle provides with -QAllan McRae1-0/+3
It is useful to be able to use "pacman -Qi" on any dependency, even if that dependency is a provide. For example, on Arch Linux systems, "sh" is provided by the "bash" package, and many packages depend on "sh". Querying the package that provides the "sh" dependency currently requires first searching for "sh". This patch allows the use of "pacman -Qi" on a provide. Fixes FS#20650. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-05pacman_query: move error messages into relevant if statementsAllan McRae1-16/+16
This ensures any additions to these test do not have to rely on the correct error condition being set by libalpm. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-05Remove notification of system upgrade when only printing URLsAllan McRae1-3/+5
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-05-05Print replacements when using -SupAllan McRae1-4/+8
When printing a list of URLs of packages to be updated, pacman was ignoring any replacements that would be made in the update process. Fixes FS#35812 Signed-off-by: Allan McRae <allan@archlinux.org>
2016-03-28Do not add root prefix twice when checking database filesAllan McRae1-24/+30
When checking .INSTALL and .CHANGELOG files in the mtree file, we need to find the path they are stored in the local database. This was appending the root prefix twice as alpm_option_get_dbpath already returns the absolute path to the database. While fixing that issue I added checks that the paths for the database files were not longer than PATH_MAX. Fixes FS#48563. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-26use multi-byte character matching for user inputAndrew Gregory1-2/+34
Fixes FS#47992 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-26Failed database downloads cause transaction to stopAllan McRae1-10/+3
Previously, we errored only if all databases failed to download. If any database downloads fail, we are unable to determine whether an update is still considered safe. So now if any database download fails, the transaction is aborted (after attempting all database downloads). Fixes FS#47599. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-26Use versions specified in optdependsAllan McRae1-2/+2
Checking install status and if a package is optionally required on removal now considers the version of the optdepend. Fixes FS#44957. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-26Consider provides when labelling optdepends status as pending installAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-23Regenerate translations for 5.0.1Allan McRae45-4149/+7581
2016-02-23Manually fix space before ellipses in translationsAllan McRae49-97/+97
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-23Fix inconsistent status messagesStefan Tatschner1-1/+1
This patch fixes an inconsistency in the status messages. :: Proceed with installation? [Y/n] :: Retrieving packages ... <--- Space before "...". blas-3.6.0-4-x86_64 cblas-3.6.0-4-x86_64 lapack-3.6.0-4-x86_64 (3/3) checking keys in keyring (3/3) checking package integrity (3/3) loading package files (3/3) checking for file conflicts (3/3) checking available disk space :: Processing package changes... <--- No space before "..." (1/3) upgrading blas (2/3) upgrading cblas (3/3) upgrading lapack Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-23Pull translation updates from TransifexAllan McRae44-5851/+2444
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-02-20dump_pkg_info: fix wide character title alignmentAndrew Gregory1-5/+12
The padding added to the end of the title was based on the return value of mbstowcs which is the number of characters. This caused alignment issues for languages with characters that span multiple columns. Instead, base the padding on the number of columns needed by the translated string as returned by wcswidth. Fixes #47980 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-30Update translationsAllan McRae50-672/+2477
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-25Remove spacing when outputting package sizesAllan McRae1-3/+3
This spacing appears to have been added to align sizes. It sometimes worked... $ pacman -Si glibc | grep Size Download Size : 8.03 MiB Installed Size : 35.08 MiB And it sometimes failed... $ pacman -Si pacman | grep Size Download Size : 662.82 KiB Installed Size : 4045.00 KiB Remove the spaces for a consistent output. Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-17Pull translations updates from TransifexAllan McRae49-8542/+8050
Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-04pacsort, introduce define for escape_char error codeRikard Falkeborn1-5/+6
The signedness of char is implementation defined. On systems where char is unsigned, comparing a variable of type char with -1 is never true, due to integer promotion rules. To avoid this, introduce a define for invalid field separators where -1 is cast to char. This will ensure that the return value check works for both unsigned and signed char. Fixes one warning [-Wtype-limits] for comparissons with -1 when compiling with -funsigned-char. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2016-01-04Update copyright years for 2016Allan McRae30-31/+31
make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-15Give error message when --files will do nothingAllan McRae1-1/+6
Point people towards the help when using "pacman -F" or "pacman -F foo". Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-15alpm-hooks: add Description fieldAllan McRae1-1/+2
The "Description" field allows a hook to provide a some text for frontends to use in describing what the hook is doing. For example: Description = updating info page directory Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-15Show progress processing hooksAllan McRae1-6/+21
Introduces the ALPM_EVENT_HOOK_RUN_{START,DONE} events that are triggered at the start and end of running an individual hook. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-15Add ALPM_EVENT_TRANSACTION_{START,DONE} eventsAllan McRae1-0/+4
This provides a way to detect when the processing of package changes starts, allowing pacman to delineate hook output and package installation/removal output. Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-15Add events ALPM_EVENT_HOOK_{START,DONE}Olivier Brunel1-0/+8
Add events to let frontends know when hooks are being processed (and when it's done), as that might be useful to update the UI. Signed-off-by: Olivier Brunel <jjk@jjacky.com>
2015-12-09Pull translations from Transifex and prepare for next releaseAllan McRae50-17006/+26938
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-05remove soft interrupt handler before cleanupAndrew Gregory3-0/+12
The soft interrupt handler dereferences config, causing a segfault if it is called during cleanup. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-05extract soft interrupt handlersAndrew Gregory3-22/+17
Delays handler setup until after config is set to a valid value to avoid a segmentation fault. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-05extract SIGSEGV handlerAndrew Gregory3-17/+29
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-05extract SIGWINCH handlerAndrew Gregory3-5/+22
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2015-12-05move signal handlers to sighandler.[ch]Andrew Gregory4-58/+122
Signals are special because they run asynchronously, making them non-trivial to handle correctly. Move the handlers a separate file to offset them from the normal code and make them easier to separate into individual functions without further cluttering pacman.c Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>