BUG 2042088 : SDK Updater: we want to keep getenv(TEMP_SDK_URL)

Renamed the getenv and added one for user sources.
Added a (naive) check to prevent duplicate URLs.

Also fixed the repositoy.xml download error message, it was not displaying the reason of failure correctly.
This commit is contained in:
Raphael
2009-08-07 16:36:19 -07:00
parent 1736f2ce65
commit 1cf0c7fe0e
3 changed files with 64 additions and 4 deletions

View File

@@ -335,17 +335,40 @@ public class UpdaterWindowImpl {
RepoSources sources = mUpdaterData.getSources();
sources.add(new RepoSource(SdkRepository.URL_GOOGLE_SDK_REPO_SITE, false /*userSource*/));
String str = System.getenv("TEMP_SDK_URL"); // TODO STOPSHIP temporary remove before shipping
// SDK_UPDATER_URLS is a semicolon-separated list of URLs that can be used to
// seed the SDK Updater list for full repositories.
String str = System.getenv("SDK_UPDATER_URLS");
if (str != null) {
String[] urls = str.split(";");
for (String url : urls) {
sources.add(new RepoSource(url, false /*userSource*/));
if (url != null && url.length() > 0) {
RepoSource s = new RepoSource(url, false /*userSource*/);
if (!sources.hasSource(s)) {
sources.add(s);
}
}
}
}
// Load user sources
sources.loadUserSources(mUpdaterData.getSdkLog());
// SDK_UPDATER_USER_URLS is a semicolon-separated list of URLs that can be used to
// seed the SDK Updater list for user-only repositories. User sources can only provide
// add-ons and extra packages.
str = System.getenv("SDK_UPDATER_USER_URLS");
if (str != null) {
String[] urls = str.split(";");
for (String url : urls) {
if (url != null && url.length() > 0) {
RepoSource s = new RepoSource(url, true /*userSource*/);
if (!sources.hasSource(s)) {
sources.add(s);
}
}
}
}
mRemotePackagesPage.onSdkChange();
}