[28203] in Source-Commits
scripts commit: Ensure add-apt-repository exists
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue May 13 14:43:35 2014
Date: Tue, 13 May 2014 14:43:27 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201405131843.s4DIhRMv013203@drugstore.mit.edu>
To: source-commits@MIT.EDU
https://github.com/mit-athena/scripts/commit/3283f4b86acd00803af3ee6c71ed3d1694576eb8
commit 3283f4b86acd00803af3ee6c71ed3d1694576eb8
Author: Jonathan Reed <jdreed@mit.edu>
Date: Tue May 13 13:17:44 2014 -0400
Ensure add-apt-repository exists
With trusty, when installed via PXE, it's possible to end up
without add-apt-repository in the target. This ensures it is
available. Unfortunately, it is provided by different packages
across different distributions.
installer/install-debathena.beta.sh | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/installer/install-debathena.beta.sh b/installer/install-debathena.beta.sh
index fee2212..0b933ae 100644
--- a/installer/install-debathena.beta.sh
+++ b/installer/install-debathena.beta.sh
@@ -63,6 +63,7 @@ fi
distro=`lsb_release -cs`
aptitude=aptitude
prerelease=no
+add_apt_repo=python-software-properties
case $distro in
squeeze|wheezy)
;;
@@ -77,6 +78,7 @@ case $distro in
ubuntu=yes
aptitude=apt-get
prerelease=yes
+ add_apt_repo=software-properties-common
;;
lenny|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|quantal|raring)
error "The release you are running ($distro) is no longer supported."
@@ -355,6 +357,11 @@ if [ yes = "$resolvconfhack" ]; then
apt-get -y install resolvconf
fi
+if ! hash add-apt-repository >/dev/null 2>&1; then
+ output "Installing add-apt-repository"
+ apt-get -y install "$add_apt_repo"
+fi
+
# Only add our openafs component if DKMS isn't available
openafs_component=""
if aptitude show openafs-modules-dkms > /dev/null; then