Source: fai Source-Version: 5.10.3 Severity: important User: debian-d...@lists.debian.org Usertags: dpkg-db-access-meta dpkg-db-access-inert
Hi! This package contains multiple scripts that access the internal dpkg database directly, instead of using publicly supported interfaces: * examples/simple/scripts/LAST/50-misc Checks for the existence of «$target/var/lib/dpkg/info/fai-server.list» to check whether the package is installed, it should instead use «dpkg-query --admindir $target/var/lib/dpkg --show fai-server» (dpkg-query does not currently support --root) or perhaps «dpkg --root $target --status fai-server» and get Status field from there. * bin/install_packages The function mkpackagelist() checks for the presence of the available file. The correct interface is «dpkg --root $FAI_ROOT --print-avail», which will print nothing if the file is empty or missing. The function create_debian_pkg_list() parses the available file, but just as the above one, it should be switched to parse the output from «dpkg --root $FAI_ROOT --print-avail». * bin/fai-make-nfsroot The add_packages_nfsroot() function and the main routine, write into the available db directly, these should instead use «… apt-cache dumpavail | dpkg --root $NFSROOT --update-avail», and to remove the available db «dpkg --root $NFSROOT --clear-avail». This is a problem for several reasons, because even though the layout and format of the dpkg database is administrator friendly, and it is expected that those might need to mess with it, in case of emergency, this “interface” does not extend to other programs besides the dpkg suite of tools. The admindir can also be configured differently at dpkg build or run-time. And finally, the contents and its format, will be changing in the near future. Thanks, Guillem