This adds support for provides of the type "product-obsoletes(name)".
We translate this to "Obsoletes: product:<name>" in the generated
product pseudo package.
We need this because people used "Obsoletes: product:name" in the
"release" package, but this is no longer allowed in newer rpm versions.
Besides, the obsoletes is kind of wrong in the "release" package
anyway, it belongs in the generated "product:" package.
You need to configure with ENABLE_APK to get them.
Note that we currently only support the v2 format. We'll add
v3 support if somebody uses it in the future.
This is mostly the apk version comparison. We also do not add
spaces around the comparison ops for apk and shorten =~ to ~.
This is currenly bould to MULTI_SEMANTICS as we do not have
an "alpine" target yet.
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.)
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
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.
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.
Remove the "0:" stripping from the evr in testcase_read. Messing
with the evr is not our business, we need to reproduce the data
as faithful as possible.
Mixing repo_addflexarray calls will make the code moving the arrays
in the idarraydata all the time as it cannot append to the arrays.
So first collect the array contents of the collection flexarray and
then add it in one go.
This is based on pull request #533 by Aleš Matěj <amatej@redhat.com>.
Fix the following build failure without C++:
CMake Error at CMakeLists.txt:1 (PROJECT):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
Fixes:
- http://autobuild.buildroot.org/results/a7f2176d40f156c319754ef5d3b7fd0decfe754f
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>