History log of /haiku/src/kits/package/solver/LibsolvSolver.cpp
Revision Date Author Comments
# af585d03 20-Nov-2015 Jérôme Duval <jerome.duval@gmail.com>

pkgman search: Add --requirements option


# 74b582a4 25-Oct-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver: Add SetDebugLevel()

In LibsolvSolver set the debug level of the pool.


# d5ed97cd 03-Feb-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver::GetResult(): Fix package update cases

* The transaction_type(.., ..., SOLVER_TRANSACTION_RPM_ONLY)
categorization of the transaction steps is incorrect since rpm
automatically replaces an older package version when a new one is
installed and thus such package removals would be omitted. Use a
simpler check instead.
* Omit the unnecessary explicit check whether a package really has to be
installed.

Thanks to Michael Schroeder @ SUSE for his help figuring this out.


# 6ef57ae2 25-Jan-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

pkgman: Add full-sync command

* BSolver/LibsolvSolver: Add FullSync() method. It uses libsolv's
SOLVER_DISTUPGRADE mode.
* BPackageManager: Add FullSync() using the new solver mode.
* pkgman: Add full-sync command.

The new command is similar to the update command without arguments, just
more aggressive, allowing downgrading or even removal of packages, to
match the state of the repositories. Just like "update" it doesn't work
properly yet.


# 57405de5 29-Sep-2013 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Always use dlopen and dlsym to load libsolv

Previous implementation used weak symbols on all platforms except Haiku. Mac OS X also does not support this use of weak symbols. In the discussion of #10028 it was decided that probably more platforms will have problems with this approach, so instead use the approach that always works.


# 6eb7e259 28-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libpackage_build: undefined weak symbols are unsupported

... also for gcc 4 (#8288), so we have to use the dlopen() method
always when building on Haiku. Fixes the build on gcc 4 Haiku.


# 7af664c9 29-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: change handling of fInstalledRepository

We update/set it in _AddRepositories() instead of in AddRepository(). In
code needing it earlier _InstalledRepository() can be used.

This change allows calling to SetInstalled() on a repository that has
already been added to the solver.


# 89cb0015 27-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver::VerifyInstallation(): Add flags parameter

Only flag ATM is B_VERIFY_ALLOW_UNINSTALL. It tells to solver to suggest
uninstalling packages when necessary instead of considering such a case
a problem.


# 75d15eb4 27-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver: Extend FindPackages() functionality

* Add flag B_FIND_INSTALLED_ONLY to only return installed packages.
* Add FindPackages() version that finds packages like Install() or
Uninstall() do.


# 2ada08d2 27-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: Automatic whitespace cleanup


# 98c6dfa4 05-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Switch build system from optional package to repositories

* Build libsolv and the dependency solver part of the package kit for
the build platform.
* Add build tool get_package_dependencies. Given a list of package files
and a list of repository files it determines the additional packages
that need to be retrieved from the repositories and prints their URLs.
* Add rules to work with external repositories in the build system
(build/jam/RepositoryRules):
- PackageRepository declares an external repository with all its
packages. The URL of the repository file isn't specified. It is
computed from a given base URL and the SHA256 hash of the list of
package files.
- GeneratedRepositoryPackageList generates a file containing the file
names of all packages in a repository.
- IsPackageAvailable returns whether a package is available in any
repository.
- PackageURL returns the URL for a package.
* Declare the HaikuPorts repository for x86_gcc2
(build/jam/repositories/HaikuPorts/x86_gcc2).
* Add rule AddHaikuImagePackages to add a package to the image and rule
IsHaikuImagePackageAdded to determine whether a package has been
added.
* OptionalPackages: Remove all entries that just downloaded and
installed an external package. AddHaikuImagePackages can be used
instead and is used in the remaining entries. Also move the remaining
optional package dependency declarations from
OptionalPackageDependencies here.
* ExtractBuildFeatureArchives: Instead of the URL parameter a package
name must be specified now. This allows to simplify BuildFeatures
significantly, since there's no dealing with URLs anymore. "if" out
the entries that aren't supported yet.
* build_haiku_image: For the packages installed in system and common
resolve their dependencies and download and install them as well.


# 001e9064 05-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: missing include


# 7b6d45c9 11-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: Use Solvable only where necessary

repo_internalize() apparently reorganizes the storage for Solvable
objects so that our fSolvablePackages and fPackageSolvables maps could
contain invalid pointers. Now the maps use the solvables' ID instead.
Also use the IDs instead of the Solvable objects in most other places,
which in some cases even simplifies the code a bit.


# 212c636f 21-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/LibsolvSolver: Add Update()


# de62d761 20-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/LibsolvSolver: Add Uninstall()

Also fix incorrect check in LibsolvSolver::GetResult().


# 8e6c3631 20-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/LibsolvSolver: Add problem solution selection support

... and re-solving.


# 0d8ed3f2 12-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver::Install(): Add optional unmatched specifier return param


# 334a5a56 12-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolverRepository: Change priority from uint8 to int32

This allows us to specifies priorities below and above the user
definable range.


# 115eae73 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver::Install(): Fix broken B_PACKAGE case


# 01758ed3 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Rework SolverPackageSpecifier

* It no longer consists of a BPackageResolvableExpression and a
repository. Instead it can now either refer to a package directly or
consist of a search string.
* SolverPackageSpecifierList: Add AppendSpecifier() convenience
versions.
* Adjust LibsolvSolver and pkgman accordingly.


# 663e351c 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/pkgman: Support for searching in provides

* BSolver/LibsolvSolver:
* Add B_FIND_IN_NAME and make searching in the names explicit.
* Add B_FIND_IN_PROVIDES to search the packages' provides list.
* pkgman: Also search in provides.


# fc57db48 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/LibsolvSolver: Add FindPackages()

Given a search string it finds all matching packages.


# a78a2540 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: Fix the lazy re-/initialization

* _Init() was a bit too enthusiastic, throwing really everything away.
So, after calling it at the beginning of _AddRepositories() there
wouldn't be any repositories anymore.
* Rename _Init() to _InitPool() to make its purpose clearer.
* Pull a _CleanupPool() out of _Cleanup() that only deletes the pool
and anything depending on it.
* RepositoryInfo::HasChanged(): Always consider changed when there's no
libsolv repo yet.


# 483d4996 10-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: Make repeated use of object possible

* _Solve(): Clean up the old solver before creating a new one.
* _AddRepositories(): Don't do anything, if the repositories haven't
changed.


# 5e01af31 09-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: Add data structures for problem solutions

... and add the problem solutions in LibsolvSolver.


# 65502bbe 03-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver: Add VerifyInstallation()

... and implement it in LibsolvSolver.


# 1a4d020d 02-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Flesh out the package kit solver API quite a bit more

* Reorganize things a bit:
- BSolver is now an abstract base class.
- A libsolv based implementation, LibsolvSolver, lives in a new
add-on, which is loaded lazily.
- Get rid of libpackage_solver. Save for LibsolvSolver everything
is moved to libpackage.
- This is a nicer solution for the cyclic dependency caused by
libsolv (libsolvext to be precise) using the package kit for
reading repositories and package files.
* Add a solver result data structure and and an accessor the solver.
* Add problem reporting support to the solver. There aren't data
structures for the problem solutions yet and support for selecting
solutions and re-solving is missing as well.


# 74b582a4e5a633d6ac8541ab3274725d51e49bec 25-Oct-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver: Add SetDebugLevel()

In LibsolvSolver set the debug level of the pool.


# d5ed97cd185a462f5b0ad7b75bb6564c7c1c9d6e 03-Feb-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver::GetResult(): Fix package update cases

* The transaction_type(.., ..., SOLVER_TRANSACTION_RPM_ONLY)
categorization of the transaction steps is incorrect since rpm
automatically replaces an older package version when a new one is
installed and thus such package removals would be omitted. Use a
simpler check instead.
* Omit the unnecessary explicit check whether a package really has to be
installed.

Thanks to Michael Schroeder @ SUSE for his help figuring this out.


# 6ef57ae2a96085ccb56e356e21e652cc11777ac0 25-Jan-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

pkgman: Add full-sync command

* BSolver/LibsolvSolver: Add FullSync() method. It uses libsolv's
SOLVER_DISTUPGRADE mode.
* BPackageManager: Add FullSync() using the new solver mode.
* pkgman: Add full-sync command.

The new command is similar to the update command without arguments, just
more aggressive, allowing downgrading or even removal of packages, to
match the state of the repositories. Just like "update" it doesn't work
properly yet.


# 57405de578b6ad646e55435b1b1d286cd5a5a6b3 29-Sep-2013 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Always use dlopen and dlsym to load libsolv

Previous implementation used weak symbols on all platforms except Haiku. Mac OS X also does not support this use of weak symbols. In the discussion of #10028 it was decided that probably more platforms will have problems with this approach, so instead use the approach that always works.


# 6eb7e259e9c9dfa1a88cf9cf388c0f3589512531 28-Sep-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

libpackage_build: undefined weak symbols are unsupported

... also for gcc 4 (#8288), so we have to use the dlopen() method
always when building on Haiku. Fixes the build on gcc 4 Haiku.


# 7af664c9d83ad7cc1d9f765833e49a2f492800fc 29-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: change handling of fInstalledRepository

We update/set it in _AddRepositories() instead of in AddRepository(). In
code needing it earlier _InstalledRepository() can be used.

This change allows calling to SetInstalled() on a repository that has
already been added to the solver.


# 89cb0015110ee685f9f53debfde366626d1b0d3b 27-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver::VerifyInstallation(): Add flags parameter

Only flag ATM is B_VERIFY_ALLOW_UNINSTALL. It tells to solver to suggest
uninstalling packages when necessary instead of considering such a case
a problem.


# 75d15eb4c28f63d038c43325dcfa0f71df6211a6 27-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver: Extend FindPackages() functionality

* Add flag B_FIND_INSTALLED_ONLY to only return installed packages.
* Add FindPackages() version that finds packages like Install() or
Uninstall() do.


# 2ada08d23a58ec0ea4459e0ec8c31f10142270c9 27-Aug-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: Automatic whitespace cleanup


# 98c6dfa41e20c57edf426197a8d9aab6223a59fd 05-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Switch build system from optional package to repositories

* Build libsolv and the dependency solver part of the package kit for
the build platform.
* Add build tool get_package_dependencies. Given a list of package files
and a list of repository files it determines the additional packages
that need to be retrieved from the repositories and prints their URLs.
* Add rules to work with external repositories in the build system
(build/jam/RepositoryRules):
- PackageRepository declares an external repository with all its
packages. The URL of the repository file isn't specified. It is
computed from a given base URL and the SHA256 hash of the list of
package files.
- GeneratedRepositoryPackageList generates a file containing the file
names of all packages in a repository.
- IsPackageAvailable returns whether a package is available in any
repository.
- PackageURL returns the URL for a package.
* Declare the HaikuPorts repository for x86_gcc2
(build/jam/repositories/HaikuPorts/x86_gcc2).
* Add rule AddHaikuImagePackages to add a package to the image and rule
IsHaikuImagePackageAdded to determine whether a package has been
added.
* OptionalPackages: Remove all entries that just downloaded and
installed an external package. AddHaikuImagePackages can be used
instead and is used in the remaining entries. Also move the remaining
optional package dependency declarations from
OptionalPackageDependencies here.
* ExtractBuildFeatureArchives: Instead of the URL parameter a package
name must be specified now. This allows to simplify BuildFeatures
significantly, since there's no dealing with URLs anymore. "if" out
the entries that aren't supported yet.
* build_haiku_image: For the packages installed in system and common
resolve their dependencies and download and install them as well.


# 001e9064e047cf92879745e62ef50727af7417d7 05-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: missing include


# 7b6d45c94231c30cd3ce280307269b5dc2367e22 11-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: Use Solvable only where necessary

repo_internalize() apparently reorganizes the storage for Solvable
objects so that our fSolvablePackages and fPackageSolvables maps could
contain invalid pointers. Now the maps use the solvables' ID instead.
Also use the IDs instead of the Solvable objects in most other places,
which in some cases even simplifies the code a bit.


# 212c636f4181a2b3a05fbfaa45e016b6c2e3aaa6 21-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/LibsolvSolver: Add Update()


# de62d76176c323928d2b97bc667f39850727aa1f 20-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/LibsolvSolver: Add Uninstall()

Also fix incorrect check in LibsolvSolver::GetResult().


# 8e6c3631a3e6deca3ca008bbce20bf30ec616d63 20-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/LibsolvSolver: Add problem solution selection support

... and re-solving.


# 0d8ed3f2a8f240750c15e9dfec09fb2e20b7160a 12-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver::Install(): Add optional unmatched specifier return param


# 334a5a566c49d247cd8b4491cd3c94748f7df18b 12-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolverRepository: Change priority from uint8 to int32

This allows us to specifies priorities below and above the user
definable range.


# 115eae73712eb0cc26ffba34235383d3c2a1a080 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver::Install(): Fix broken B_PACKAGE case


# 01758ed3323e22359f685ffb37ef42a3b856fd66 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Rework SolverPackageSpecifier

* It no longer consists of a BPackageResolvableExpression and a
repository. Instead it can now either refer to a package directly or
consist of a search string.
* SolverPackageSpecifierList: Add AppendSpecifier() convenience
versions.
* Adjust LibsolvSolver and pkgman accordingly.


# 663e351cb468e889ffcd08c07fc867b3002a1c91 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/pkgman: Support for searching in provides

* BSolver/LibsolvSolver:
* Add B_FIND_IN_NAME and make searching in the names explicit.
* Add B_FIND_IN_PROVIDES to search the packages' provides list.
* pkgman: Also search in provides.


# fc57db481fa36695457bc355ca9710c91d53ab1d 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver/LibsolvSolver: Add FindPackages()

Given a search string it finds all matching packages.


# a78a2540a820ca541177fce1d454d3aa7073715c 11-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: Fix the lazy re-/initialization

* _Init() was a bit too enthusiastic, throwing really everything away.
So, after calling it at the beginning of _AddRepositories() there
wouldn't be any repositories anymore.
* Rename _Init() to _InitPool() to make its purpose clearer.
* Pull a _CleanupPool() out of _Cleanup() that only deletes the pool
and anything depending on it.
* RepositoryInfo::HasChanged(): Always consider changed when there's no
libsolv repo yet.


# 483d49968d847843721d7e0c3a043327fc29955b 10-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

LibsolvSolver: Make repeated use of object possible

* _Solve(): Clean up the old solver before creating a new one.
* _AddRepositories(): Don't do anything, if the repositories haven't
changed.


# 5e01af3199254d0f5fd666b32b073a5283230021 09-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: Add data structures for problem solutions

... and add the problem solutions in LibsolvSolver.


# 65502bbe88c4686bdefbc5d646b9b681e1c49743 03-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BSolver: Add VerifyInstallation()

... and implement it in LibsolvSolver.


# 1a4d020daf80d0b0c30062530cf735ce46dc7dba 02-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Flesh out the package kit solver API quite a bit more

* Reorganize things a bit:
- BSolver is now an abstract base class.
- A libsolv based implementation, LibsolvSolver, lives in a new
add-on, which is loaded lazily.
- Get rid of libpackage_solver. Save for LibsolvSolver everything
is moved to libpackage.
- This is a nicer solution for the cyclic dependency caused by
libsolv (libsolvext to be precise) using the package kit for
reading repositories and package files.
* Add a solver result data structure and and an accessor the solver.
* Add problem reporting support to the solver. There aren't data
structures for the problem solutions yet and support for selecting
solutions and re-solving is missing as well.