summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-05-08Fix clang 8 string-plus-int warningsRikard Falkeborn1-2/+2
Clang 8 warns that adding a string to an integer does not append to string. Indeed it doesn't, but that was not the intentetion. Use array indexing as suggested by the compiler to silence the warning. There should be no functional change. Example of warning message: alpm.c:71:54: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] sprintf(hookdir, "%s%s", myhandle->root, SYSHOOKDIR + 1); ~~~~~~~~~~~^~~ alpm.c:71:54: note: use array indexing to silence this warning sprintf(hookdir, "%s%s", myhandle->root, SYSHOOKDIR + 1); ^ & [ ] 1 warning generated.
2019-03-07Remove support for deltas from libalpmAllan McRae1-8/+0
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-03-07Make pacman forget deltas existAllan McRae5-62/+9
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-03-07Remove cleanupdeltaAllan McRae5-143/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-03-07pacman: fix segfault when Usage is specified without a valuemorganamilo1-18/+20
And extract all the common code to a macro. Signed-off-by: morganamilo <morganamilo@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-02-21Use standard, consistent units in the download progress.Sever Oraz1-10/+10
Rather than use M/s which can be either MB or MiB, specify that it uses MiB (consistent with the displayed total size). Fixes FS#59201 Signed-off-by: Sever Oraz <severoraz@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2019-02-12Add implicit fall through warningAllan McRae1-1/+1
Requires modification to our comment about fall through to match compilers expectations. Works for GCC and Clang. Signed-off-by: Allan McRae <allan@archlinux.org>
2019-02-04fix various typosmorganamilo1-1/+1
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 McRae1-1/+5
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 McRae1-2/+2
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 Straube2-17/+4
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 Gregory1-2/+1
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 Reisner4-0/+45
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 ignoredmorganamilo1-0/+18
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 searchmorganamilo3-15/+22
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 Schwartz1-1/+1
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 DisableDownloadTimeoutmorganamilo1-0/+3
Signed-off-by: morganamilo <morganamilo@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2018-08-29Show install status during file searchmorganamilo1-1/+5
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 Reisner1-1/+0
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-08-29common/ini: Depend on util-common, not utilDave Reisner1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-08-10Remove the last traces of the pacman --force optionAllan McRae2-8/+0
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-07-27Pull updated translations from TransifexAllan McRae43-1665/+1705
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-07-25Revert "Deprecate --root in favour of --sysroot"Allan McRae1-2/+1
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 McRae1-2/+2
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 McRae25-14147/+577
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 McRae50-3714/+2901
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-05-14Remove all modelines from the projectEli Schwartz29-59/+0
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 McRae46-12906/+19940
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-04-29Import updated translations from TransifexAllan McRae51-9874/+8417
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-04-29Update POTFILES.inAllan McRae1-0/+9
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 McRae1-1/+1
This prevents a valgrind warning from deep inside wcstombs. Signed-off-by: Allan McRae <allan@archlinux.org>
2018-03-14Update coyrights for 2018Allan McRae28-29/+29
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 Foster1-1/+7
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-03-14pacman-conf.c: exit if cannot create config data structureIvy Foster1-1/+4
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-03-14pacman-conf.c: add short optionsIvy Foster1-8/+8
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 Foster1-15/+9
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 Foster1-1/+2
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 McRae1-1/+2
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 Schwartz1-8/+5
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 Gregory3-1/+455
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 Gregory2-78/+89
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 Gregory2-4/+10
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 McRae1-0/+5
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 Schwartz1-2/+1
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 Straube1-4/+8
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 Gregory1-5/+6
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 Gregory1-2/+3
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 Gregory1-1/+1
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 Gregory1-1/+6
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 Gregory1-0/+1
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>