summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-02-04fix various typosmorganamilo
Signed-off-by: morganamilo <morganamilo@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10Add [ignored] to -Qu output for packages in repos that are not Usage = UpgradeAllan McRae
List all available updates in -Qu output, but include [ignored] beside those that will not be updated in a -Su operation due to thier repo Usage value (in addition to those that are Ignored). Fixes FS#59854. The following people provided initial patches to print [ignored] on -Qu operations, which highlighted a larger problem to be fixed first: With-thanks-to: morganamilo <morganamilo@gmail.com> With-thanks-to: Michael Straube <michael.straube@posteo.de> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10libalpm/sync.c: change alpm_sync_newversion() to alpm_sync_get_new_version()Allan McRae
The behaviour of "pacman -Qu" was very strange... It would only consider packages from repos with Usage = Search (or All), and ignore those with Usage = Sync, Install or Upgrade. This is because the function alpm_sync_newversion() used ALPM_DB_USAGE_SEARCH for its filtering. Given this function is documented (at least in the source) to "Check for new version of pkg in sync repos", I would expect that to look at all repos. However, just changing this parameter, would result in a fairly silent change in behaviour of this function. Instead, rename the function and remove this filtering altogether. Users of this function can filter the dbs passed to this function to achieve their desired output. 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-11-28common/ini: remove unnecessary alpm includeAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-11-02Add meson.build files to build with mesonDave Reisner
Provide both build systems in parallel for now, to ensure that we work out all the differences between the two. Some time from now, we'll give up on autotools. Meson tends to be faster and probably easier to read/maintain. On my machine, the full meson configure+build+install takes a little under half as long as a similar autotools-based invocation. Building with meson is a two step process. First, configure the build: meson build Then, compile the project: ninja -C build There's some mild differences in functionality between meson and autotools. specifically: 1) No singular update-po target. meson only generates individual update-po targets for each textdomain (of which we have 3). To make this easier, there's a build-aux/update-po script which finds all update-po targets and runs them. 2) No 'make dist' equivalent. Just run 'git archive' to generate a suitable tarball for distribution.
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-09-19Show group status during file searchmorganamilo
When doing "pacman -Fs", show the "(groupname)" message just like "pacman -Ss". And refactor group printing to its own function. Signed-off-by: morganamilo <morganamilo@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-09-19pacman: check versioned optdepends in -Qi operationEli Schwartz
Fixes FS#60106 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-09-18pacman-conf: add missing DisableDownloadTimeoutmorganamilo
Signed-off-by: morganamilo <morganamilo@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-08-29Show install status during file searchmorganamilo
When doing "pacman -Fs", show the "[installed: version]" message just like "pacman -Ss". Signed-off-by: morganamilo <morganamilo@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-08-29pacman/conf: Remove unused includeDave Reisner
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-08-29common/ini: Depend on util-common, not utilDave Reisner
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-08-10Remove the last traces of the pacman --force optionAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-07-27Pull updated translations from TransifexAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-07-25Revert "Deprecate --root in favour of --sysroot"Allan McRae
The use of --sysroot in the real world has flagged some issues that need addressing. Undeprecate --root for now. This reverts commit a278356f75866f89232e3e6230bbf9fb2dc1893c. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-06-04pacman-conf: fix detection of repo usageAllan McRae
pacman-conf returned All for any repo Usage query because it was checking if any repo options were enabled rather than if all options were enabled. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-05-28Pull updated translations from TransifexAllan McRae
Also remove any translations that are less than 75% complete. These will be readded once translation completion passes our minimum threshold. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-05-15Pull translations from Transifex and regenerateAllan 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-04-29Initial translation preparation for pacman-5.1Allan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-04-29Import updated translations from TransifexAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-04-29Update POTFILES.inAllan McRae
Add all files to the relevant POTFILES.in. This avoids missing translations added to old files. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-03-14make_aligned_titles: initialise wbufAllan McRae
This prevents a valgrind warning from deep inside wcstombs. 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>
2018-03-14pacman-conf.c: exit if cannot set rootdir or parse config fileIvy Foster
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-03-14pacman-conf.c: exit if cannot create config data structureIvy Foster
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-03-14pacman-conf.c: add short optionsIvy Foster
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-02-06src/pacman/query.c: do not exit -Qo with error if file does not existIvy Foster
Query operations act on the local db, not the filesystem. Also, a valid use case for -Qo is to discover what package owns a deleted file so it can be reinstalled. Closes FS#55856. Signed-off-by: Ivy Foster <iff@escondida.tk> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-02-06pacman/query.c: in query_fileowner, make is_dir an intIvy Foster
S_ISDIR is int and "returns non-zero" if the file is a directory. Signed-off-by: Ivy Foster <iff@escondida.tk> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-01-19Deprecate --root in favour of --sysrootAllan McRae
The --root option was widely misunderstood, and is now replaced by --sysroot. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-01-19vercmp: fail when the wrong number of arguments are providedEli Schwartz
Fixes FS#49093 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-01-19add pacman-conf utilityAndrew Gregory
Parsing pacman's configuration file is non-trivial and extremely difficult to do correctly from scripts; even our own do it incorrectly. pacman-conf is a dedicated tool specifically to allow scripts to parse config files, getting the same value that pacman itself would use. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-01-18extract default settings to separate functionAndrew Gregory
Default values for configuration settings were being set during alpm setup and in some cases were never saved back to the original config struct. Refactoring all default settings into a separate function and saving them onto the original config struct will allow pacman-conf to resolve the defaults without having to setup alpm. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-01-18extract raw config file parserAndrew Gregory
To allow pacman-conf to parse the configuration file without having to also setup alpm. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-01-09Handle empty string passed to query_ownerAllan McRae
Passing an empty string to pacman -Qo results in: error: No package owns <first directory in $PATH> Catch empty strings and report an error. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-01-06vercmp: remove --usage variant of the -help optionEli Schwartz
I think two ways to ask for this are enough for everyone, and we have never documented this anyway. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-07-28Fix coding style issue in pacman/util.cMichael Straube
Add missing braces to some one-line if blocks. Signed-off-by: Michael Straube <straubem@gmx.de> 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-07-11provide command for downloading missing databasesAndrew Gregory
This is primarily to help users who are not aware that -F operations use a separate set of databases that need to be separately downloaded. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-05-16remove unused byte from user agent bufferAndrew Gregory
snprintf prints at most n bytes including the terminating '\0'. The extra reserved byte was never being used. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-05-16check for overflow when setting HTTP_USER_AGENTAndrew Gregory
gcc7 issues a warning about a potential overflow if left unchecked. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-05-16query_fileowner: avoid buffer overflowAndrew Gregory
Copying a string into a buffer that has just been determined to not be able to hold it is obviously incorrect. The actual error handling appears to have been unintentionally removed in 47762ab687959e48acc2de8592fcf3ba3cfa502b. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-05-08free memory for --overwrite listsAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-04-16add --sysroot optionAndrew Gregory
--root is not sufficient to properly operate on a mounted guest system. Using --root still uses the host system's configuration and there is no way to correctly use the guest configuration without manually modifying any Include directives. --sysroot provides an easier way to operate on a guest system by chrooting immediately after option parsing before configuration parsing or performing any operations. It is currently limited to the root user, but that's enough for restoring a guest system to a working state, which is the primary intended use case. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2017-04-16conflict: include owner for filesystem conflictsAndrew Gregory
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2017-04-12deprecate --force in favor of --overwriteAndrew Gregory
--force is widely misunderstood and the same effect can now be achieved with --overwrite, which is better named and can be used more safely. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2017-04-12add --overwrite option to ignore file conflictsAndrew Gregory
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 Gregory
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 Hesse
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>