Skip to content

Commit

Permalink
Only add python-software-properties if needed; correct distribution r…
Browse files Browse the repository at this point in the history
…ewrites for BioNode
  • Loading branch information
chapmanb committed Jul 4, 2011
1 parent 6593855 commit 9f3960f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 2 additions & 4 deletions cloudbio/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def _setup_ubuntu():
env.logger.info("Ubuntu setup")
shared_sources = _setup_deb_general()
# package information. This is ubuntu/debian based and could be generalized.
version = env.dist_name
sources = [
"deb http://us.archive.ubuntu.com/ubuntu/ %s universe", # unsupported repos
"deb http://us.archive.ubuntu.com/ubuntu/ %s multiverse",
Expand All @@ -58,19 +57,18 @@ def _setup_ubuntu():
"deb http://archive.canonical.com/ubuntu maverick partner", # sun-java
"deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu lucid main", # Free-NX
] + shared_sources
env.std_sources = _add_source_versions(version, sources)
env.std_sources = _add_source_versions(env.dist_name, sources)

def _setup_debian():
env.logger.info("Debian setup")
shared_sources = _setup_deb_general()
version = env.dist_name
sources = [
"deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen", # mongodb
"deb http://cran.stat.ucla.edu/bin/linux/debian %s-cran/", # latest R versions
"deb http://archive.cloudera.com/debian lenny-cdh3 contrib" # Hadoop
] + shared_sources
# fill in %s
env.std_sources = _add_source_versions(version, sources)
env.std_sources = _add_source_versions(env.dist_name, sources)

def _setup_deb_general():
"""Shared settings for different debian based/derived distributions.
Expand Down
6 changes: 4 additions & 2 deletions cloudbio/edition/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ def rewrite_apt_sources_list(self, sources):
main_repository = 'http://ftp.us.debian.org/debian/'
else:
main_repository = env.debian_repository
new_sources = ["deb {repo} %s main contrib non-free".format(repo=main_repository),
"deb {repo} %s-updates main contrib non-free".format(repo=main_repository)]
new_sources = ["deb {repo} {dist} main contrib non-free".format(repo=main_repository,
dist=env.dist_name),
"deb {repo} {dist}-updates main contrib non-free".format(
repo=main_repository, dist=env.dist_name)]
return sources + new_sources

class Minimal(Edition):
Expand Down
1 change: 1 addition & 0 deletions config/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ programming:
- gfortran
- stow
- rsync
- python-software-properties
libraries:
- libatlas-base-dev
- libatlas-dev
Expand Down
2 changes: 1 addition & 1 deletion fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ def _setup_apt_sources():
Uses python-software-properties, which provides an abstraction of apt repositories
"""
sudo("apt-get install -y --force-yes python-software-properties")
env.edition.check_packages_source()

comment = "# This file was modified for "+ env.edition.name
Expand All @@ -495,6 +494,7 @@ def _setup_apt_sources():
for source in env.edition.rewrite_apt_sources_list(env.std_sources):
env.logger.debug("Source %s" % source)
if source.startswith("ppa:"):
sudo("apt-get install -y --force-yes python-software-properties")
sudo("add-apt-repository '%s'" % source)
elif not contains(env.sources_file, source):
append(env.sources_file, source, use_sudo=True)
Expand Down

0 comments on commit 9f3960f

Please sign in to comment.