All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

open-130: allow override of the downloads cache location

Review Request #537 - Created Jan. 19, 2012 and updated

Oz Linden Reviewers
open-130 jenn
None autobuild
In some users environment, the default download location is not appropriate.  Allow an environment variable that if set takes precedence.
I've been using this both with and without the variable set for some weeks and have not found any problem.

Diff revision 2

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

1 2 3
1 2 3

  1. autobuild/common.py: Loading...
autobuild/common.py
Revision e1687c2ac203 New Change
... 110 lines hidden [Expand]
def get_autobuild_environment():
111
    Return an environment under which to execute autobuild subprocesses.
111
    Return an environment under which to execute autobuild subprocesses.
112
    """
112
    """
113
    return dict(os.environ, AUTOBUILD=os.environ.get(
113
    return dict(os.environ, AUTOBUILD=os.environ.get(
114
        'AUTOBUILD', get_autobuild_executable_path()))
114
        'AUTOBUILD', get_autobuild_executable_path()))
115

   
115

   
116
def get_default_install_cache_dir():
116
def get_default_install_cache_dir():
117
    """
117
    """
118
    In general, the package archives do not change much, so find a 
118
    In general, the package archives do not change much, so find a 
119
    host/user specific location to cache files.
119
    host/user specific location to cache files.
120
    """
120
    """
121
    return get_temp_dir("install.cache")
121
    cache = os.getenv('AUTOBUILD_INSTALLABLE_CACHE')

   
122
    if cache == None:

   
123
        cache = get_temp_dir("install.cache")

   
124
    else:

   
125
        if not os.path.exists(cache):

   
126
            os.makedirs(cache, mode=0755)

   
127
    return cache
122

   
128

   
123
def get_s3_url():
129
def get_s3_url():
124
    """
130
    """
125
    Return the base URL for Amazon S3 package locations.
131
    Return the base URL for Amazon S3 package locations.
126
    """
132
    """
127
    return "http://s3.amazonaws.com/viewer-source-downloads/install_pkgs"
133
    return "http://s3.amazonaws.com/viewer-source-downloads/install_pkgs"
128

   
134

   
129
def get_temp_dir(basename):
135
def get_temp_dir(basename):
130
    """
136
    """
131
    Return a temporary directory on the user's machine, uniquified
137
    Return a temporary directory on the user's machine, uniquified
... 479 lines hidden [Expand]
  1. autobuild/common.py: Loading...