1
0
mirror of https://github.com/openSUSE/libsolv.git synced 2026-02-05 12:45:46 +01:00

3748 Commits

Author SHA1 Message Date
Michael Schroeder
95aef5cc57 Add changes, bump version to 0.7.31 0.7.31 2024-11-12 10:56:36 +01:00
Michael Schroeder
f525415b10 Use the correct solvable id when checking the noarch map
Fixes issue #574
2024-11-12 10:44:07 +01:00
Michael Schroeder
081580de9f Init the whatprovides of new ids to an empty list for lazy file provides
Otherwise finding the provides will always search the file list.
2024-09-25 13:52:40 +02:00
Michael Schroeder
2150865d61 Make POOL_FLAG_ADDFILEPROVIDESFILTERED behaviour more standard
Turning on POOL_FLAG_ADDFILEPROVIDESFILTERED made the lookup of
all file dependencies lazy, not only the ones required by some
dependency. This changes the way searching works and may also
slow down some use cases.

We now changed addfileprovides() to record the needed non-standard
file dependencies and only make those lazy in createwhatprovides().
2024-09-18 14:33:20 +02:00
Michael Schroeder
e64cecfa10 Add rpm_query_idarray query function
This is added to query the OrderWithRequires dependencies from
downloaded rpms.

Also refactor query code a bit.
2024-09-16 15:43:45 +02:00
Michael Schroeder
c2959803ee Support orderwithrequires dependencies in testcases 2024-09-16 15:35:17 +02:00
Michael Schroeder
283074a4b5 Support rpm's "orderwithrequires" dependency
Note that the rpmmd parser cannot set it as the xml schema
does not include this type of dependency.
2024-09-12 12:37:09 +02:00
Michael Schroeder
8e390d8f8e Refactor string pool merging in repo_solv
Move merging code into strpool.c where it belongs. Also clean up
hashmask handling a bit.
2024-07-22 13:50:21 +02:00
Michael Schroeder
27aa6a72c7 Add changes, bump version to 0.7.30 0.7.30 2024-07-11 13:23:59 +02:00
Michael Schroeder
00db74aaa8 Merge pull request #571 from ppisar/dump_genid_format_overflow
Fix a possible format overflow in dump_genid()
2024-07-11 10:12:36 +02:00
Petr Písař
f31c6de1a7 Fix a possible format overflow in dump_genid()
GCC 14 called with CFLAGS='-O2 -Wformat-overflow' complains:

    /tmp/libsolv/ext/testcase.c: In function ‘dump_genid’:
    /tmp/libsolv/ext/testcase.c:1275:33: warning: ‘: genid ’ directive writing 8 bytes into a region of size between 3 and 12 [-Wformat-overflow=]
     1275 |       sprintf(cntbuf, "genid %2d: genid ", cnt++);
	  |                                 ^~~~~~~~
    /tmp/libsolv/ext/testcase.c:1275:7: note: ‘sprintf’ output between 17 and 26 bytes into a destination of size 20
     1275 |       sprintf(cntbuf, "genid %2d: genid ", cnt++);
	  |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /tmp/libsolv/ext/testcase.c:1270:33: warning: ‘: genid ’ directive writing 8 bytes into a region of size between 3 and 12 [-Wformat-overflow=]
     1270 |       sprintf(cntbuf, "genid %2d: genid ", cnt++);
	  |                                 ^~~~~~~~
    /tmp/libsolv/ext/testcase.c:1270:7: note: ‘sprintf’ output between 17 and 26 bytes into a destination of size 20
     1270 |       sprintf(cntbuf, "genid %2d: genid ", cnt++);
	  |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

That's indeed a bug: sprintf() writes into a 20-byte array cntbuf. cnt
is int, 32-bit long integer on x86_64 Linux platform. dump_genid()
starts with cnt = 1 and increases. It can go up to 2147483647 decimal
value, then wrap to -2147483648 decimal value.  That's up to 11 bytes
of the integer, plus 14 bytes of a static string, plus 1 byte of
a trailing '\0'. 26 bytes in total.

While it's improbable that cnt would amount that long number in real
life, it's better to be prepared for the worst. Also a benefit is that
static analyzers will be be content.

This patch increases cntbuf[] size to accomodate common 32-bit
ints. (Generic, albeit illegible, expression would be:

    cntbuf[((sizeof(cnt) * 8 - 1) * 3 / 10 + 1 + 1) + 14 + 1];

but I'm not sure that long expression is worth of it.)
2024-07-10 17:35:25 +02:00
Michael Schroeder
8151b3a8b4 Add new SOLVER_FLAG_FOCUS_NEW focus type
First resolve the given jobs, then the dependencies of the
resulting packages ignoreing the ones provided by currently
installed packages. After that resolve all already installed
packages. This is similar to SOLVER_FLAG_FOCUS_BEST but less
aggressive in updating packages.

Fixes issue #549
2024-07-09 13:06:16 +02:00
Michael Schroeder
5c3047a780 repo2solv: no longer use "find" to find rpms
This commit implements the file tree work needed
for the "plaindir" format. Like with the "find" command,
we do not follow symlinks to directories in recursive
mode.
2024-07-08 12:27:35 +02:00
Michael Schroeder
1602dc2c8f Add more changes 2024-06-07 15:31:18 +02:00
Michael Schroeder
e758a84462 Use %version in the new conflict and add a changes entry 2024-06-07 11:34:15 +02:00
Michael Schroeder
36791272b7 Merge pull request #565 from bmwiedemann/conflict
Add a Conflicts in libsolv-tools-base
2024-06-07 11:31:45 +02:00
Bernhard M. Wiedemann
ff3172da43 Add a Conflicts in libsolv-tools-base
so this does not get installed in parallel with older versions
of libsolv-tools
2024-06-07 10:24:45 +02:00
Michael Schroeder
b3aa55e65f bindings: fix return value of repodata.add_solv()
Found by Dante Grapiuna de Almeida, thanks!
Fixes #564
2024-05-21 13:43:32 +02:00
Michael Schroeder
4e0b43211f Also set errno for unsupported compressions in solv_xfopen_fd() 2024-05-16 15:46:23 +02:00
Michael Schroeder
563c233e5c Fix SHA-224 oid in solv_pgpvrfy 2024-05-16 15:42:10 +02:00
Michael Schroeder
a898731f29 Merge pull request #563 from ppisar/solv_xfopen_unsupported_error
Report unsupported compression in solv_xfopen() with errno
2024-05-16 15:41:31 +02:00
Petr Písař
fee69285c3 Report unsupported compression in solv_xfopen() with errno
If libsolv was built without Zstandard support and "primary.xml.zst"
was passed solv_xfopen(), solv_xfopen() returned 0 without setting
errno. A calling application could not distinguish an unsupported
compression format from other I/O errors.

This patch improves this situation by setting errno variable to an
appropriate value. The value macros are documented in POSIX 2017.
2024-05-15 16:55:55 +02:00
Michael Schroeder
9c2b1a84b5 Add changes, bump version to 0.7.29 0.7.29 2024-04-30 15:29:06 +02:00
Michael Schroeder
3f78593b01 Use exclude of repo2solv/rpmdb2solv in libsolv-tools 2024-04-30 15:08:54 +02:00
Michael Schroeder
729a885a28 Merge pull request #559 from dirkmueller/master
Split libsolv-tools
2024-04-30 15:06:06 +02:00
Michael Schroeder
53a0390bbc Merge pull request #561 from dirkmueller/remove_o3
Remove o3
2024-04-30 15:04:16 +02:00
Dirk Müller
44fc1a38b0 Split libsolv-tools 2024-04-26 09:23:09 +02:00
Dirk Müller
39f8506e83 Go back to -O2 for relwithdebuginfo
This removes about 11% of code size with neglegible performance
impact (tested via testsolv on a tumbleweed upgrade gives
equal performance)
2024-04-24 13:00:59 +02:00
Michael Schroeder
66c5b02c4b make testcases debian proof 2024-04-10 13:08:05 +02:00
Michael Schroeder
9b55a669e7 Add testcases for proof generation 2024-04-10 12:33:17 +02:00
Michael Schroeder
8cabc85b5f testsolv: Add missing entries to resultflags2str 2024-04-10 11:04:52 +02:00
Michael Schroeder
ed1d7428f7 Revert accidental change when sorting the decicions
This reverts a wrong change from commit 29ebc283f8
2024-04-10 10:45:07 +02:00
Michael Schroeder
d2215f08e6 Unbreak code to not end a proof with SOLVER_RULE_RPM_SAME_NAME
We broke it with commit f6b4704015
when we added the reason to the decisionlist entry but forgot
to adapt the code.

We need to add decisionlist testcases...
2024-04-10 10:40:43 +02:00
Michael Schroeder
29ebc283f8 getdecisionlist: keep track of all literals from a unit rule
Otherwise, sort_unit_decisions() may not find a unit rule and
go into and endless loop. Before this commit, we left out
conflicted packages to make the decisionlist shorter.

An alternative would be to track those left out literals.

Fixes #558.
2024-04-09 11:30:32 +02:00
Michael Schroeder
709092ef52 luasolv: delete debug line 2024-03-27 14:05:11 +01:00
Michael Schroeder
682a00013c bindings: implement returnself for lua
And add a warning if the definition is missing for a new language.
2024-03-27 13:48:19 +01:00
Michael Schroeder
8d5b43a063 Some lua typemap cleanups 2024-03-27 13:24:25 +01:00
Michael Schroeder
538cf2e503 Add datamatch.dep attribute support to the bindings 2024-03-27 11:40:20 +01:00
Michael Schroeder
5029b8cbfd Globally rename __str__ to str for perl and tcl 2024-03-27 11:40:19 +01:00
Michael Schroeder
5eb515815d Globally rename __str__ to to_s for ruby 2024-03-27 11:40:19 +01:00
Michael Schroeder
ff35f9ebee Add stringification for the solutionelement class
Also globalize some renames.
2024-03-27 11:40:18 +01:00
Michael Schroeder
dd3babbcee Merge pull request #557 from dcantrell/uninitialized-structs
Fix a couple small static analysis findings for uninitialized structs
2024-03-27 10:56:39 +01:00
David Cantrell
2c4ee52a94 Fix a couple small static analysis findings for uninitialized structs
The memset() on the KeyValue is more explicit even though if you trace
the code you will see it fills out the struct.  However, it's possible
that not every struct member will be initialized and adding the
memset() makes things more obvious and appeases the static analyzer.

The queue_init() appeared to just be missing.
2024-03-26 12:13:55 -04:00
Michael Schroeder
8817911727 Delete duplicated lines 2024-03-25 13:06:10 +01:00
Michael Schroeder
73eceaa561 Add lua to bindings documentation 2024-03-25 13:03:01 +01:00
Michael Schroeder
0d6e498aa0 Add lua bindings 2024-03-25 12:39:22 +01:00
Michael Schroeder
e87ef6038a Do __eq__ and __ne__ renaming as global rename for tcl
I didn't know this was possible...
2024-03-25 11:41:24 +01:00
Michael Schroeder
f3ed6afe49 Call appdata_get_helper with a pointer to the appdata
This adds more flexibility to the helper which is needed for the
upcoming lua bindings.
2024-03-25 11:35:32 +01:00
Michael Schroeder
7b0788fb7e Enable MULTI_SEMANTICS in the spec file
There's no good reason not to do it.
2024-02-15 11:01:06 +01:00
Michael Schroeder
6c9d91af21 Remove now unused argument 2024-02-14 10:34:57 +01:00