Commit Graph

1522 Commits

Author SHA1 Message Date
Allan McRae 29d4dcf767 Pluralize malloc failure string
Not particularly useful in English (will always be plural), but useful in
languages that have multiple plural forms.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-19 13:48:56 +10:00
Pierre Neidhardt c99ebca83e package.c: Comment style
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 11:24:31 +10:00
Allan McRae 002acb4674 Do not print any root prefix in files database operations
Combining with the --root flag and outputing a consistent root prefix leads
to many situations that make no sense.  Instead, do not print any prefix for
any --files operations.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 11:16:44 +10:00
Pierre Neidhardt cbb7e180c7 package.c: Remove obsolete param from doc
Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:24 +10:00
Andrew Gregory 7000bf9198 pacman: add user hook directories
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-10-18 10:59:23 +10:00
Andrew Gregory af747ef34a move ini parser into common
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20 17:36:53 +10:00
Andrew Gregory edbe6c2bdc move strtrim to util-common
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-09-20 17:36:27 +10:00
Andrew Gregory 48f4efd9a1 copy assumeinstalled options
All other option setters copy their input.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:41:14 +10:00
Rikard Falkeborn 2d0e2bf255 pacman/util.c: Fix memory leak if realloc fails
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:36:21 +10:00
Allan McRae b8c9385b8b Remove ko_KR translation
The "ko_KR" locale is the same as the "ko" locale.  Remove the "ko_KR" variant
as it is incomplete and has been superseded by "ko" on transifex.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-08-08 10:36:03 +10:00
Allan McRae 8566034866 pacman/files.c: fix memory leak on regex error
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-20 13:41:36 +10:00
Allan McRae 3c41030964 Handle repo/pkg style arguments to sync repo file listing
Passing "-Fl pkg" will print the filelist for the first occurance of "pkg"
in the sync repos. Other version of the package can be printed using
"-Fl repo/pkg".

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:31 +10:00
Allan McRae fd9ff672b0 Add regex search option to sync database file searching
e.g. pacman -Fsx kcm.*print.*\.so

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:31 +10:00
Allan McRae acf95f6b3b Implement searching for a file in the sync databases
Locates all packages that contain the listed file
e.g. pacman -Fs libpng.so

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:31 +10:00
Allan McRae 137a4086de Implement listing files from sync packages
Does the equivalent of the -Ql option for local packages

e.g. pacman -Fl glibc

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae 488ca24265 Implement locating file owner in sync files database
Equivalent to -Qo but for packages in the sync database
e.g.  pacman -Fo /usr/bin/pacman

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae 5782b8356c Prototype pacman files database operations
Add the -F/--files operations, -s/--sync support and nd provide dummy
functions for -s/--search, -l/-list and -o/--owns.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae e49abc9860 pacman: move database syncing to util.c
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae b0dac754d2 Add pacman support for .files databases
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-15 10:57:30 +10:00
Allan McRae 1ada16f017 Fix formatting in parsearg_upgrade
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-14 20:46:03 +10:00
Allan McRae 2d7a41539b Simplify sync_cleandb
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-07-14 20:45:55 +10:00
Andrew Gregory 2e5e496eb0 Fix overflow warnings
Fix new warnings generated by gcc-5 about potential overflows.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-07-12 16:23:18 +10:00
Lukas Fleischer a187fa4562 Match providers when showing optdep install status
Use alpm_find_satisfier() instead of alpm_db_get_pkg() when retrieving
the install status of a package to make sure we spot providers as well.

Fixes FS#36412

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-06-20 17:32:57 +10:00
Johannes Löthberg 53d9633449 util.c: table_display: Fix incorrect docstring
Commit 7b8f8753 removed the title parameter but forgot to remove it
from the docstring.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-06-20 17:32:57 +10:00
Charles Duffy 1040ad4e71 Fix compilation if libarchive headers are not in standard location
With commit 097d5a478b, including alpm.h also drags in archive.h.
Ensure the tools we build that depend on ALPM also include the necessary
flags to find libarchive headers if they are not installed in a standard
location.

[Dan: Add commit message]
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12 14:00:54 +10:00
Andrew Gregory d4e5de4bf6 pacsort: fix warning about signed overflow potential during comparison.
Some crazy person assumed we would have fewer than INT_MAX columns.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12 14:00:54 +10:00
Allan McRae 4dbac804a3 Pluralize callback string
In English, this string only has it plural form. However, we need to use the
pluralized translation as some languages can have multiple plural formats.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-05-12 14:00:54 +10:00
Charles Pigott f34e48a988 Actually return the error value of check_db_local
Signed-off-by: Charles Pigott <charlespigott@googlemail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-15 15:32:58 +10:00
Will Miles 965539adbf common: Avoid errors on systems that define strnlen but not strndup
Add a configure test for a system library supplied strnlen, and disable
the embedded version in common if one is found.

Signed-off-by: Will Miles <wmiles@sgl.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03 16:54:17 +10:00
Will Miles bb94729c09 util: Use util-common for strndup in pacsort and pactree
This small refactor reduces the number of replications of the local
imeplementation of strndup.

Signed-off-by: Will Miles <wmiles@sgl.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03 16:54:17 +10:00
Allan McRae 578ceb29fa sync_cleandb: ensure stat call succeeds
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03 16:54:17 +10:00
Allan McRae 9f1c5f0251 pacsort: test string is not NULL before strlen
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03 16:54:17 +10:00
Allan McRae 2108d95526 Fix memory leaks in dump_pkg_full
Leaks when using -Sii with package signatures

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-03-03 16:54:17 +10:00
Allan McRae 7879a5b3e5 Merge branch 'maint' 2015-02-20 10:36:18 +10:00
Allan McRae e0f889e2ea Update translations from Transifex 2015-02-20 10:21:15 +10:00
Allan McRae 5baec6d5e9 Update translations from Transifex
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-14 11:18:49 +10:00
Allan McRae 2e48101999 Update copyright notices for 2015
Signed-off-by: Allan McRae <allan@archlinux.org>
2015-02-01 21:19:04 +10:00
Andrew Gregory 926280cfc7 remove support for .pacorig files
Leave user files in place and save new config files with a .pacnew
extension.  This reduces the complexity of file extraction and respects
the principle that pacman shouldn't modify files it didn't create.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory 3b20561748 ini.c: move error output into conf.c
Move the remaining output into conf.c by notifying the callback of read
errors.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory ea96b56722 ini.c: remove useless key check
key points to a statically allocated string so it can't be NULL and
empty keys are rejected by the callback.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:47 +10:00
Andrew Gregory e7d8e2b5ac ini.c: remove empty section name restriction
alpm will reject empty database names already.  Reduces error handling
in the ini parser.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:46 +10:00
Andrew Gregory 4ccafc484d ini.c: remove unnecessary helper function
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:46 +10:00
Andrew Gregory 09cfe2a4c0 ini.c: move Include parsing to conf.c
Reduces the number of errors the ini parser must handle to make it more
suitable for sharing with the backend.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:46 +10:00
Andrew Gregory 9eb07a81fa ini.c: remove final callback call
Storing repo information removes the need for the final callback.  This
allows the call signature to be re-purposed for indicating read errors.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:46 +10:00
Andrew Gregory 7ed0d60a0d conf.c: parse config in a single pass
Fixes FS#28255

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:46 +10:00
Andrew Gregory 95121cc4f1 conf.c: use masks for siglevel inheritance
This will allow pacman to parse its config file in a single pass and
removes the need for the *_SET siglevels in alpm that were only required
for pacman's siglevel inheritance.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:46 +10:00
Andrew Gregory 2aa85c3bfd conf.c: store repo settings in dedicated struct
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2015-01-21 14:27:46 +10:00
Allan McRae 62d5a71fba Remove testdb
Replaced by pacman -Dk / -Dkk

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-02 21:44:59 +10:00
Allan McRae e8a3e3d81a Integrate testdb into pacman
The functionality of testdb is now available in pacman. pacman -Dk will
check the local database for consistency, and pacman -Dkk will check the
sync databases.

Note that unlike testdb, you can not specify individual sync databases to
check as sync databases act as a whole and not individually. A single database
can be checked using an alternative pacman.conf file.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-02 21:44:58 +10:00
Allan McRae 194dea2de1 Split install reason changing into its own function
Prepare for other functions to be added to the --database option.

Signed-off-by: Allan McRae <allan@archlinux.org>
2015-01-02 21:44:58 +10:00