]> git.proxmox.com Git - mirror_lxc.git/commitdiff
templates: lxc-opensuse, use rpm to determine build version
authorJiri Slaby <jslaby@suse.cz>
Wed, 5 Aug 2015 08:32:54 +0000 (10:32 +0200)
committerJiri Slaby <jslaby@suse.cz>
Wed, 5 Aug 2015 08:32:54 +0000 (10:32 +0200)
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 <jslaby@suse.cz>
templates/lxc-opensuse.in

index 7c0a40ee2cb190973ea20d8cce1eb6dc965085d5..45b072c68c600e97ab3641816f8cb30b06fc2253 100644 (file)
@@ -422,7 +422,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