S
S
Sergey Karbivnichy2021-01-13 16:20:58
Algorithms
Sergey Karbivnichy, 2021-01-13 16:20:58

What algorithm is used in package managers?

I am writing my package manager in Python (similar to apt). Converted "Packages" files to SQLite database.
Now I can't figure out how to work with dependencies. For example: there are packages A,B,C,D,E...:
You need to download package D with all dependencies.
Package D depends on B;
Package B depends on A and C;
Package C depends on B;
Can you explain in simple terms the algorithm used in APT? Once I even found the names of the algorithm, now I can’t find it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2021-01-13
@hottabxp

Cyclic dependencies (B → C → B) usually do not exist. But you need the dumbest search - for example, in depth.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question