sahara-image-elements/elements/sahara-version/root.d/90-sahara-version
Luigi Toscano 52c39ec6d0 Remove the usage of 'which' (following dib)
diskimage-builder deprecated the usage of which (dib-lint marks its
occurrences as error by default):
https://review.openstack.org/#/c/466063/

Replace all the occurences of 'which' with 'type -p'.
Also, remove the (now useless) installation of which from
the disable-firewalld element.

Change-Id: I00bda062767070e46133cc800e82c9470923f572
2017-07-10 16:37:41 +02:00

21 lines
529 B
Bash
Executable File

#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
function _get_version_package {
if type -p pbr > /dev/null; then
local version=$(pbr info $1 | awk '{print $2}')
echo "${version}"
fi
}
cat << EOF | sudo tee "${TARGET_ROOT}/etc/sahara-extra.version"
sahara-image-elements version: $(_get_version_package "sahara-image-elements")
dib-utils version: $(_get_version_package "dib-utils")
diskimage-builder version: $(_get_version_package "diskimage-builder")
EOF