irods / irods_python_ci_utilities

1 stars 7 forks source link

Avoid use of `apt` in scripts #18

Open SwooshyCueb opened 1 year ago

SwooshyCueb commented 1 year ago

apt-get and/or dpkg should be used in lieu of apt in scripts when possible. From the apt manpage (emphasis mine):

The apt(8) commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use.

All features of apt(8) are available in dedicated APT tools like apt-get(8) and apt- cache(8) as well. apt(8) just changes the default value of some options (see apt.conf(5) and specifically the Binary scope). So you should prefer using these commands (potentially with some additional options enabled) in your scripts as they keep backward compatibility as much as possible.

We are using apt in at least one location: https://github.com/irods/irods_python_ci_utilities/blob/946d6cb479ca7717a07014befaf49a0b20774352/irods_python_ci_utilities/irods_python_ci_utilities.py#L107

apt-get should be used to install packages from repositories. dpkg should be used to install local packages, then apt-get should be used to resolve dependencies, like so: https://github.com/irods/irods_development_environment/blob/224706f9f00c27d99be152660fb0c340dcfaf082/build_and_copy_packages_to_dir.sh#L49-L61