From: Jiri Slaby Date: Wed, 5 Aug 2015 08:32:54 +0000 (+0200) Subject: templates: lxc-opensuse, use rpm to determine build version X-Git-Tag: lxc-1.1.3~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05698d7c7a7ca8efe9914f1dfad69349adf746bc;p=thirdparty%2Flxc.git templates: lxc-opensuse, use rpm to determine build version zypper info's output is not usable for several reasons: * it is localized -- there is no "Version: " in my output * it shows results both from the repo and local system So use plain rpm to determine whether build is installed and if proper version is in place. Signed-off-by: Jiri Slaby --- diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in index 4ff1dcffa..d4e2b2852 100644 --- a/templates/lxc-opensuse.in +++ b/templates/lxc-opensuse.in @@ -421,7 +421,8 @@ if [ -z "$path" ]; then fi if grep -q Harlequin /etc/os-release || grep -q Tumbleweed /etc/os-release ; then - if [[ "$(zypper info build|awk -F "[- ]" '/Version/ {print $2}')" -lt "20141120" ]] ; then + BVER=`rpm -q --qf '%{version}\n' build` + if [ $? -ne 0 -o "$BVER" -lt "20141120" ]; then echo "Building openSUSE containers with your version of the build package is broken. Please install the update to version 20141120 or newer." exit 1 fi