Commit Graph

403 Commits (49ab0b2ab72563e4ae8f70e7ebd6c55869bc96e5)

Author SHA1 Message Date
Ariadne Conill d9e507cc6e pkg: do not do serial checks for flattened solutions, as they are already flattened 2023-01-21 21:31:38 +00:00
Ariadne Conill 99bc93fbe5 use SIZE_FMT_SPECIFIER everywhere 2023-01-21 20:45:29 +00:00
Ariadne Conill e2a12fd4c2 main: reset solver when solving for library groups 2023-01-21 20:39:53 +00:00
Ariadne Conill 648a2249fc fragment: render: only include trailing space if there is another fragment 2023-01-21 20:17:33 +00:00
Timo Röhling 506ebab7d6 Ignore whitespace indentation
Fixes #265
2023-01-21 20:09:52 +00:00
Ariadne Conill be0d811942 argvsplit: fix some quoting rules to match POSIX 2023-01-21 19:51:24 +00:00
Doug Freed 08db74c474 pkg: make pkgconf_compare_version consistent
The code taken from rpmvercmp in pkg-config returns -1 if a is less than
b, 0 if a is equal to b, and 1 if a is greater than b. This matches the
expectations of the comparison operators that use this function.
However, the tilde handling, the NULL handling, and the docstring all do
the opposite.

This fixes the tilde handling, the NULL handling, and the docstring to
match the behavior of the rpmvercmp code and the expectations of the
comparison operators.
2023-01-20 22:21:31 +00:00
Ziemowit Łąski 1c3f246198 pkgconf: Handle spaces correctly when expanding variables
Given the following .pc fragment:

includedir=/mingw64/include
Cflags: -I${includedir} -I${includedir}/taglib

Should includedir be assigned the value 'C:/Program\ Files/Git/mingw64/include', the expansion of ${includedir} will be chopped off after the first space:

Cflags: -IC:/Program\

With this patch, the expansion is corrected:

Cflags: -IC:/Program\ Files/Git/mingw64/include -IC:/Program\ Files/Git/mingw64/include/taglib

Create spaces-in-paths.pc
2023-01-20 22:18:26 +00:00
Ariadne Conill 628b2b2baf tuple: test for, and stop string processing, on truncation
otherwise a buffer overflow occurs.
this has been a bug in pkgconf since the beginning, it seems.
instead of disclosing the bug correctly, a "hotshot" developer
decided to blog about it instead.  sigh.

https://nullprogram.com/blog/2023/01/18/
2023-01-20 22:07:03 +00:00
Ariadne Conill 6a66b312b4 libpkgconf: increase API level to 10903 2022-08-16 19:49:42 +00:00
Ariadne Conill 80bc5ac3b9 tuple: if a global tuple is explicitly defined with --define-variable, prefer it
fixes github #259
2022-08-16 19:39:05 +00:00
Ariadne Conill 5044491f43 queue: add function to free a compiled solution 2022-08-16 19:27:35 +00:00
Ariadne Conill ced9bee613 pkg: remove dead store in pkgconf_compare_version 2022-08-16 18:51:11 +00:00
Ariadne Conill 5500a15133 fragment: avoid trying to merge fragments where data == NULL 2022-08-16 18:46:43 +00:00
Ariadne Conill 74faf8d0e2 queue: do not enqueue unsolved nodes as part of a solution 2022-08-16 18:38:46 +00:00
Ariadne Conill 696124b608 pkg: add support for parsing the URL from pc files 2022-08-12 12:36:21 +00:00
Ariadne Conill aa99ddf789 pkg: add Copyright and Maintainer fields
These are helpful pieces of information for BOM documents
generated by pkgconf.
2022-08-11 15:52:33 +00:00
Ariadne Conill 28b5d57b98 pkg: free SPDX license tags when a package is destroyed 2022-08-08 10:25:24 +00:00
Ariadne Conill 69a3d458ef libpkgconf: revise API revision to 10902 2022-08-08 09:59:50 +00:00
Ariadne Conill 7e9aa7e1fc pkg: do not break cycles across dependency lists 2022-08-08 09:56:28 +00:00
Ariadne Conill 69f630aadc pkg: only advance serial if we are actually traversing from a root 2022-08-08 09:34:45 +00:00
Ariadne Conill 5b10a85a82 queue: add pkgconf_queue_solve API 2022-08-08 09:08:27 +00:00
Ariadne Conill 79d25f979d queue: ensure private deps get flattened when --static is requested 2022-08-08 00:58:55 +00:00
Dylan Baker 7976daab9a bsdstubs: include errno.h
Needed for ENOMEM, and fixes the build on MacOS.
2022-08-06 22:30:25 -07:00
Ariadne Conill d8d669f637 pkgconf 1.9.0. 2022-08-07 04:47:04 +00:00
Ariadne Conill 0e05308f9c pkg: add SPDX license assertion to pkgconf builtin 2022-08-07 04:35:29 +00:00
Ariadne Conill 1389aa05ba pkg: add pkgconf_pkg_t.license field
The pkgconf_pkg_t.license field maps to the new License keyword, and
should be an SPDX license expression.
2022-08-07 04:21:22 +00:00
Ariadne Conill 7edfdbff0b pkg: upgrade circular reference trace to a warning 2022-08-07 01:29:21 +00:00
Ariadne Conill 662668d082 pkg: add trace log when breaking a circular reference 2022-08-07 01:09:07 +00:00
Dylan Baker 1cfa2d1e20 pkg: prevent circular ownership
Otherwise in a case where A references B, and B references A, A and B
will have mutual ownership of each other and prevent each other from
being free'd.
2022-08-04 15:52:10 -07:00
Dylan Baker 301d8fa0c6 queue: free unused dependencies when flattening 2022-08-04 15:52:10 -07:00
Dylan Baker 34b110200a dependency: zero list after freeing 2022-08-04 15:52:10 -07:00
Dylan Baker e71a5a3370 dependency: add debug information for dependency refcounting 2022-08-04 15:52:10 -07:00
Dylan Baker 4934205737 pkg: add name of pkg being refed/unrefed to debug outpu 2022-08-04 15:52:10 -07:00
Dylan Baker a46ce3672f queue: when collecting dependents don't iterate private twice
Currently, the private field is iterated collecting private deps and
normal deps. It should only be iterated when collecting private deps.
2022-08-04 15:52:10 -07:00
Dylan Baker a391f9b650 pkg: use goto cleanup idiom 2022-08-04 15:52:10 -07:00
Dylan Baker 171738024e cache: clear the cache with pkgconf_cache_remove
Which results in more code re-use.
2022-08-04 15:52:10 -07:00
Dylan Baker e4d1c8ffa5 queue: when flattening do nothing if the flattened deps are empty 2022-08-04 15:52:10 -07:00
Dylan Baker 6609001114 queue: unref dependency in all cases 2022-08-04 15:52:10 -07:00
Dylan Baker e275594ba6 queue: ensure cleanup happens when applying 2022-08-04 15:52:10 -07:00
Dylan Baker 4a1119aa2a dependency: Fix reference counting of dependency_addraw
We only want a reference to be added for the value inserted into the
list, not the one returned. The returned one is unowned until it reaches
the public dependency_add function, which returns an owned pointer
instead. This makes things semantically more correct.

Unfortunately, this means in a few cases we have to write some ugly
code like:
```c
pkgconf_dependency_t *dep = pkgcond_dependency_add("args");
pkgconf_dependency_unref(dep->owner, dep);
```
2022-08-04 15:52:10 -07:00
Dylan Baker a4de6235c2 cache: when removing a package from the cache unset the cached flag 2022-08-04 15:52:10 -07:00
Dylan Baker ebe74fd253 cache: free the cache table when it is empty and set to NULL
We do the latter for the benefit of libpkgconf. This cleans up a
significant number of memory leaks in the cache handling.
2022-08-04 15:52:10 -07:00
Dylan Baker 96c61cbab0 libpkgconf: remove trailing ; from macro definition
GCC has a lovely bug (which I will report as soon as I have an account),
which causes -Wmisleading-indentation to miss cases of misleading
indentation after a `;;`, since the macro adds `;`, and in call cases
the caller also adds `;`, we end up with a double macro and gcc fails to
warn.
2022-08-03 12:03:15 -07:00
Ariadne Conill 6c70781aad introduce PKG_CONFIG_PKGCONF1_SYSROOT_RULES for legacy pkgconf behavior 2022-07-26 18:00:22 +00:00
Ariadne Conill f8aefea7ec pkg: add flags argument to pkgconf_pkg_new_from_file 2022-07-26 17:13:15 +00:00
Ariadne Conill 297e18f2c8 tuple: add flags parameter to pkgconf_tuple_parse 2022-07-26 17:08:48 +00:00
Ariadne Conill b0802cb3d1 Revert "pkgconf_pkg_parser_value_set(): fix code-path ordering bug."
This reverts commit 13fe4c8c58.
2022-06-26 19:41:31 +00:00
Ariadne Conill 72e429ae70 tuple: use ${pc_sysrootdir} instead of client->sysroot_dir where relevant 2022-06-26 19:35:19 +00:00
Ariadne Conill a61193c723 pkg: fix sysroot_dir logic for github 213 2022-06-26 19:16:00 +00:00