From ecc1f41d5053807a70b51bcf2247b51d0ac81ae1 Mon Sep 17 00:00:00 2001
From: Federico Ressi <federico.ressi@intel.com>
Date: Mon, 28 Dec 2015 15:14:13 +0100
Subject: [PATCH] Don't reinstall package just after installing.

Boolean logic used in install_package was wrong:
on nominal flow packages were actually installed twice.
This should fix it.

Change-Id: Ia465414936b272d04523a11f83d6ded378fe1daf
Closes-Bug: #1518544
---
 functions-common | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/functions-common b/functions-common
index cb2998bfcd..361d27c854 100644
--- a/functions-common
+++ b/functions-common
@@ -1245,7 +1245,9 @@ function real_install_package {
 # install_package package [package ...]
 function install_package {
     update_package_repo
-    real_install_package $@ || RETRY_UPDATE=True update_package_repo && real_install_package $@
+    if ! real_install_package "$@"; then
+        RETRY_UPDATE=True update_package_repo && real_install_package "$@"
+    fi
 }
 
 # Distro-agnostic function to tell if a package is installed