From a681e95d74eee2176aa9bf6800e8f541c4da7f35 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 28 May 2019 17:30:57 -0300 Subject: Dist upgrade: check for requirements and current version --- share/hydractl/dist-upgrade | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'share/hydractl') diff --git a/share/hydractl/dist-upgrade b/share/hydractl/dist-upgrade index 82de2e9..965ab31 100755 --- a/share/hydractl/dist-upgrade +++ b/share/hydractl/dist-upgrade @@ -38,11 +38,27 @@ function hydra_system_upgrade_stage { # Set and check upgrade environment function hydra_system_upgrade_env { + # Check for requirements + for req in facter; do + hydra_install_package $req + done + # Available releases #release="`facter lsbdistcodename`" # this doesn't work on squeeze release="`facter 2> /dev/null | grep lsbdistcodename | sed -e 's/lsbdistcodename => //'`" + + # Since buster + if [ -z "$release" ]; then + release="`facter 2> /dev/null | grep codename | sed -e 's/codename => //' | cut -d '"' -f 2`" + fi + nextrelease="`hydra_next_debian_release $release`" + if [ "$nextrelease" == "Unsupported release" ]; then + echo "$nextrelease after $release" + exit 1 + fi + # Is a virtual machine? virtual="`facter 2> /dev/null | grep virtual | grep -v '^is_virtual' | sed -e 's/virtual => //'`" -- cgit v1.2.3