### Get New Solvables for Installation Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieves all packages slated for installation by the transaction. These are the packages that will need to be downloaded. ```cpp Solvable *newsolvables() ``` ```perl my @newsolvables = $trans->newsolvables(); ``` ```python newsolvables = trans.newsolvables() ``` ```python newsolvables = trans.newsolvables() ``` -------------------------------- ### Install libsolv headers and library Source: https://github.com/opensuse/libsolv/blob/master/src/CMakeLists.txt Installs the libsolv header files to the include directory and the built library (shared or static) to the library directory. Runtime binaries are installed to the bin directory. ```cmake INSTALL (FILES ${libsolv_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/solv") INSTALL (TARGETS libsolv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Get Solvables to Keep Installed Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a list of installed packages that the transaction will keep without modification. ```cpp Solvable *keptsolvables() ``` ```perl my @keptsolvables = $trans->keptsolvables(); ``` ```python keptsolvables = trans.keptsolvables() ``` ```python keptsolvables = trans.keptsolvables() ``` -------------------------------- ### Install Targets Source: https://github.com/opensuse/libsolv/blob/master/tools/CMakeLists.txt Installs all defined tool executables to the binary directory specified by CMAKE_INSTALL_BINDIR. ```cmake INSTALL (TARGETS ${tools_list} DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Get Transaction Steps Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns all solvables that require an action: installation if not already present, or erasure if currently installed. Each step is also known as a transaction element. ```cpp Solvable *steps() ``` ```perl my @steps = $trans->steps(); ``` ```python steps = trans.steps() ``` ```python steps = trans.steps() ``` -------------------------------- ### Installation Rules for Headers and Libraries Source: https://github.com/opensuse/libsolv/blob/master/ext/CMakeLists.txt Installs the header files to the standard include directory and the built library (shared or static) to the appropriate library and runtime directories. ```cmake INSTALL (FILES ${libsolvext_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/solv") INSTALL (TARGETS libsolvext LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Install Executable Target Source: https://github.com/opensuse/libsolv/blob/master/examples/solv/CMakeLists.txt Configures the installation of the 'solv' executable. It specifies the target to be installed and the destination directory. ```cmake INSTALL(TARGETS solv DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Install Ruby Bindings Source: https://github.com/opensuse/libsolv/blob/master/bindings/ruby/CMakeLists.txt Installs the compiled Ruby bindings library to the configured Ruby installation directory. ```cmake INSTALL (TARGETS bindings_ruby LIBRARY DESTINATION ${RUBY_INSTALL_DIR}) ``` -------------------------------- ### Get Considered Solvables List Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieves the list of solvables that are eligible for installation. ```Perl my @ids = $pool->get_considered_list(); ``` ```Python ids = pool.get_considered_list() ``` -------------------------------- ### Setting the Installed Repository in Lua Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Shows how to assign a repository to the 'installed' attribute of a libsolv pool in Lua. ```lua pool.installed = repo ``` -------------------------------- ### Calculate Install Size Change Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns the net change in installed system size, measured in kibibytes (kibibytes). ```cpp long long calc_installsizechange() ``` ```perl my $change = $trans->calc_installsizechange(); ``` ```python change = trans.calc_installsizechange() ``` ```python change = trans.calc_installsizechange() ``` -------------------------------- ### Install Tcl Module File Source: https://github.com/opensuse/libsolv/blob/master/bindings/tcl/CMakeLists.txt Installs the generated Tcl module file to the Tcl installation directory. ```cmake INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/solv.tm DESTINATION ${TCL_INSTALL_DIR} RENAME solv-${VERSION}.tm) ``` -------------------------------- ### Get All Other Solvables Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt For installed packages, returns all packages that replace the given solvable. For packages to be installed, it returns all packages that the new package replaces. The special 'other' solvable is always the first element. ```cpp Solvable *allothersolvables(Solvable *solvable) ``` ```perl my @others = $trans->allothersolvables($solvable); ``` ```python others = trans.allothersolvables(solvable) ``` ```python others = trans.allothersolvables(solvable) ``` -------------------------------- ### Building and Installing Lua Bindings Source: https://github.com/opensuse/libsolv/blob/master/bindings/lua/CMakeLists.txt Compiles the Lua bindings as a shared library and installs it to the configured Lua library directory. ```cmake ADD_LIBRARY (bindings_lua SHARED solv_lua.c) SET_TARGET_PROPERTIES (bindings_lua PROPERTIES PREFIX "" OUTPUT_NAME "solv" INSTALL_NAME_DIR "${LUA_INSTALL_DIR}") TARGET_LINK_LIBRARIES (bindings_lua ${LIBSOLV_BINDINGS_LIBRARIES} ${LUA_LIBRARY} ${SYSTEM_LIBRARIES}) INSTALL (TARGETS bindings_lua LIBRARY DESTINATION ${LUA_INSTALL_DIR}) ``` -------------------------------- ### Setting the Installed Repository in Perl Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Shows how to assign a repository to the 'installed' attribute of a libsolv pool in Perl. ```perl $pool->{installed} = $repo; ``` -------------------------------- ### get_considered_list Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Gets the list of solvables that are eligible for installation. ```APIDOC ## Id *get_considered_list() ### Description Get the list of solvables that are eligible for installation. ### Method get_considered_list ### Parameters None ### Response - **Id***: A pointer to an array of Ids representing the considered solvables. ``` -------------------------------- ### Check if Solvable is Installable Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns true if the solvable can be installed on the system, considering architecture support. ```cpp bool installable() $solvable->installable() solvable.installable() solvable.installable? ``` -------------------------------- ### Solvable Methods Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Provides methods to query the installability, installation status, identity, and dependency matching of a solvable. It also includes methods for creating a selection and retrieving a string representation of the solvable. ```APIDOC ## installable ### Description Returns true if the solvable is installable on the system. Solvables are not installable if the system does not support their architecture. ### Method bool ### Endpoint N/A (Method call) ### Parameters None ### Request Example ``` $solvable->installable() solvable.installable() ``` ### Response #### Success Response - **return** (bool) - True if the solvable is installable, false otherwise. #### Response Example ``` true ``` ## isinstalled ### Description Returns true if the solvable is installed on the system. ### Method bool ### Endpoint N/A (Method call) ### Parameters None ### Request Example ``` $solvable->isinstalled() solvable.isinstalled() ``` ### Response #### Success Response - **return** (bool) - True if the solvable is installed, false otherwise. #### Response Example ``` true ``` ## identical ### Description Returns true if the two solvables are identical. ### Method bool ### Endpoint N/A (Method call) ### Parameters - **other** (Solvable *) - The other solvable to compare against. ### Request Example ``` $solvable->identical($other) solvable.identical(other) ``` ### Response #### Success Response - **return** (bool) - True if the solvables are identical, false otherwise. #### Response Example ``` true ``` ## evrcmp ### Description Compares the epoch/version/release of the solvable with another solvable. ### Method int ### Endpoint N/A (Method call) ### Parameters - **other** (Solvable *) - The other solvable to compare against. ### Request Example ``` $solvable->evrcmp($other) solvable.evrcmp(other) ``` ### Response #### Success Response - **return** (int) - -1 if less than, 1 if greater than, 0 if equal. #### Response Example ``` -1 ``` ## matchesdep ### Description Returns true if the dependencies stored in keyname match the specified dependency. ### Method int ### Endpoint N/A (Method call) ### Parameters - **keyname** (Id) - The keyname to check. - **id** (DepId) - The dependency ID to match. - **marker** (Id, optional) - The marker for the dependency. ### Request Example ``` $solvable->matchesdep($keyname, $dep) solvable.matchesdep(keyname, dep) ``` ### Response #### Success Response - **return** (int) - True if dependencies match, false otherwise. #### Response Example ``` 1 ``` ## Selection ### Description Creates a Selection containing just the single solvable. ### Method Selection ### Endpoint N/A (Method call) ### Parameters - **setflags** (int, optional) - Flags to set for the selection. ### Request Example ``` my $sel = $solvable->Selection() sel = solvable.Selection() ``` ### Response #### Success Response - **return** (Selection) - A Selection object containing the solvable. #### Response Example ``` Selection(...) ``` ## str ### Description Returns a string describing the solvable. The string consists of the name, version, and architecture of the Solvable. ### Method const char * ### Endpoint N/A (Method call) ### Parameters None ### Request Example ``` my $str = $solvable->str() str = $solvable.str() ``` ### Response #### Success Response - **return** (const char *) - A string representation of the solvable. #### Response Example ``` "name-version-arch" ``` ## equality ### Description Compares two solvables for equality. Two solvables are equal if they are part of the same pool and have the same ids. ### Method Comparison operator (==) ### Endpoint N/A (Operator overload) ### Parameters - **solvable1** (Solvable *) - The first solvable. - **solvable2** (Solvable *) - The second solvable. ### Request Example ``` if ($solvable1 == $solvable2) if solvable1 == solvable2: ``` ### Response #### Success Response - **return** (bool) - True if the solvables are equal, false otherwise. #### Response Example ``` true ``` ``` -------------------------------- ### Install Tcl Shared Library Source: https://github.com/opensuse/libsolv/blob/master/bindings/tcl/CMakeLists.txt Installs the compiled Tcl shared library to the Tcl installation directory. ```cmake INSTALL (TARGETS bindings_tcl LIBRARY DESTINATION ${TCL_INSTALL_DIR}) ``` -------------------------------- ### Build and Install Python Module Source: https://github.com/opensuse/libsolv/blob/master/bindings/python/CMakeLists.txt Compiles the Python bindings as a shared library and installs it to the Python site-packages directory. ```cmake ADD_DEFINITIONS(-Wno-unused) INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH}) ADD_LIBRARY (bindings_python MODULE solv_python.c) SET_TARGET_PROPERTIES (bindings_python PROPERTIES PREFIX "" OUTPUT_NAME "_solv") TARGET_LINK_LIBRARIES (bindings_python ${LIBSOLV_BINDINGS_LIBRARIES} ${SYSTEM_LIBRARIES}) INSTALL (TARGETS bindings_python LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}) INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/solv.py DESTINATION ${PYTHON_INSTALL_DIR}) ``` -------------------------------- ### add_products Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Adds the installed SUSE products database to the repository. The dir parameter is usually "/etc/products.d". ```APIDOC ## add_products ### Description Adds the installed SUSE products database to the repository. ### Parameters #### Path Parameters - **dir** (const char *) - Required - The directory containing the products database. - **flags** (int) - Optional - Flags to modify behavior (default is 0). ### Method Signature `bool add_products(const char *dir, int flags = 0)` ``` -------------------------------- ### Lua Library Installation Directory Source: https://github.com/opensuse/libsolv/blob/master/bindings/lua/CMakeLists.txt Sets the installation directory for the Lua library. Defaults to a version-specific subdirectory within the system's library path. ```cmake IF (NOT LUA_INSTALL_DIR) SET(LUA_INSTALL_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}) ENDIF (NOT LUA_INSTALL_DIR) MESSAGE (STATUS "Lua installation dir: ${LUA_INSTALL_DIR}") ``` -------------------------------- ### Add SUSE Products Database to Repository Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Adds the installed SUSE products database to the repository. The dir parameter is typically '/etc/products.d'. ```c bool add_products(const char *dir, int flags = 0) ``` ```perl $repo->add_products($dir); ``` ```python repo.add_products(dir) ``` ```python repo.add_products(dir) ``` -------------------------------- ### Setting the System Architecture Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Specify the system architecture for package installation decisions. Defaults to the output of 'uname -m'. ```php $pool->setarch(); ``` ```python pool.setarch() ``` ```python pool.setarch() ``` -------------------------------- ### Install Python 3 Bindings Source: https://github.com/opensuse/libsolv/blob/master/bindings/python3/CMakeLists.txt Installs the compiled shared library and the Python wrapper script to the Python 3 site-packages directory. This makes the bindings available for import in Python. ```cmake INSTALL (TARGETS bindings_python3 LIBRARY DESTINATION ${PYTHON3_INSTALL_DIR}) INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/solv.py DESTINATION ${PYTHON3_INSTALL_DIR}) ``` -------------------------------- ### Install FindLibSolv Module Source: https://github.com/opensuse/libsolv/blob/master/CMakeLists.txt Installs the FindLibSolv.cmake module to the share/cmake/Modules directory of the installation prefix. ```cmake INSTALL( FILES ${CMAKE_MODULE_PATH}/FindLibSolv.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules ) ``` -------------------------------- ### Get Alternatives Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Return all alternatives recorded in the solver run. See the Alternative class for more information. ```perl my @alternatives = $solver->alternatives(); ``` ```python alternatives = solver.alternatives() ``` ```python alternatives = solver.alternatives() ``` -------------------------------- ### Install Perl Module and Bindings Source: https://github.com/opensuse/libsolv/blob/master/bindings/perl/CMakeLists.txt Installs the compiled Perl module and its associated .pm file to the appropriate Perl library directory, making it available for use by Perl scripts. ```cmake INSTALL (TARGETS bindings_perl LIBRARY DESTINATION ${PERL_INSTALL_DIR}) INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/solv.pm DESTINATION ${PERL_INSTALL_DIR}) ``` -------------------------------- ### Generate Pkg-config Files Source: https://github.com/opensuse/libsolv/blob/master/CMakeLists.txt Configures the generation and installation of pkg-config files for libsolv and libsolvext. This ensures that other projects can easily find and link against these libraries. ```cmake MACRO (PCFILE) MESSAGE (STATUS "Writing pkg-config files...") CONFIGURE_FILE (${CMAKE_SOURCE_DIR}/libsolv.pc.in ${CMAKE_BINARY_DIR}/libsolv.pc @ONLY) INSTALL( FILES ${CMAKE_BINARY_DIR}/libsolv.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} ) CONFIGURE_FILE (${CMAKE_SOURCE_DIR}/libsolvext.pc.in ${CMAKE_BINARY_DIR}/libsolvext.pc @ONLY) INSTALL( FILES ${CMAKE_BINARY_DIR}/libsolvext.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} ) ENDMACRO (PCFILE) ``` -------------------------------- ### Add and install static libsolv library Source: https://github.com/opensuse/libsolv/blob/master/src/CMakeLists.txt Conditionally adds and installs a separate static version of the libsolv library if ENABLE_STATIC is true and shared libraries are not disabled. This provides a static build option alongside the shared one. ```cmake IF (ENABLE_STATIC AND NOT DISABLE_SHARED) ADD_LIBRARY (libsolv_static STATIC ${libsolv_SRCS}) SET_TARGET_PROPERTIES(libsolv_static PROPERTIES OUTPUT_NAME "solv") SET_TARGET_PROPERTIES(libsolv_static PROPERTIES SOVERSION ${LIBSOLV_SOVERSION}) INSTALL (TARGETS libsolv_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ENDIF (ENABLE_STATIC AND NOT DISABLE_SHARED) ``` -------------------------------- ### get_disabled_list Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Gets the list of solvables that are not eligible for installation. ```APIDOC ## Id *get_disabled_list() ### Description Get the list of solvables that are not eligible for installation. ### Method get_disabled_list ### Parameters None ### Response - **Id***: A pointer to an array of Ids representing the disabled solvables. ``` -------------------------------- ### Loading and Using libsolv in Lua Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Shows how to load the libsolv Lua bindings and create a new pool and repository. Objects are created via constructor methods or returned by other methods. ```lua require("solv") pool = solv.Pool() repo = pool:add_repo("my_first_repo") ``` -------------------------------- ### Get Solvable String Representation Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a string describing the solvable, including its name, version, and architecture. ```cpp const char *str() my $str = $solvable->str() str = $solvable.str() str = $solvable.str() ``` -------------------------------- ### Set Considered Solvables List Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Sets the list of solvables that are eligible for installation. Note that the whatprovides hash needs to be recreated after changing this list. ```Perl $pool->set_considered_list(\@ids); ``` ```Python pool.set_considered_list(ids) ``` -------------------------------- ### Create What Provides Index Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates the internal 'whatprovides' hash for all provides of installable packages. This must be called before performing any lookups on provides, typically after addfileprovides(). ```c void createwhatprovides(); ``` ```perl $pool->createwhatprovides(); ``` ```python pool.createwhatprovides() ``` ```python pool.createwhatprovides() ``` -------------------------------- ### Get Selection as String Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a string representation describing the current selection. ```php my $str = $sel->str; ``` ```python str = str(sel) ``` ```python str = sel.to_s ``` -------------------------------- ### Get Disabled Solvables List Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieves the list of solvables that are not eligible for installation. ```Perl my @ids = $pool->get_disabled_list(); ``` ```Python ids = pool.get_disabled_list() ``` -------------------------------- ### Add Debian Database Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Adds the contents of the Debian installed package database to the repository. ```c bool add_debdb(int flags = 0) ``` ```perl $repo->add_debdb(); ``` ```python repo.add_debdb() ``` -------------------------------- ### Selection_all Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates a selection containing all packages. This is useful as a starting point for intersecting other selections or for update/distupgrade jobs. ```APIDOC ## Selection Selection_all() ### Description Create a selection containing all packages. Useful as starting point for intersecting other selections or for update/distupgrade jobs. ### Method Selection_all ### Parameters None ### Response - **Selection**: A selection object containing all packages. ``` -------------------------------- ### Get Decision for Solvable Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Return a decision object describing why a specific solvable was installed or erased. See the Decision class for more information. ```perl my $decision = $solver->get_decision($solvable); ``` ```python decision = solver.get_decision(solvable); ``` ```python decision = solver.get_decision(solvable); ``` -------------------------------- ### createwhatprovides Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates the internal 'whatprovides' hash over all of the provides of all installable packages. This method must be called before doing any lookups on provides. It's encouraged to do it right after all repos are set up, usually right after the call to addfileprovides(). ```APIDOC ## createwhatprovides ### Description Builds an internal hash of all package provides, essential for subsequent provide lookups. It should be called after setting up repositories and potentially after `addfileprovides()`. ### Method void ### Endpoint $pool->createwhatprovides() pool.createwhatprovides() ### Parameters None. ### Request Example None provided. ### Response None (void function). ``` -------------------------------- ### Python: Create Pool and Add Repository Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Create a new solv.Pool object and add a repository named 'my_first_repo'. ```python pool = solv.Pool() repo = pool.add_repo("my_first_repo") ``` -------------------------------- ### Get Decision List for Solvable Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Return a list of decisions that caused a specific solvable to be installed or erased. This is usually more useful than get_decision() as it returns every involved decision. ```perl my @decisions = $solver->get_decisionlist($solvable); ``` ```python decisions = solver.get_decisionlist(solvable) ``` ```python decisions = solver.get_decisionlist(solvable) ``` -------------------------------- ### getpooljobs Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Gets the fixed jobs stored in the pool. These jobs are automatically appended to all solver jobs and are meant for fixed configurations like which packages can be multiversion installed, user-installed, or must not be erased. ```APIDOC ## Job *getpooljobs() ### Description Get fixed jobs stored in the pool. Those jobs are automatically appended to all solver jobs, they are meant for fixed configurations like which packages can be multiversion installed, which packages were userinstalled, or which packages must not be erased. ### Method getpooljobs ### Parameters None ### Response - **Job***: A pointer to the jobs stored in the pool. ``` -------------------------------- ### Create Selection Object Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates an empty selection, useful as a starting point for merging other selections. ```c Selection Selection(); ``` ```perl my $sel = $pool->Selection(); ``` ```python sel = pool.Selection() ``` ```python sel = pool.Selection() ``` -------------------------------- ### Creating a New Pool Instance in Lua Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Example of creating a new libsolv pool instance using Lua's object-oriented syntax. ```lua pool = solv.Pool() ``` -------------------------------- ### Define Executable: installcheck Source: https://github.com/opensuse/libsolv/blob/master/tools/CMakeLists.txt Creates the 'installcheck' executable. It links against the selected libsolv tools libraries and system libraries. ```cmake ADD_EXECUTABLE (installcheck installcheck.c) TARGET_LINK_LIBRARIES (installcheck ${LIBSOLV_TOOLS_LIBRARIES} ${SYSTEM_LIBRARIES}) ``` -------------------------------- ### Check if Solvable is Installed Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns true if the solvable is currently installed on the system. ```cpp bool isinstalled() $solvable->isinstalled() solvable.isinstalled() solvable.isinstalled? ``` -------------------------------- ### Tcl: Create Pool and Add Repository Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Create a new solv::Pool object and add a repository named 'my_first_repo'. ```tcl TCL set pool [solv::new_Pool] TCL set repo [$pool add_repo "my_first_repo"] ``` -------------------------------- ### Get learnt rules (Python) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a list of learnt rules that are part of the problem proof, useful for presenting a complete proof. ```python learnt = problem.get_learnt() ``` -------------------------------- ### Create Selection of All Packages Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates a selection containing all packages in the pool. This is useful as a starting point for further selection operations or for update/distupgrade jobs. ```Perl my $sel = $pool->Selection_all(); ``` ```Python sel = pool.Selection_all() ``` -------------------------------- ### Determine Tcl Installation Directory Source: https://github.com/opensuse/libsolv/blob/master/bindings/tcl/CMakeLists.txt Executes a Tcl script to find the installation directory of Tcl. ```cmake EXECUTE_PROCESS ( COMMAND echo "puts -nonewline [lindex [::tcl::tm::list] end]" COMMAND ${TCL_TCLSH} OUTPUT_VARIABLE TCL_INSTALL_DIR ) ``` -------------------------------- ### Create Whatprovides Index Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-pool.txt Creates an index that maps dependency IDs to sets of packages that provide them. This is used for efficient dependency lookups. ```c void pool_createwhatprovides(Pool *pool); ``` -------------------------------- ### Creating a New Pool Instance in Perl Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Example of creating a new libsolv pool instance using Perl's object-oriented syntax. ```perl my $pool = solv::Pool->new(); ``` -------------------------------- ### Determine Python Installation Directory Source: https://github.com/opensuse/libsolv/blob/master/bindings/python/CMakeLists.txt Executes a Python script to determine the platform-specific library installation path. ```cmake EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; import sysconfig; stdout.write(sysconfig.get_path('platlib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) ``` -------------------------------- ### setarch(const char *arch = 0) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Sets the system architecture, which is used to determine installable packages. Defaults to the output of 'uname -m'. ```APIDOC ## setarch(const char *arch = 0) ### Description Set the architecture for your system. The architecture is used to determine which packages are installable. It defaults to the result of ``uname -m`'. ### Method `void setarch(const char *arch = 0)` ### Parameters #### Path Parameters - **arch** (const char *) - The architecture string. If not provided, it defaults to the system's machine architecture. ### Examples ```c $pool->setarch(); ``` ```python pool.setarch() ``` ``` -------------------------------- ### Adding a Repository to the Pool Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Create and add a new, empty repository to the pool with a given name. Use repository methods to populate it with packages. ```php $repo = $pool->add_repo($name); ``` ```python repo = pool.add_repo(name) ``` ```python repo = pool.add_repo(name) ``` -------------------------------- ### Ruby: Create Pool and Add Repository Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Create a new Solv::Pool object and add a repository named 'my_first_repo'. ```ruby pool = Solv::Pool.new repo = pool.add_repo("my_first_repo") ``` -------------------------------- ### Get String Representation of a Decision (Python Binding) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Python binding to get the string representation of a decision. This offers a human-readable summary of the decision. ```python str = decision.to_s() ``` -------------------------------- ### Get Reason String for a Decision (Python Binding) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Python binding to get the reason string for a decision. This provides a textual explanation of why a decision was made. ```python str = decision.reasonstr() ``` -------------------------------- ### Methods Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Details on the available methods for interacting with libsolv objects, including position retrieval, stringification, and selection manipulation. ```APIDOC ## Methods ### pos() - **Description**: Returns the position object of the current match. It can be used to do sub-searches starting at the match (if it is of an array type). See the `Datapos` class for more information. - **Signature**: `Datapos pos()` - **Usage**: `$d->pos()`, `d.pos()` ### parentpos() - **Description**: Returns the position object of the array containing the current match. It can be used to do sub-searches, see the `Datapos` class for more information. - **Signature**: `Datapos parentpos()` - **Usage**: `$d->parentpos()`, `d.parentpos()` ### str - **Description**: Returns the stringification of the matched value. Stringification depends on the search flags, for file list entries it will return just the base name unless `SEARCH_FILES` is used, for checksums it will return an empty string unless `SEARCH_CHECKSUMS` is used. Numeric values are currently stringified to an empty string. - **Signature**: `` - **Usage**: `$d->str`, `str(d)`, `d.to_s` ### isempty() - **Description**: Returns true if the selection is empty, i.e. no package could be matched. - **Signature**: `bool isempty()` - **Usage**: `$sel->isempty()`, `sel.isempty()` ### clone() - **Description**: Returns a copy of a selection. - **Signature**: `Selection clone(int flags = 0)` - **Usage**: `$sel->clone()`, `sel.clone()` ### filter() - **Description**: Intersects two selections. Packages will only stay in the selection if they are also included in the other selection. Does an in-place modification. - **Signature**: `void filter(Selection *other)` - **Usage**: `$sel->filter($other)`, `sel.filter(other)` ### add() - **Description**: Adds another selection to the current one. Packages from the other selection are added to the current selection. - **Signature**: `void add(Selection *other)` - **Usage**: `$sel->add($other)`, `sel.add(other)` ``` -------------------------------- ### Allow Name Change Solver Flag Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt The SOLVER_FLAG_ALLOW_NAMECHANGE flag is enabled by default and allows the solver to install a package with a different name that obsoletes an installed package. ```c #define SOLVER_FLAG_ALLOW_NAMECHANGE 0x00000008 ``` -------------------------------- ### Determine Python 3 Installation Directories Source: https://github.com/opensuse/libsolv/blob/master/bindings/python3/CMakeLists.txt Executes Python commands to find the platform-specific library installation directory and include path. These are essential for correct linking and compilation. ```cmake EXECUTE_PROCESS(COMMAND ${PYTHON3_EXECUTABLE} -c "from sys import stdout; import sysconfig; stdout.write(sysconfig.get_path('platlib'))" OUTPUT_VARIABLE PYTHON3_INSTALL_DIR) EXECUTE_PROCESS(COMMAND ${PYTHON3_EXECUTABLE} -c "from sys import stdout; import sysconfig; stdout.write(sysconfig.get_path('include'))" OUTPUT_VARIABLE PYTHON3_INCLUDE_DIR) ``` -------------------------------- ### Perl: Create Pool and Add Repository Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Create a new solv::Pool object and add a repository named 'my_first_repo'. ```perl my $pool = solv::Pool->new(); my $repo = $pool->add_repo("my_first_repo"); ``` -------------------------------- ### Creating Selection by Provides (Python) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates a Selection object based on the dependency's provides in Python. ```python sel = dep.Selection_provides() ``` -------------------------------- ### Decision Information Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieve information about why a specific solvable was installed or erased. ```APIDOC ## get_decision ### Description Returns a decision object that describes why a specific solvable was installed or erased. This method returns a single decision. ### Method Decision = get_decision(Solvable *s) ### Parameters #### Path Parameters - **s** (Solvable *) - Required - The solvable for which to get the decision. ### Response #### Success Response (Decision) - Returns a Decision object describing the reason for the solvable's state. ``` ```APIDOC ## get_decisionlist ### Description Returns a list of decisions that caused the specific solvable to be installed or erased. This is usually more useful than get_decision() as it returns every involved decision. ### Method Decision *get_decisionlist(Solvable *s) ### Parameters #### Path Parameters - **s** (Solvable *) - Required - The solvable for which to get the decision list. ### Response #### Success Response (array of Decision *) - Returns an array of Decision objects describing all reasons for the solvable's state. ``` -------------------------------- ### add_arch_local Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Adds the contents of the archlinux installed package database to the repository. ```APIDOC ## add_arch_local ### Description Adds the contents of the archlinux installed package database to the repository. The _dir_ parameter is usually set to "/var/lib/pacman/local". ### Signature ```c bool add_arch_local(const char *dir, int flags = 0) ``` ### Examples ```perl $repo->add_arch_local($dir); ``` ```python repo.add_arch_local(dir) ``` ``` -------------------------------- ### Create Repository Selection Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates a Selection object containing all packages within the repository. ```c++ my $sel = $repo->Selection(); ``` ```python sel = repo.Selection() ``` ```python sel = repo.Selection() ``` -------------------------------- ### add_debdb Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Adds the contents of the debian installed package database to the repository. ```APIDOC ## add_debdb ### Description Adds the contents of the debian installed package database to the repository. ### Signature ```c bool add_debdb(int flags = 0) ``` ### Examples ```perl $repo->add_debdb(); ``` ```python repo.add_debdb() ``` ``` -------------------------------- ### Find Solvables Matching Package Dependencies Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns all solvables that match package dependencies against the provides of a given solvable. ```c Solvable *whatmatchessolvable(Id keyname, Solvable solvable, Id marker = -1); ``` ```perl my @solvables = $pool->whatmatchessolvable($keyname, $solvable); ``` ```python solvables = pool.whatmatchessolvable(keyname, solvable) ``` ```python solvables = pool.whatmatchessolvable(keyname, solvable) ``` -------------------------------- ### pool_isemptyupdatejob Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-pool.txt Determines if an update job is a no-op (does not affect any installed packages). ```APIDOC ## pool_isemptyupdatejob ### Description Return ``1'' if the job is an update job that does not work with any installed package, i.e. the job is basically a no-op. You can use this to turn no-op update jobs into install jobs (as done by package managers like ``zypper''). ### Signature int pool_isemptyupdatejob(Pool *pool, Id how, Id what); ``` -------------------------------- ### Get Solver Flag Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieve the current value of a solver-specific flag. ```perl my $value = $solver->get_flag($flag); ``` ```python value = solver.get_flag(flag) ``` ```python value = solver.get_flag(flag) ``` -------------------------------- ### Alternatives Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieve information about alternatives recorded in the solver run. ```APIDOC ## alternatives ### Description Returns all alternatives recorded in the solver run. See the Alternative class for more information. ### Method Alternative *alternatives() ### Response #### Success Response (array of Alternative *) - Returns an array of Alternative objects. ``` ```APIDOC ## alternatives_count ### Description Returns the number of alternatives without creating alternative objects. ### Method int alternatives_count() ### Response #### Success Response (int) - Returns the count of alternatives. ``` -------------------------------- ### Decision Methods Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Methods available for the Decision object to get information about the decision. ```APIDOC ## reasonstr() ### Description Returns a string describing why the decisions were done (but without the decisions themselves). ### Method const char * ### Endpoint `reasonstr()` ``` ```APIDOC ## str() ### Description Returns a string describing the decisions (but without the reason). ### Method string ### Endpoint `str()` ``` -------------------------------- ### Selection Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates an empty selection. Useful as a starting point for merging other selections. ```APIDOC ## Selection ### Description Initializes an empty selection object. This is particularly useful as a base for merging multiple selections together. ### Method Selection ### Endpoint $pool->Selection() pool.Selection() ### Parameters None. ### Request Example None provided. ### Response * **sel** (Selection) - An empty Selection object. ``` -------------------------------- ### addfileprovides Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Scans all dependencies for file names and then scans all packages for matching files. If a filename has been matched, it will be added to the provides list of the corresponding package. The addfileprovides_queue variant works the same way but returns an array containing all file dependencies. ```APIDOC ## addfileprovides ### Description Scans dependencies for file names and matches them against package files. Adds matched filenames to the provides list of the corresponding package. `addfileprovides_queue` returns an array of file dependencies. ### Method void ### Endpoint $pool->addfileprovides() pool.addfileprovides() ### Parameters None explicitly documented for the void version. ### Request Example None provided. ### Response None (void function). ``` -------------------------------- ### Relational Dependency Flags (C++) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Example of relational dependency flags in C++. ```C++ Solv::REL_EQ | Solv::REL_GT | Solv::REL_LT ``` -------------------------------- ### Match Version ID Against Strings Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-pool.txt Matches a version ID against provided epoch, version, and release strings. Passing NULL for a part means it matches everything. ```c int pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version, const char *release); ``` -------------------------------- ### Relational Dependency Flags (Python) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Example of relational dependency flags in Python. ```Python solv.REL_EQ | solv.REL_GT | solv.REL_LT ``` -------------------------------- ### Recommendations and Suggestions Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieve lists of recommended and suggested solvables based on the solver run result. ```APIDOC ## get_recommended ### Description Returns all solvables that are recommended by the solver run result. This includes solvables included in the result. ### Method Solvable *get_recommended(bool noselected=0) ### Parameters #### Path Parameters - **noselected** (bool) - Optional - If set, filters out solvables already included in the result. Defaults to 0. ### Response #### Success Response (array of Solvable *) - Returns an array of recommended Solvable objects. ``` ```APIDOC ## get_suggested ### Description Returns all solvables that are suggested by the solver run result. This includes solvables included in the result. ### Method Solvable *get_suggested(bool noselected=0) ### Parameters #### Path Parameters - **noselected** (bool) - Optional - If set, filters out solvables already included in the result. Defaults to 0. ### Response #### Success Response (array of Solvable *) - Returns an array of suggested Solvable objects. ``` -------------------------------- ### Queue File Provides Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Adds file-based dependencies to the package pool and returns an array of all file dependencies. This information can be stored to speed up future loads. ```c Id *addfileprovides_queue(); ``` ```perl my @ids = $pool->addfileprovides_queue(); ``` ```python ids = pool.addfileprovides_queue() ``` ```python ids = pool.addfileprovides_queue() ``` -------------------------------- ### Relational Dependency Flags (Perl) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Example of relational dependency flags in Perl. ```Perl $solv::REL_EQ | $solv::REL_GT | $solv::REL_LT ``` -------------------------------- ### Set libsolv source files Source: https://github.com/opensuse/libsolv/blob/master/src/CMakeLists.txt Lists all source files that will be compiled into the libsolv library. This includes core components, repository handling, and utility functions. ```cmake SET (libsolv_SRCS bitmap.c poolarch.c poolvendor.c poolid.c pooldep.c poollang.c poolwhatprovides.c pool.c strpool.c dirpool.c solver.c solverdebug.c repo_solv.c repo_write.c evr.c queue.c repo.c repodata.c repopage.c util.c policy.c solvable.c transaction.c order.c rules.c problems.c linkedpkg.c cplxdeps.c chksum.c chksum_impl.c md5.c sha1.c sha2.c solvversion.c selection.c fileprovides.c diskusage.c suse.c solver_util.c cleandeps.c userinstalled.c filelistfilter.c decision.c) ``` -------------------------------- ### add_repo(const char *name) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Adds a new, empty repository with the specified name to the pool. ```APIDOC ## add_repo(const char *name) ### Description Add a Repository with the specified name to the pool. The repository is empty on creation, use the repository methods to populate it with packages. ### Method `Repo add_repo(const char *name)` ### Parameters #### Path Parameters - **name** (const char *) - The name for the new repository. ### Return Value A `Repo` object representing the newly added repository. ### Examples ```c $repo = $pool->add_repo($name); ``` ```python repo = pool.add_repo(name) ``` ``` -------------------------------- ### Get Hexadecimal Checksum String Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Finalizes the checksum and returns the result as a hexadecimal string. ```c++ const char *solv::Chksum::hex() ``` ```perl my $raw = $chksum->hex(); ``` ```python raw = chksum.hex() ``` ```ruby raw = chksum.hex() ``` -------------------------------- ### Add Public Key from File Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Adds a single public key from a specified file to the repository. ```c Solvable add_pubkey(const char *keyfile, int flags = 0) ``` ```perl my $solvable = $repo->add_pubkey($keyfile); ``` ```python solvable = repo.add_pubkey(keyfile) ``` -------------------------------- ### Get Ruleinfo object Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a Ruleinfo object containing information about why the rule was created. ```perl my $ruleinfo = $rule->info(); ``` -------------------------------- ### Get problem string representation Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a string describing the problem. This is a convenience function. ```perl my $str = $problem->str; ``` -------------------------------- ### Configure for RPM 5 Source: https://github.com/opensuse/libsolv/blob/master/CMakeLists.txt Enables RPM 5 support, defining the RPM5 preprocessor macro, enabling RPM database and metadata support, and finding the RPM package using PkgConfig. ```cmake IF (RPM5) MESSAGE (STATUS "Enabling RPM 5 support") ADD_DEFINITIONS (-DRPM5) SET (ENABLE_RPMDB ON) SET (ENABLE_RPMMD ON) FIND_PACKAGE (PkgConfig REQUIRED) PKG_CHECK_MODULES (RPM REQUIRED rpm) INCLUDE_DIRECTORIES (${RPM_INCLUDE_DIRS}) ENDIF (RPM5) ``` -------------------------------- ### Python: Load Libsolv Bindings Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Load the libsolv Python bindings using the 'import solv' statement. ```python import solv ``` -------------------------------- ### Get solution count Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns the number of solutions without creating solution objects. ```perl my $cnt = $problem->solution_count(); ``` -------------------------------- ### Get solutions Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns an array containing multiple possible solutions to fix the problem. ```perl my @solutions = $problem->solutions(); ``` -------------------------------- ### whatprovides Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns all solvables that provide the specified dependency. You can use either a Dep object or a simple Id as an argument. ```APIDOC ## whatprovides ### Description Retrieves all solvable packages that satisfy a given dependency. Accepts either a Dep object or an Id. ### Method Solvable * ### Endpoint $pool->whatprovides(DepId dep) pool.whatprovides(dep) ### Parameters * **dep** (DepId | Dep object) - The dependency to look for. ### Request Example None provided. ### Response * **solvables** (Solvable *) - An array of solvables that provide the dependency. ``` -------------------------------- ### Configure for Debian Source: https://github.com/opensuse/libsolv/blob/master/CMakeLists.txt Enables Debian-specific build options, including defining the DEBIAN preprocessor macro and enabling Debian repository support. ```cmake IF (DEBIAN) MESSAGE (STATUS "Building for Debian") ADD_DEFINITIONS (-DDEBIAN) SET (ENABLE_DEBIAN ON) SET (have_system ${have_system}x) ENDIF (DEBIAN) ``` -------------------------------- ### Get Alternatives Count Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Return the number of alternatives without creating alternative objects. ```perl my $cnt = $solver->alternatives_count(); ``` ```python cnt = solver.alternatives_count() ``` ```python cnt = solver.alternatives_count() ``` -------------------------------- ### Dependency Stringification (Python) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Alternative way to get a string representation of a dependency in Python. ```python str = dep.to_s ``` -------------------------------- ### Create a new libsolv pool instance Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-pool.txt Use this function to create a new pool object. The pool manages all data structures for the solver. ```c Pool *pool_create(); ``` -------------------------------- ### Dependency Stringification (Perl) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Alternative way to get a string representation of a dependency in Perl. ```perl my $str = $dep->str; ``` -------------------------------- ### Extend Mageia/Mandriva Packages with Info Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Extends packages from the synthesis file with info.xml and files.xml data. Ensure REPO_EXTEND_SOLVABLES is specified. ```c bool add_mdk_info(FILE *fp, int flags = 0) ``` ```perl $repo->add_mdk_info($fp); ``` ```python repo.add_mdk_info(fp) ``` -------------------------------- ### Getting Dependency String Representation (Python) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieves a string representation of the dependency in Python. ```python str = dep.str() ``` -------------------------------- ### Write Repository to File Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Writes the repository data to a file in 'solv' format for fast reading and caching. Returns false if an error occurs during writing. ```c++ $repo->write($fp) ``` ```python repo.write(fp) ``` ```python repo.write(fp) ``` -------------------------------- ### Getting Dependency String Representation (Perl) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Retrieves a string representation of the dependency in Perl. ```perl my $str = $dep->str(); ``` -------------------------------- ### select Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Creates a selection by matching packages against a specified string. Flags can be used to modify matching behavior, and the resulting selection can be used to create solver jobs. ```APIDOC ## Selection select(const char *name, int flags) ### Description Create a selection by matching packages against the specified string. See the Selection class for a list of flags and how to create solver jobs from a selection. ### Method select ### Parameters - **name** (string) - Required - The string to match packages against. - **flags** (int) - Required - Flags to modify the matching behavior. ### Response - **Selection**: A selection object containing matching packages. ``` -------------------------------- ### Tcl: Solve Jobs Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Pass a list of jobs to the solver and get the number of problems. ```tcl TCL set jobs [list $job1 $job2] TCL set problems [$solver solve $jobs] TCL puts "We have [llength $problems] problems..." ``` -------------------------------- ### Get decision list for a learnt rule Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a list of decisions proving a learnt rule. ```perl my @decisions = $rule->get_decisionlist(); ``` -------------------------------- ### Open File with Compression Support Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Opens a file at the specified path, supporting decompression/compression based on file extension. The mode argument is passed to the stdio library. ```c++ FILE *solv::xfopen(char *fn, char *mode = "r") ``` ```perl my $file = solv::xfopen($path); ``` ```python file = solv.xfopen(path) ``` ```ruby file = Solv::xfopen(path) ``` -------------------------------- ### Configure for Fedora Source: https://github.com/opensuse/libsolv/blob/master/CMakeLists.txt Enables Fedora-specific build options, including defining the FEDORA preprocessor macro and enabling RPM database and metadata support. ```cmake IF (FEDORA) MESSAGE(STATUS "Building for Fedora") ADD_DEFINITIONS (-DFEDORA) SET (ENABLE_RPMDB ON) SET (ENABLE_RPMMD ON) SET (have_system ${have_system}x) ENDIF (FEDORA) ``` -------------------------------- ### Get Ruleinfo object (Python) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a Ruleinfo object containing information about why the rule was created. ```python ruleinfo = rule.info() ``` -------------------------------- ### Get problem string representation (Python) Source: https://github.com/opensuse/libsolv/blob/master/doc/libsolv-bindings.txt Returns a string describing the problem. This is a convenience function. ```python str = str(problem) ```