Library for solving packages and reading repositories
C CMake Perl Perl 6 C++ Shell
larchunix Fix out of bounds compilation warning
When compiling with -D_FORTIFY_SOURCE=2, gcc raises the following
warning:

    In file included from /usr/include/string.h:494,
                     from /build/libsolv/src/libsolv-0.6.35/src/policy.c:16:
    In function ‘memcpy’,
        inlined from ‘urpm_reorder.isra.18’ at /build/libsolv/src/libsolv-0.6.35/src/policy.c:1239:9:
    /usr/include/bits/string_fortified.h:34:10: warning: ‘__builtin_memcpy’ forming offset 8 is out of the bounds [0, 7] [-Warray-bounds]
       return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Culprit code is:

     memcpy(kn, "kernel", 8);
     memcpy(kn + 6, flavor, release - flavor + 1);

The first memcpy copies 8 bytes whereas the string "kernel" as only 7
bytes. It does not have serious consequence since the second memcpy
overwrites the unwanted byte. Anyway, it is better to fix it.
Latest commit 9eddebd Aug 9, 2018

README

This is libsolv, a free package dependency solver using a satisfiability
algorithm.

This code is based on two major, but independent, blocks:

 1. Using a dictionary approach to store and retrieve package
    and dependency information.

 2. Using satisfiability, a well known and researched topic, for
    resolving package dependencies.

The sat-solver code has been written to aim for the newest packages,
record the decision tree to provide introspection, and also allows to
provide the user with suggestions on how to deal with unsolvable
problems. It also takes advantage of the repository storage to
minimize memory usage.

Supported package formats:
  - rpm/rpm5
  - deb
  - arch linux
  - haiku

Supported repository formats:
  - rpmmd (primary, filelists, comps, deltainfo/presto, updateinfo)
  - susetags, suse product formats
  - mandriva/mageia (synthesis, info, files)
  - arch linux
  - red carpet helix format
  - haiku

Requires: cmake 2.4.x

mkdir build
cd build
cmake ..
make

To create a package:
make srcpackage
see package/