irods / irods_testing_environment

BSD 3-Clause "New" or "Revised" License
8 stars 14 forks source link

Avoid use of `apt` in scripts #209

Open SwooshyCueb opened 4 months ago

SwooshyCueb commented 4 months ago

At present, we use apt in a few different places in the testing environment: https://github.com/irods/irods_testing_environment/blob/e4c1eed5606bc4fc915ef803977dacb1df2a38d1/negotiation_key.py#L67-L68 https://github.com/irods/irods_testing_environment/blob/e4c1eed5606bc4fc915ef803977dacb1df2a38d1/irods_testing_environment/install/ubuntu_installer.py#L3-L13 https://github.com/irods/irods_testing_environment/blob/e4c1eed5606bc4fc915ef803977dacb1df2a38d1/irods_testing_environment/install/debian_installer.py#L3-L13

Use of apt in scripts should be avoided.

From the apt manpage:

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 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.