]> git.ipfire.org Git - thirdparty/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)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 14 Aug 2015 17:28:01 +0000 (13:28 -0400)
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 6fd2bb7d5cc4c030f37cfde0474865ffe749fc89..5a917b9b5c23023d07040a2a631e7d6f5559ffdf 100644 (file)
@@ -395,7 +395,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