Closed RangHo closed 3 years ago
Currently dependency of a package is described in requirements
file using shell script and source
'd by require.sh
. I find this rather inefficient. There are two candidates to resolve this issue:
PKGBUILD
, allowing to put arbitrary commands in pre-install and post-install hooks,jq
.The first option gives more extensibility, but the second option is far easier to manage (I think).
Is creating a cross-distro dependency manager feasible in the first place? There are several scenarios to address:
bat
binary is packaged as bat
in Arch, but batcat
in Ubuntu, because of a name collision);AUR
for Arch and PPA
for Debian-likes;Trying to specify packages for all platforms might be the safest bet, but I am lazy as fuck intend to keep package description file as simple as possible.
It seems shell script gives the optimal flexibility here. My current design provides common functionality such as installing binary package or other dotfile package, and leaves other configurations to each packages. If one package creates files elsewhere, it's that package's responsibility to clean up upon uninstallation of package. For that, package description file may provide these functions:
pre_install
- executed before any "common" package installation,post_install
- executed after all "common" packages are installed,pre_uninstall
- executed before uninstalling any package,post_uninstall
- executed after uninstalling all packages.Maybe requiring fzf
as a part of core dependency might be a good idea. Since pretty much all package managers provide a way to search their repositories, fuzzy finding required package names and prompting users to select from multiple options should give good UX with flexibility.
It might be good to have smarter installation script that can:
It would take a lot of efforts, though.