[pacman-dev] [PATCH 07/23] doc: document callbacks

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 439 - 1 file changed, 271 insertions(+), 168 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index ea99a8b3..a8d48432 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -617,105 +617,12 @@ void

[pacman-dev] [PATCH 08/23] doc: document databases

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 468 - 1 file changed, 249 insertions(+), 219 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index a8d48432..c71c275f 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -94,6 +94,38 @@ typedef struct

[pacman-dev] [PATCH 12/23] doc: document transactions

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 35 +++ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 30bfb06d..76ae5722 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -2068,18 +2068,26 @@ int

[pacman-dev] [PATCH 15/23] doc: document options

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 592 ++--- 1 file changed, 564 insertions(+), 28 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 494a8319..05dec6c7 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1453,186 +1453,722 @@ int

[pacman-dev] [PATCH 06/23] doc: document depends

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 295 + 1 file changed, 164 insertions(+), 131 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 43a47d54..ea99a8b3 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -441,49 +441,26 @@ int

[pacman-dev] [PATCH 09/23] doc: document logging

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index c71c275f..ea690abc 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1412,13 +1412,27 @@ typedef enum

[pacman-dev] [PATCH 14/23] doc: document alpm_list

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm_list.c | 251 - lib/libalpm/alpm_list.h | 299 +++- 2 files changed, 295 insertions(+), 255 deletions(-) diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c index fe0c2906..2ecc8e0b 100644 ---

[pacman-dev] [PATCH 19/23] doc: update doxyfile

2020-12-07 Thread morganamilo
--- doc/Doxyfile.in | 81 +++-- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index e2101a28..776318da 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -1,4 +1,4 @@ -# Doxyfile 1.8.2 +# Doxyfile

[pacman-dev] [PATCH 05/23] doc: document signatures

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 282 +++-- 1 file changed, 167 insertions(+), 115 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 178c8f6a..43a47d54 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -265,7 +265,7 @@ alpm_handle_t

[pacman-dev] [PATCH 18/23] doc: configure doxygen

2020-12-07 Thread morganamilo
- only document public alpm items (alpm_*) - hide typedef'd structs (_alpm_pkg_t shows as alpm_pkg_t) - enable inline struct definitions (this stops having a man page for every single struct) --- doc/Doxyfile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[pacman-dev] [PATCH 17/23] doc: move top level items into groups

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 4673f639..e9cc7c85 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -62,6 +62,7 @@ extern "C" { /** The libalpm context handle. *

[pacman-dev] [PATCH 21/23] doc: add extra documentation to the man page

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 10 -- lib/libalpm/alpm_list.h | 10 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index a0de9b13..b2772f19 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -50,8 +50,14 @@ extern

[pacman-dev] [PATCH 11/23] doc: document files and groups

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 102 + 1 file changed, 56 insertions(+), 46 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 5ee99711..30bfb06d 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -94,44 +94,82 @@ typedef struct

[pacman-dev] [PATCH 20/23] doc: rename alpm_api group to alpm

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index e9cc7c85..a0de9b13 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -50,7 +50,7 @@ extern "C" { #include -/** @addtogroup alpm_api ALPM +/**

[pacman-dev] [PATCH 10/23] doc: document packages

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 164 ++--- 1 file changed, 96 insertions(+), 68 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index ea690abc..5ee99711 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1368,43 +1368,11 @@ int

[pacman-dev] [PATCH 16/23] doc: move alpm_api group to top of file

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 05dec6c7..4673f639 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -50,6 +50,11 @@ extern "C" { #include +/** @addtogroup alpm_api

[pacman-dev] [PATCH 22/23] doc: change group names to libalpm_*

2020-12-07 Thread morganamilo
Also change the group's title to point to the group's man page. This makes generated man pages be named libalpm_* which is more consistent with what library man pages are usually called. --- doc/meson.build | 1 - lib/libalpm/alpm.h | 80 +

[pacman-dev] [PATCH 13/23] doc: document misc

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 76ae5722..494a8319 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -2068,11 +2068,6 @@ int

[pacman-dev] [PATCH 23/23] doc: remove old libalpm man file

2020-12-07 Thread morganamilo
--- doc/libalpm.3.asciidoc | 37 - 1 file changed, 37 deletions(-) delete mode 100644 doc/libalpm.3.asciidoc diff --git a/doc/libalpm.3.asciidoc b/doc/libalpm.3.asciidoc deleted file mode 100644 index 79ea5409.. --- a/doc/libalpm.3.asciidoc +++

[pacman-dev] [PATCH 04/23] doc: document handle

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 58 -- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 1c2422ca..178c8f6a 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -243,6 +243,36 @@ const char

[pacman-dev] [PATCH 03/23] doc: document error

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 122 - 1 file changed, 109 insertions(+), 13 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 48ba7fdc..1c2422ca 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -51,102 +51,198 @@ extern "C" {

[pacman-dev] [PATCH 02/23] doc: add doc header to alpm.h

2020-12-07 Thread morganamilo
--- lib/libalpm/alpm.h | 13 + 1 file changed, 13 insertions(+) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 50c4bb6b..48ba7fdc 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -20,6 +20,19 @@ * You should have received a copy of the GNU General Public

[pacman-dev] [PATCH 00/23] Docs Docs Docs 2: electric boogaloo

2020-12-07 Thread morganamilo
and packages groups repectivley. To be clear I have not actually changed any function names in this patch set. morganamilo (23): doc: remove stray doxygen comment doc: add doc header to alpm.h doc: document error doc: document handle doc: document signatures doc: document depends doc: document

[pacman-dev] [PATCH 01/23] doc: remove stray doxygen comment

2020-12-07 Thread morganamilo
--- lib/libalpm/trans.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index c7317c15..303d2fca 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -266,8 +266,6 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle) return 0;

[pacman-dev] [PATCH] Add --confirm

2020-12-07 Thread morganamilo
this is useful for cancelling the automatically passed --noconfirm by makechrootpkg diff --git a/doc/makepkg.8.asciidoc b/doc/makepkg.8.asciidoc index 3b5e61b3..b3ecbe12 100644 --- a/doc/makepkg.8.asciidoc +++ b/doc/makepkg.8.asciidoc @@ -184,6 +184,9 @@ Options (Passed to pacman) Prevent

[pacman-dev] [PATCH] libalpm: set ret in download files

2020-11-30 Thread morganamilo
download_files never set ret on failiure, so even when downloading fails, the transaction goes on to commit and error out. :: Retrieving packages... python-packaging-20.4-4-any.pkg.tar.zst failed to download error: failed retrieving file 'python-packaging-20.4-4-any.pkg.tar.zst' from

[pacman-dev] [PATCH 3/5] libalpm: clarify alpm_download_event_completed_t status

2020-11-24 Thread morganamilo
The comment makes it seem that the result itself is an error code. But all it does is simply return -1 to indicate an error occured; diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 614a530c..6a7323e0 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -728,9 +728,9 @@ typedef

[pacman-dev] [PATCH 5/5] libalpm: add alpm_option_get_parallel_downloads

2020-11-24 Thread morganamilo
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 6a7323e0..50c4bb6b 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -934,6 +934,8 @@ int alpm_option_set_remote_file_siglevel(alpm_handle_t *handle, int level); int alpm_option_set_disable_dl_timeout(alpm_handle_t *handle,

[pacman-dev] [PATCH 2/5] libalpm: don't call dlcb when not set

2020-11-24 Thread morganamilo
Fixes FS#68728: diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 673e769f..d43e6d45 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -586,7 +586,7 @@ cleanup: unlink(payload->tempfile_name); } - if(!payload->signature) { +

[pacman-dev] [PATCH 4/5] libalpm: set errno when setting parallel downloads with an invalid number

2020-11-24 Thread morganamilo
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 1310601a..16d4beaa 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -857,9 +857,7 @@ int SYMEXPORT alpm_option_set_parallel_downloads(alpm_handle_t *handle, { CHECK_HANDLE(handle, return -1); #ifdef

[pacman-dev] [PATCH 1/5] libalpm: set parallel_downloads to 1 when creating the handle

2020-11-24 Thread morganamilo
Fixes FS#68729 diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 34c5b4b2..5d36136d 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -61,6 +61,8 @@ alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath, /* set default database extension */

[pacman-dev] [PATCH v2] libmakepkg: lint all arrays for empty values

2020-10-27 Thread morganamilo
Empty values break pacman's db format, as an empty line indicates an end of section. --- I've seen this out in the wild: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vim-coc-highlight-git=3063e1a6d3e72a35528 diff --git a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in

[pacman-dev] [PATCH] libmakepkg: lint all arrays for empty values

2020-10-27 Thread morganamilo
--- I've seen this out in the wild: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vim-coc-highlight-git=3063e1a6d3e72a35528 diff --git a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in index 1bc49722..22f5fbbb 100644 ---

[pacman-dev] [PATCH 2/2] Docs docs docs and more docs

2020-01-25 Thread morganamilo
Write docs for every public alpm member and expand on the existing documentation for other members. --- The entire .h file has basically been restructed. The best way to see the end result is either to read the generated man pages or enabled html and view the generated html. Also note alpm_list

[pacman-dev] [PATCH] libalpm: fix alpm_option_set_assumeinstalled

2020-01-22 Thread morganamilo
It looks like this function has never actually worked. The current list is never set to NULL after being freed. So the new deps were just appended to the already freed list, leading to a segfault. diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index e3193f40..23464045 100644 ---

[pacman-dev] [PATCH] libalpm: free trans before databases

2020-01-19 Thread morganamilo
When releasing the handle, alpm tries to do some self clean up by freeing the databases and transaction. However, databases refuse to unregister is there is an in progress transaction. Causing them to leak if the handle is released while a transaction is active. diff --git a/lib/libalpm/alpm.c

[pacman-dev] [PATCH v2] pacman+libalpm: print version names for conflicting packages

2019-11-27 Thread morganamilo
When ever pacman prints a conflict, it now prints pkgname-version, instead of just pkgname. alpm_conflict_t now carries pointers to alpm_pkg_t instead of just the names of each package. Fixes FS#12536 (point 2) --- v2: dupe each alpm_pkg_t diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h

[pacman-dev] [PATCH v2] pacman: print error when -Fx is given invalid regex

2019-11-27 Thread morganamilo
When processing the targets for -Fx, compile all the regex ahead of time, printing an error for each that failed to compile. Then, if they all compiled successfully, continue with printing files. Signed-off-by: morganamilo --- v2: Add comment about why we

[pacman-dev] [PATCH v2] alpm: fix documentation for alpm_mtree_next

2019-11-19 Thread morganamilo
End of archive is 1, not 0, also it is possible for errors to occur. Signed-off-by: morganamilo --- V2: fix stray changes. Working dir was not clean diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index d3630385..9c474443 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h

[pacman-dev] [PATCH] alpm: fix documentation for alpm_mtree_next

2019-11-19 Thread morganamilo
End of archive is 1, not 0, also it is possible for errors to occur. Signed-off-by: morganamilo diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index d3630385..9c474443 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1328,7 +1328,7 @@ struct archive *alpm_pkg_mtree_open

[pacman-dev] [PATCH] pacman+libalpm: print version names for conflicting packages

2019-11-13 Thread morganamilo
the transaction finishes, so is there ever a reason for the front end to keep the conflict around after? Signed-off-by: morganamilo diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index d3630385..d9d3e4e0 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -247,10 +247,8 @@ typedef

[pacman-dev] [PATCH] pacman: print error when -Fx is given invalid regex

2019-11-11 Thread morganamilo
When processing the targets for -Fx, compile all the regex ahead of time, printing an error for each that failed to compile. Then, if they all compiled successfully, continue with printing files. Signed-off-by: morganamilo diff --git a/src/pacman/files.c b/src/pacman/files.c index 3b6dc23b

[pacman-dev] [PATCH] pacman: print error message for -F with invalid regex

2019-11-05 Thread morganamilo
diff --git a/src/pacman/files.c b/src/pacman/files.c index 19191dd8..05b6f223 100644 --- a/src/pacman/files.c +++ b/src/pacman/files.c @@ -115,7 +115,8 @@ static int files_search(alpm_list_t *syncs, alpm_list_t *targets, int regex) { if(regex) {

[pacman-dev] [PATCH] pacman+libalpm: handle search errors

2019-11-05 Thread morganamilo
Previously, pacman treated no matches and an error during search the same. To fix this, alpm_db_search now returns its status as an int and instead takes the to be returned list as a param. Allowing front ends to easily differentiate between errors and no matches. Signed-off-by: morganamilo

[pacman-dev] [PATCH] pacman: make exact_file an int

2019-11-05 Thread morganamilo
We only ever use it as a bool, no need to pass a char* around. Signed-off-by: morganamilo diff --git a/src/pacman/files.c b/src/pacman/files.c index 19191dd8..3b6dc23b 100644 --- a/src/pacman/files.c +++ b/src/pacman/files.c @@ -58,7 +58,7 @@ static void print_owned_by(alpm_db_t *db, alpm_pkg_t

[pacman-dev] [PATCH] pacman: clarify error when alpm fails to init

2019-11-05 Thread morganamilo
-by: morganamilo diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 468a3e02..42946189 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -766,8 +766,8 @@ static int setup_libalpm(void) /* initialize library */ handle = alpm_initialize(config->rootdir, config->

[pacman-dev] [PATCH] makepkg: don't warn when PACKAGER is unset

2019-10-22 Thread morganamilo
makepkg now complains when PACKAGER is not in the format "name ". Hide this warning when PACKAGER is unset but still warn if it is set to something out of format. diff --git a/scripts/libmakepkg/lint_config/variable.sh.in b/scripts/libmakepkg/lint_config/variable.sh.in index aa9f6c07..61ef4c09

[pacman-dev] [PATCH v2 1/2] libalpm: fix segfault when -Qip'ing a package

2019-10-15 Thread morganamilo
The dummy checksigs function never sets count to 0, leaving it unitialized. This caused the siglist cleanup to try and free the empty list. --- v2: remove UNUSED diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 30d057a3..fc537dd3 100644 --- a/lib/libalpm/signing.c +++

[pacman-dev] [PATCH v2 2/2] libalpm: set errno in signing dummy functions

2019-10-15 Thread morganamilo
This allows pacman to print the correct error message when checking keys and libalpm has been compiled without gpgme support. --- v2: remove UNUSED diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index fc537dd3..7fed862e 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@

[pacman-dev] [PATCH 2/2] libalpm: set errno in signing dummy functions

2019-10-15 Thread morganamilo
This allows pacman to print the correct error message when checking keys and libalpm has been compiled without gpgme support. diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 4cb31e7c..8522e049 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -790,12 +790,14 @@

[pacman-dev] [PATCH 1/2] libalpm: fix segfault when -Qip'ing a package

2019-10-15 Thread morganamilo
The dummy checksigs function never sets count to 0, leaving it unitialized. This caused the siglist cleanup to try and free the empty list. diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 30d057a3..4cb31e7c 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -802,6

[pacman-dev] [PATCH] pacman: return 1 when -F has no results

2019-10-12 Thread morganamilo
--- This is basically my V2 for "pacman: better handle -F when file is not found". With the freeze coming up and me not having that much time to do pacman stuff, this is the best I've got right now. I have been thinking about the original patch and I don't really like it much any more. One

[pacman-dev] [PATCH 4/4] pacman: speed up deptest

2019-09-08 Thread morganamilo
Try and find an exact match via pkgcache before iterating the entire localdb. Gives a noticeable speed up for exact matches e.g. `pacman -T zlib` --- Do note this fails for versioned exact matches. "zlib>1" will not take the faster route because alpm_db_get_pkgfromcache() does not work for

[pacman-dev] [PATCH 1/4] libalpm: fix incorrect documentation

2019-09-08 Thread morganamilo
--- lib/libalpm/deps.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 71185c68..ce7869c3 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -643,10 +643,9 @@ int _alpm_recursedeps(alpm_db_t *db, alpm_list_t

[pacman-dev] [PATCH 3/4] libalpm: short circuit alpm_find_dbs_satisfier

2019-09-08 Thread morganamilo
when a satisfying package is already installed, we always pick it instead of prompting the user. So we can return that package as soon as we find it, instead of waiting until we've iterated through all the databases. --- lib/libalpm/deps.c | 15 +++ 1 file changed, 7 insertions(+), 8

[pacman-dev] [PATCH 2/4] libalpm: resolvedep(): don't compare names twice

2019-09-08 Thread morganamilo
If we failed to get the pkg from pkgcache then we know no satisfying package exists by name. So only compare provides. --- lib/libalpm/deps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index ce7869c3..322c4e7e 100644 ---

[pacman-dev] [PATCH] libalpm: fix documentation for alpm_pkg_mtree_next

2019-06-13 Thread morganamilo
libarchive uses 1 for EOF, not 0. Instead of using the actual ints, use libarchive's error codes. --- By the way, not familiar with doxygen. Is my wording fine or is there some built in "see also" functionality? diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index ffb2ad96..ece894cf 100644

[pacman-dev] [PATCH] pacman: correctly free lists

2019-06-13 Thread morganamilo
diff --git a/src/pacman/database.c b/src/pacman/database.c index f3b890ce..7a792bad 100644 --- a/src/pacman/database.c +++ b/src/pacman/database.c @@ -105,7 +105,8 @@ static int check_db_missing_deps(alpm_list_t *pkglist) free(depstring); ret++; } -

[pacman-dev] [PATCH] Correctly report a download failiure for 404s

2019-06-11 Thread morganamilo
Currently when caling alpm_trans_commit, if fetching a package restults in a 404 (or other non 400 response code), the function returns -1 but errno is never set. Thish patch sets errno to ALPM_ERR_RETRIEVE. diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 05813c40..e5696bb0 100644

[pacman-dev] [PATCH] pacman: fix error during -Fy

2019-06-06 Thread morganamilo
Signed-off-by: morganamilo diff --git a/src/pacman/files.c b/src/pacman/files.c index 74d06815..8e518486 100644 --- a/src/pacman/files.c +++ b/src/pacman/files.c @@ -300,7 +300,7 @@ int pacman_files(alpm_list_t *targets) return files_list(files_dbs, targets

[pacman-dev] [PATCH v4 2/2] pacman: rework the UI of -F

2019-05-29 Thread morganamilo
Reworks the UI of -F according to FS#47949 In short -F replaces both -Fs and -Fo. Searching for an exact path (target contains "/"), causes the output to switch to the old -Fo output. Otherwise the old -Fs output is used. Also strip the leading "/" from targets like how -Qo does. --- Docs

[pacman-dev] [PATCH v3 1/2] pacman: refactor file match printing to their own functions

2019-05-28 Thread morganamilo
--- src/pacman/files.c | 71 ++ 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/src/pacman/files.c b/src/pacman/files.c index fa4170bd..26f96a67 100644 --- a/src/pacman/files.c +++ b/src/pacman/files.c @@ -49,6 +49,15 @@ static void

[pacman-dev] [PATCH v3 2/2] wip: pacman: rework the UI of -F

2019-05-28 Thread morganamilo
Reworks the UI of -F according to FS#47949 In short -F replaces both -Fs and -Fo. Searching for an exact path (target contains "/"), causes the output to switch to the old -Fo output. Otherwise the old -Fs output is used. Also strip the leading "/" from targets like how -Qo does. TODO: docs

[pacman-dev] [PATCH v2] wip: pacman: rework the UI of -F

2019-04-20 Thread morganamilo
Reworks the UI of -F according to FS#47949 In short -F replaces both -Fs and -Fo. --regex/-x has been replaced with --search/-s. --oneline/-o can be used to change the output format to match the old -Fo Signed-off-by: morganamilo --- v1: This patch is WIP. Functional changes made

[pacman-dev] [PATCH] pacman: fix segfault when Usage is specified without a value

2019-03-06 Thread morganamilo
And extract all the common code to a macro. Signed-off-by: morganamilo --- src/pacman/conf.c | 38 -- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 29f69052..cca3657e 100644 --- a/src/pacman/conf.c

[pacman-dev] [PATCH] fix various typos

2019-02-02 Thread morganamilo
Signed-off-by: morganamilo --- NEWS | 12 ++-- configure.ac | 2 +- doc/PKGBUILD.5.asciidoc | 4 ++-- lib/libalpm/package.h | 2 +- lib/libalpm/signing.c | 2

[pacman-dev] [PATCH 1/2] pacman: refactor file match printing to its own function

2019-02-02 Thread morganamilo
Signed-off-by: morganamilo --- src/pacman/files.c | 56 +- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/src/pacman/files.c b/src/pacman/files.c index fa4170bd..3ebd9b9b 100644 --- a/src/pacman/files.c +++ b/src/pacman/files.c

[pacman-dev] [PATCH 2/2] wip: pacman: rework the UI of -F

2019-02-02 Thread morganamilo
Reworks the UI of -F according to FS#47949 In short -F replaces both -Fs and -Fo. --regex/-x has been replaced with --search/-s. Signed-off-by: morganamilo --- This patch is WIP. Functional changes made, documentation still needs to be changed. Additionally I think https://bugs.archlinux.org

[pacman-dev] [PATCH v6 1/2] libmakepkg: lint disallowed variables in package()

2019-01-30 Thread morganamilo
makepkg will now error if disallowed variables are set inside of the package function. Disallowed variables are variables that do exist, like 'makedepends' and 'pkgver' but can not be set inside of a package function. Signed-off-by: morganamilo --- v5: Move this lint to its own file

[pacman-dev] [PATCH v6 2/2] libmakepkg: lint disallowed architecture specific variables

2019-01-30 Thread morganamilo
Variables such as 'pkgdesc_x86_64' are invalid, instead of ignoring them raise an error. This also disallows using 'any' as an architecture specific variable Signed-off-by: morganamilo --- v5: "libmakepkg: disallow using any as an architecture specific variable" wa

[pacman-dev] [PATCH] libmakepkg: centralise random arrays of pkgbuild variables

2019-01-30 Thread morganamilo
Refactor many of the different arrays of pkgbuild variables into scripts/libmakepkg/util/schema.sh.in. Signed-off-by: morganamilo --- All the arch overrides happen to be arrays. The current code also uses arrays in the variable name to document this. so use pkgbuild_schema_arch_arrays over

[pacman-dev] [PATCH v5 3/4] libmakepkg: lint disallowed variables in package()

2019-01-21 Thread morganamilo
makepkg will now error if disallowed variables are set inside of the package function. Disallowed variables are variables that do exist, like 'makedepends' and 'pkgver' but can not be set inside of a package function. Signed-off-by: morganamilo --- v5: Move this lint to its own file

[pacman-dev] [PATCH v5 2/4] libmakepkg: add exists_function_variable helper

2019-01-21 Thread morganamilo
This helpers functions allows checking for the existence of a package variable without worrying if it is an array or not. Signed-off-by: morganamilo --- scripts/libmakepkg/util/pkgbuild.sh.in | 9 + 1 file changed, 9 insertions(+) diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in b

[pacman-dev] [PATCH v5 1/4] libmakepkg: move checkdepends to the correct array

2019-01-21 Thread morganamilo
Signed-off-by: morganamilo --- scripts/libmakepkg/lint_pkgbuild/variable.sh.in | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in index d19c95bc..a975b024 100644

[pacman-dev] [PATCH] libalpm: fix minor typo in _alpm_db_usage_

2019-01-18 Thread morganamilo
Signed-off-by: morganamilo diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index bbce0971..337b30d2 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -1046,7 +1046,7 @@ alpm_list_t *alpm_db_get_groupcache(alpm_db_t *db); */ alpm_list_t *alpm_db_search(alpm_db_t *db, const

[pacman-dev] [PATCH v4 4/4] libmakepkg: disallow using 'any' with other arches

2019-01-15 Thread morganamilo
Error if the arch array contains any and any other values. This also fixes a bug where the check for `$arch == 'any'` which only evaluated the first value in the array, meaning the rest of the values would not be linted. Signed-off-by: morganamilo --- scripts/libmakepkg/lint_pkgbuild/arch.sh.in

[pacman-dev] [PATCH v4 3/4] libmakepkg: disallow using any as an architecture specific variable

2019-01-15 Thread morganamilo
Signed-off-by: morganamilo --- scripts/libmakepkg/lint_pkgbuild/variable.sh.in | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in index b65c01f2..7420cdbc 100644

[pacman-dev] [PATCH v4 1/4] libmakepkg: lint disallowed variables in package()

2019-01-15 Thread morganamilo
makepkg will now error if disallowed variables are set inside of the package function. Disallowed variables are variables that do exist, like 'makedepends' and 'pkgver' but can not be set inside of a package function. Signed-off-by: morganamilo --- .../libmakepkg/lint_pkgbuild/variable.sh.in

[pacman-dev] [PATCH v3] pacman: don't error when a group exists but all packages are ignored

2018-10-20 Thread morganamilo
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 ---

[pacman-dev] [PATCH v2] pacman: don't error when a group exists but all packages are ignored

2018-10-19 Thread morganamilo
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 ---

[pacman-dev] [PATCH] pacman: don't error when a group exists but all packages are ignored

2018-10-18 Thread morganamilo
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 and only throw an error if it does not. Signed-off-by: m

[pacman-dev] [PATCH v2] libalpm: process needed before group selection

2018-10-17 Thread morganamilo
When --needed is used, up to date packages are now filtered out before showing the group select. Fixes FS#22870. Signed-off-by: morganamilo --- v2: Changed per Andrew's feedback. diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index b6ae7b72..05f58fad 100644 --- a/lib/libalpm/sync.c +++ b

[pacman-dev] [PATCH] libmakepkg: fix linting arrays of empty strings

2018-10-16 Thread morganamilo
the unmet dependency on ''. Instead check the length of the array. Signed-off-by: morganamilo diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in b/scripts/libmakepkg/util/pkgbuild.sh.in index c6f8a82d..b29229a3 100644 --- a/scripts/libmakepkg/util/pkgbuild.sh.in +++ b/scripts/libmakepkg/util/pkgb

[pacman-dev] [PATCH v2] libalpm: parse {check, make}depends when reading database

2018-10-08 Thread morganamilo
-by: morganamilo --- Only after making this patch do I see FS#60347. V2 addes the extra lazy loading code pointed out in the comments. As a result this patch is basically identical to Alexandre Garnier's patch. But as they have not submitted their patch to the mailing list I'll submit mine. diff --git a/lib

[pacman-dev] [PATCH] libalpm: parse {check, make}depends when reading database

2018-10-08 Thread morganamilo
-by: morganamilo diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 7c2f96b8..f8c3947e 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -773,6 +773,10 @@ static int local_db_read(alpm_pkg_t *info, int inforeq) READ_AND_SPLITDEP(info->depe

[pacman-dev] [PATCH v2] pacman: fix possible buffer overflow

2018-09-22 Thread morganamilo
: query.c: In function ‘query_fileowner’: query.c:192:4: warning: ‘strncpy’ specified bound 4096 equals destination size [-Wstringop-truncation] strncpy(rpath, filename, PATH_MAX); Signed-off-by: morganamilo diff --git a/src/pacman/query.c b/src/pacman/query.c index 00c39638..c661fafb 100644

[pacman-dev] [PATCH 2/2] pacman: give path too long error after strcat

2018-09-22 Thread morganamilo
The string only becomes longer than PATH_MAX once adding "/" to the end. The error message should give this version of the path. Signed-off-by: morganamilo diff --git a/src/pacman/query.c b/src/pacman/query.c index a1197cea..ecf8d148 100644 --- a/src/pacman/query.c +++ b/src/pacm

[pacman-dev] [PATCH 1/2] pacman: fix possible buffer overflow

2018-09-22 Thread morganamilo
] strncpy(rpath, filename, PATH_MAX); The warning could have also been Fixed by using PATH_MAX -1 and explicitly terminating the string. However this would not fix the buffer overflow. Signed-off-by: morganamilo diff --git a/src/pacman/query.c b/src/pacman/query.c index 00c39638..a1197cea 100644

[pacman-dev] [PATCH] libalpm: process needed before group selection

2018-09-22 Thread morganamilo
When --needed is used, up to date packages are now filtered out before showing the group select. Signed-off-by: morganamilo --- This patch set is currently incomplete. There is a problem where if every package in the group is already installed you end up with the eror. "error: target not

[pacman-dev] [PATCH] pacman-conf: add missing DisableDownloadTimeout

2018-09-10 Thread morganamilo
Signed-off-by: morganamilo --- src/pacman/pacman-conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pacman/pacman-conf.c b/src/pacman/pacman-conf.c index baa72d97..56196f79 100644 --- a/src/pacman/pacman-conf.c +++ b/src/pacman/pacman-conf.c @@ -266,6 +266,7 @@ static void

[pacman-dev] [PATCH v4 2/2] Show group status during file search

2018-09-04 Thread morganamilo
When doing "pacman -Fs", show the "(groupname)" message just like "pacman -Ss". And refactor group printing to its own function. Signed-off-by: morganamilo --- Fix style src/pacman/files.c | 1 + src/pacman/package.c | 34 +++---

[pacman-dev] [PATCH v3 2/2] Show group status during file search

2018-09-03 Thread morganamilo
When doing "pacman -Fs", show the "(groupname)" message just like "pacman -Ss". And refactor group printing to its own function. Signed-off-by: morganamilo --- src/pacman/files.c | 1 + src/pacman/package.c | 34 +++--- src/pa

[pacman-dev] [PATCH v3 1/2] Show install status during file search

2018-09-03 Thread morganamilo
When doing "pacman -Fs", show the "[installed: version]" message just like "pacman -Ss". Signed-off-by: morganamilo --- src/pacman/files.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pacman/files.c b/src/pacman/files.c index d7fc5

[pacman-dev] [PATCH v3 0/2] Make -Fs behave like -Ss and output group-membership and installation-state

2018-09-03 Thread morganamilo
to an existing one. Should I have resent the first? Should this be v3 or v1? If anyone can clear that up I'd appreciate it. [1] https://lists.archlinux.org/pipermail/pacman-dev/2018-August/022769.html morganamilo (2): Show install status during file search Show group status during file search src

[pacman-dev] [PATCH] during -Qu add [ignored] for repos without Usage = Upgrade

2018-08-31 Thread morganamilo
Fixes FS#59854 Signed-off-by: morganamilo --- src/pacman/query.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pacman/query.c b/src/pacman/query.c index 00c39638..faa06e60 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -325,10 +325,14 @@ static int

[pacman-dev] [PATCH v2] Show install status during file search

2018-08-16 Thread morganamilo
When doing "pacman -Fs", show the "[installed: version]" message just like "pacman -Ss". Signed-off-by: morganamilo --- Fixed extra \n's diff --git a/src/pacman/files.c b/src/pacman/files.c index d7fc5446..58cf8d3d 100644 --- a/src/pacman/files.c +++ b/src/p

[pacman-dev] [PATCH] libalpm/sync.c: restrict alpm_sync_newversion by USAGE_UPGRADE

2018-07-24 Thread morganamilo
-by: morganamilo diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 696a5131..23b0ccfa 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -61,7 +61,7 @@ alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_syn for(i = dbs_sync; !spkg && i; i =

[pacman-dev] [PATCH 7/7] libmakepkg: disallow using 'any' with other arches

2018-06-12 Thread morganamilo
Error if the arch array contains any and any other values. This also fixes a bug where the check for `$arch == 'any'` which only evaluated the first value in the array, meaning the rest of the values would not be linted. Signed-off-by: morganamilo --- scripts/libmakepkg/lint_pkgbuild/arch.sh.in

[pacman-dev] [PATCH 7/7] libmakepkg: disallow using 'any' with other arches

2018-06-11 Thread morganamilo
Error if the arch array contains any and any other values. This also fixes a bug where the check for `$arch == 'any'` which only evaluated the first value in the array, meaning the rest of the values would not be linted. Signed-off-by: morganamilo --- scripts/libmakepkg/lint_pkgbuild/arch.sh.in

[pacman-dev] [PATCH] Show install status during file search

2018-06-11 Thread morganamilo
When doing "pacman -Fs", show the "[installed: version]" message just like "pacman -Ss". Signed-off-by: morganamilo --- src/pacman/files.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pacman/files.c b/src/pacman/files.c index d7fc5

  1   2   >