aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-05-28 17:30:57 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-05-28 17:30:57 -0300
commita681e95d74eee2176aa9bf6800e8f541c4da7f35 (patch)
tree6a1030fb38853c846572146e5030420376db3db9 /share/hydractl
parent41e1c808791bc632eebbd69a44614c98dc4432ce (diff)
downloadhydra-a681e95d74eee2176aa9bf6800e8f541c4da7f35.tar.gz
hydra-a681e95d74eee2176aa9bf6800e8f541c4da7f35.tar.bz2
Dist upgrade: check for requirements and current version
Diffstat (limited to 'share/hydractl')
-rwxr-xr-xshare/hydractl/dist-upgrade16
1 files changed, 16 insertions, 0 deletions
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 => //'`"