Hi, Quoting Benjamin Drung (2022-01-25 21:01:11) > > I find it interesting that somebody is using the --simulate option. In > > what scenario is it useful to have it? > > We have a web UI to select packages (plus their version) and > repositories that we want to add to the image that we built. Currently > that list includes 37 packages, including the versioned kernel package, > kernel modules, in-house software. That data is passed to our live > image build system (which consists of bdebstrap YAML files plus many > configs for /etc). In total the system uses variant minbase plus around > 130 packages. > > Before we switched to from our custom Shell script to use > bdebstrap/mmdebstrap, we had a test script. This test script tried to > "apt-get install -s" the packages to test the package selection. The > test script had following benefits: > > 1) It could detect incompatibilities between packages. > > 2) It could detect if exactly one kernel package was installed. Since > we built a live system, we need kernel (and we only want one to not > waste space). > > 3) It took only a few second to execute and could be used to quickly > verify the package selection. > > Now I am trying to get this feature working with bdebstrap/mmdebstrap. > --simulate can do address point one and three. Point 2 can be done with a > custom APT solver.
No need for a custom apt solver. If you just want to check whether apt installs the stuff you expect, then you can make use of /usr/lib/apt/solvers/apt which offers an EDSP interface to the apt solver. You could also use dose3 to ask whether there exists a valid installation set but I think you want the exact solution that apt would choose. That's where /usr/lib/apt/solvers/apt comes in. By feeding it your problem in the EDSP format [1] you can then parse the result to find out what solution (if any) apt would go for. The advantage is, that the input and output are in a well defined machine readable format and you don't have to parse the output of apt-get --simulate which is intended for human parsers. Thanks! cheers, josch [1] /usr/share/doc/apt/external-dependency-solver-protocol.md.gz
signature.asc
Description: signature