Commit Graph

33 Commits

Author SHA1 Message Date
Ettore Di Giacinto
bd3e483f0f Be sure to cache packages with same fingerprint only once
this makes sure that we are fast to process also invalid trees
2021-01-12 10:30:31 +01:00
Ettore Di Giacinto
0652fce55e Update revdeps table while populating Cache
When we cycle, we don't necessarly have all the packages into the DB
yet.

With this change, luet annotates the reverse dependency without any version, and we try to
update revdeps table when new items gets added, by checking the version
required in the selector.

Thanks to @joostruis for noticing the issue
2020-12-30 01:12:35 +01:00
Ettore Di Giacinto
736c9470cf Add db copy and clone 2020-12-19 17:45:50 +01:00
Ettore Di Giacinto
f4e2f32aff Return candidate not found when appropriate 2020-12-19 14:57:42 +01:00
Ettore Di Giacinto
ce169f49af If provided isn't a selector, it means we don't have to return a range
Add also more tests about provides
2020-12-16 22:17:34 +01:00
Ettore Di Giacinto
1f807f369a Move revdeps computation to db 2020-11-20 17:23:21 +01:00
Ettore Di Giacinto
984366d3a5 Consider provides during upgrades 2020-11-05 20:52:02 +01:00
Ettore Di Giacinto
9cb290b484
Improve database errors 2020-04-30 20:44:34 +02:00
Ettore Di Giacinto
8e91c255a3
Make FindPackageMatch match packages HumanReadableString 2020-04-19 10:47:55 +02:00
Ettore Di Giacinto
77ba4193aa
Add ValidateSelector to versioner interface and consume it
We can refactor furthermore by dropping the package methods, as now we
can consume a versioner in all places that requires it
2020-04-05 15:52:16 +02:00
Ettore Di Giacinto
84625be9ac
Adapt package.Best to take a Versioner interface 2020-04-04 15:33:14 +02:00
Ettore Di Giacinto
5e31d940f0
Introduce Packages for []Package 2020-04-04 14:29:08 +02:00
Daniele Rondina
c7652c8a70 Added labels to package definition
* cmd/search: Add support for search of the packages
  with a specific label.

* review Search method of Repositories for permit
  different search modes.

* labels are k/v attributes and could be matched
  through label key (with HasLabel method) or through
  regex that use "$key" + "=" + "$value"
2020-03-21 19:24:27 +01:00
Daniele Rondina
91d05b071d
Review version comparision logic 2020-01-01 13:43:21 +01:00
Ettore Di Giacinto
15250bd991 Add support for Package provides
Add "provides" field in packages (which affect both runtime and buildtime deps).
It replaces all the occurences in the deptree before solving, actually
allowing to swap packages and provide virtuals. Along with a mechanism
for package rename #25.
2019-12-17 19:32:31 +01:00
Ettore Di Giacinto
69be9a2dd1
Add FindPackageVersions to DB 2019-12-13 17:18:26 +01:00
Ettore Di Giacinto
57181d7cbf Add FindPackages()
The version inmemory is optimized, while the boltdb implementation is
not.

It returns a list of the same package but with all the versions present
in the db.
2019-12-06 16:29:15 +01:00
Ettore Di Giacinto
556668fcc4 Make Expand and Revdeps consume a database 2019-12-06 16:28:42 +01:00
Ettore Di Giacinto
595c10f357
Use fingerprint as ids in inmemorydb 2019-12-03 23:38:25 +01:00
Ettore Di Giacinto
55fa7265e5
Move selection logic to a db accessor #19
In this way the compiler consume such accessor, and make it possible to expand whenever used
2019-12-01 19:11:31 +01:00
Ettore Di Giacinto
4031a4ae81
Marshal JSON of package without escapes
Otherwise >, < get escaped as JSON does that in favour of browsers
2019-11-29 19:01:50 +01:00
Ettore Di Giacinto
f71cc5281e
Offer World from database
Compute here world instead of scattering it in different structures.

Also move Best() in package and make expansion here #20
2019-11-29 19:01:48 +01:00
Ettore Di Giacinto
62af9c81d5
BoltDB fixups
Unmarshalling needs well-defined structs, also swap pointers in few places where needed.

There are few more TODOS pending (like getting UpdatePackage fixed properly)
2019-11-25 20:03:37 +01:00
Ettore Di Giacinto
a8b350fd8e
Implement uninstall
Also add RemovePackage in database implementation (boltdb is not tested yet)

Add test case for uninstall
2019-11-24 00:16:12 +01:00
Ettore Di Giacinto
0d7b2cf448
Track installed files 2019-11-23 22:41:51 +01:00
Ettore Di Giacinto
b2060c82e3
Make DB Switchable
Fixes races conditions and make the DB Switchable. Also prepare inside
the CompilationSpec the tree of the deps to be built, and parallelize
only the building jobs.

Closes #7

Signed-off-by: Ettore Di Giacinto <mudler@gentoo.org>
2019-11-16 13:26:33 +01:00
Ettore Di Giacinto
83fb1d1219
Add Matches() to pkg.Package 2019-11-15 18:04:46 +01:00
Ettore Di Giacinto
4fbe84b30b
Support concurrency in InMemoryDB and reach feature parity with boltdb 2019-11-02 17:56:43 +01:00
Ettore Di Giacinto
ef1d0e5573
Make also deps recalculation concurrent 2019-11-01 16:26:11 +01:00
Ettore Di Giacinto
a5ceafca26
Add Tree parser with bolt
Also add Tree builder (Recipe) which can recompose trees.
2019-10-31 12:38:59 +01:00
Ettore Di Giacinto
c3197d70fc
Add boltdb implementation for packageset and db 2019-10-31 12:38:32 +01:00
Ettore Di Giacinto
9f3f715324
Add BuildFormula and ReuiresContains tests 2019-06-11 23:38:16 +02:00
Ettore Di Giacinto
cab133f229
Imeplement PackageDatabase
Consume InMemoryDatabase for now, which act as a singleton in-memory db.
2019-06-11 23:04:01 +02:00