From e64a6f8c9a00815292b190a59723dbad933c408f Mon Sep 17 00:00:00 2001
From: Ben Kero <ben.kero@gmail.com>
Date: Fri, 18 Mar 2016 11:46:04 -0700
Subject: [PATCH] Fix add-apt-repository package for precise

Running 'disk-image-create -a amd64 -o precise vm precise' will fail to
build with the following error [1]. To fix this, we should split out the
switch-case to allow base to install the 'software-properties-common'
package.

[1]

dib-run-parts Fri Mar 18 18:43:16 UTC 2016 Running /tmp/in_target.d/pre-install.d/03-baseline-tools
Hit:1 http://mirrors.cat.pdx.edu/ubuntu precise InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-software-properties is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  software-properties-common

  E: Package 'python-software-properties' has no installation candidate

Change-Id: I011f02fcf70df9d1d6fa30ed89907fbc2588937e
---
 elements/base/pre-install.d/03-baseline-tools | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/elements/base/pre-install.d/03-baseline-tools b/elements/base/pre-install.d/03-baseline-tools
index f292fb742..3b5bb9a60 100755
--- a/elements/base/pre-install.d/03-baseline-tools
+++ b/elements/base/pre-install.d/03-baseline-tools
@@ -12,6 +12,10 @@ case $DISTRO_NAME in
         # Note: add-apt-repository would be nice for RPM platforms too - so when we
         # need something like it, create a wrapper in dpkg/bin and fedora/bin.
         apt-get -y update
-        install-packages python-software-properties
+        if [ "${DIB_RELEASE}" = "precise" ]; then
+            install-packages python-software-properties
+        else
+            install-packages software-properties-common
+        fi
         ;;
 esac