![](https://secure.gravatar.com/avatar/2f89906e4ad9c240ccc5e8883dc84226.jpg?s=120&d=mm&r=g)
Hi all, jmcquah@disroot.org wrote:
I've been developing for prt-get the additional logic to recognize optional dependencies when it sorts the install targets.
Sorting the install targets is only one of the commands that my fork does differently, depending on whether it sees the --softdeps flag (or the corresponding directive in prt-get.conf). Other commands include depends, dependent, deptree, and listorphans, as explained in the revised man-page. To get an idea for how big a patch is needed to implement these changes, I ran cloc on three different prt-get source trees (because running `diff -r` will also pick up the cosmetic whitespace changes). Here are the results. master branch, commit 8bc31c07455, scanned by github.com/AlDanial/cloc ---------------------------------------------------------------------- Language files blank comment code ---------------------------------------------------------------------- C++ 18 869 708 4478 C/C++ Header 17 270 267 704 m4 1 99 15 870 make 4 14 1 35 Bourne Shell 5 720 953 5612 ---------------------------------------------------------------------- SUM: 45 1972 1944 11699 ---------------------------------------------------------------------- softdeps branch, scanned by github.com/AlDanial/cloc ---------------------------------------------------------------------- Language files blank comment code ---------------------------------------------------------------------- C++ 18 871 714 4642 C/C++ Header 17 269 267 711 Meson 4 4 0 45 ---------------------------------------------------------------------- SUM: 39 1144 981 5398 ---------------------------------------------------------------------- Key takeaways: * implementing the softdeps feature only increased the C++ codebase by about 200 lines. * switching from autotools to meson trims the SLOC count by half! mixed-upinst branch, scanned by github.com/AlDanial/cloc ---------------------------------------------------------------------- Language files blank comment code ---------------------------------------------------------------------- C++ 18 802 681 4419 C/C++ Header 17 265 266 711 Markdown 1 13 0 97 Meson 4 4 0 45 ---------------------------------------------------------------------- SUM: 40 1084 947 5272 ---------------------------------------------------------------------- Key takeaways: * modest refactoring brought the C++ SLOC count down to where it was at the 5.19.6 release ... * ... while also incorporating Alan's proposed --group flag, the caching of getPkgmkSetting() values (FS#595), and question 1 at the bottom of TODO ("to install and update, which ever method is needed") Some of the refactoring in my mixed-upinst branch might also benefit the softdeps branch. But in at least one key behaviour (dependency resolution by default) the two branches are different, so adapting the refactored functions is a more delicate task. In the thread "RFC: next generation prt-get" from 15 years ago, Tilman and Johannes reported their own habits regarding dependency resolution. At the time, manual dependency tracking was apparently still very common, albeit with the assistance of a visual aid like `prt-get deptree` [1]. If that's still the majority preference among CRUX users, then even without all the refactoring that went into mixed-upinst, the softdeps branch of my fork is probably the better way to address Tim's point about suboptimal ordering of targets during sysup. In any case, as Fun points out in FS#1313, "CRUX is incredibly libertarian" so everyone is free to use whichever package management implementation they want. [1] https://lists.crux.nu/pipermail/crux/2008-June/001799.html -- John