Merge branch 'stable-2.10'

* stable-2.10:
  Inject InitStep members again before calling postRun.
  SSHD: Update to 0.13.0
  Bump SSHD Mina version to 2.0.8
  Bump Bouncycastle version to 1.51
  Update EncryptedContactStore to not use deprecated/removed methods

Change-Id: I7853def28109357e8629f1384f90d4630da00483
This commit is contained in:
Shawn Pearce
2014-11-11 10:28:39 -08:00
6 changed files with 41 additions and 27 deletions

View File

@@ -67,6 +67,8 @@ public class BaseInit extends SiteProgram {
protected final PluginsDistribution pluginsDistribution;
private final List<String> pluginsToInstall;
private Injector sysInjector;
protected BaseInit(PluginsDistribution pluginsDistribution,
List<String> pluginsToInstall) {
this.standalone = true;
@@ -108,7 +110,7 @@ public class BaseInit extends SiteProgram {
run = createSiteRun(init);
run.upgradeSchema();
init.initializer.postRun();
init.initializer.postRun(createSysInjector(init));
} catch (Exception failure) {
if (init.flags.deleteOnFailure) {
recursiveDelete(getSitePath());
@@ -326,7 +328,8 @@ public class BaseInit extends SiteProgram {
}
private Injector createSysInjector(final SiteInit init) {
final List<Module> modules = new ArrayList<>();
if (sysInjector == null) {
final List<Module> modules = new ArrayList<Module>();
modules.add(new AbstractModule() {
@Override
protected void configure() {
@@ -334,7 +337,9 @@ public class BaseInit extends SiteProgram {
bind(InitFlags.class).toInstance(init.flags);
}
});
return createDbInjector(SINGLE_USER).createChildInjector(modules);
sysInjector = createDbInjector(SINGLE_USER).createChildInjector(modules);
}
return sysInjector;
}
private static void recursiveDelete(File path) {

View File

@@ -22,6 +22,7 @@ import com.google.gerrit.pgm.init.api.InitStep;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.plugins.JarPluginProvider;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
import java.io.File;
@@ -71,6 +72,8 @@ public class InitPlugins implements InitStep {
private final InitPluginStepsLoader pluginLoader;
private final PluginsDistribution pluginsDistribution;
private Injector postRunInjector;
@Inject
InitPlugins(final ConsoleUI ui, final SitePaths site,
InitFlags initFlags, InitPluginStepsLoader pluginLoader,
@@ -95,6 +98,11 @@ public class InitPlugins implements InitStep {
postInitPlugins();
}
@Inject(optional = true)
void setPostRunInjector(Injector injector) {
postRunInjector = injector;
}
private void installPlugins() throws IOException {
List<PluginData> plugins = listPlugins(site, pluginsDistribution);
for (PluginData plugin : plugins) {
@@ -146,6 +154,7 @@ public class InitPlugins implements InitStep {
private void postInitPlugins() throws Exception {
for (InitStep initStep : pluginLoader.getInitSteps()) {
postRunInjector.injectMembers(initStep);
initStep.postRun();
}
}

View File

@@ -109,12 +109,13 @@ public class SitePathInitializer {
}
}
public void postRun() throws Exception {
public void postRun(Injector injector) throws Exception {
for (InitStep step : steps) {
if (step instanceof InitPlugins
&& flags.skipPlugins) {
continue;
}
injector.injectMembers(step);
step.postRun();
}
}

View File

@@ -15,16 +15,16 @@
# Version should match lib/bouncycastle/BUCK
[library "bouncyCastleProvider"]
name = Bouncy Castle Crypto Provider v149
url = http://www.bouncycastle.org/download/bcprov-jdk15on-149.jar
sha1 = f5155f04330459104b79923274db5060c1057b99
name = Bouncy Castle Crypto Provider v151
url = http://www.bouncycastle.org/download/bcprov-jdk15on-151.jar
sha1 = 9ab8afcc2842d5ef06eb775a0a2b12783b99aa80
remove = bcprov-.*[.]jar
# Version should match lib/bouncycastle/BUCK
[library "bouncyCastleSSL"]
name = Bouncy Castle Crypto SSL v149
url = http://www.bouncycastle.org/download/bcpkix-jdk15on-149.jar
sha1 = 924cc7ad2f589630c97b918f044296ebf1bb6855
name = Bouncy Castle Crypto SSL v151
url = http://www.bouncycastle.org/download/bcpkix-jdk15on-151.jar
sha1 = 6c8c1f61bf27a09f9b1a8abc201523669bba9597
needs = bouncyCastleProvider
remove = bcpkix-.*[.]jar

View File

@@ -1,20 +1,20 @@
include_defs('//lib/maven.defs')
# This version must match the version that also appears in
# gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config
VERSION = '1.49'
# gerrit-pgm/src/main/resources/com/google/gerrit/pgm/libraries.config
VERSION = '1.51'
maven_jar(
name = 'bcprov',
id = 'org.bouncycastle:bcprov-jdk15on:' + VERSION,
sha1 = 'f5155f04330459104b79923274db5060c1057b99',
sha1 = '9ab8afcc2842d5ef06eb775a0a2b12783b99aa80',
license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
)
maven_jar(
name = 'bcpg',
id = 'org.bouncycastle:bcpg-jdk15on:' + VERSION,
sha1 = '081d84be5b125e1997ab0e2244d1a2276b5de76c',
sha1 = 'b5fa4c280dfbf8bf7c260bc1e78044c7a1de5133',
license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
deps = [':bcprov'],
)
@@ -22,7 +22,7 @@ maven_jar(
maven_jar(
name = 'bcpkix',
id = 'org.bouncycastle:bcpkix-jdk15on:' + VERSION,
sha1 = '924cc7ad2f589630c97b918f044296ebf1bb6855',
sha1 = '6c8c1f61bf27a09f9b1a8abc201523669bba9597',
license = 'DO_NOT_DISTRIBUTE', #'bouncycastle'
deps = [':bcprov'],
)

View File

@@ -8,9 +8,8 @@ EXCLUDE = [
maven_jar(
name = 'sshd',
id = 'org.apache.sshd:sshd-core:0.12.0-9-g635de65',
sha1 = '1ff3c9ebd0acfcd095eef30a0ee0b99846967711',
repository = GERRIT,
id = 'org.apache.sshd:sshd-core:0.13.0',
sha1 = 'c616c5865cc55473c6d63c6fcf46e60d382be172',
license = 'Apache2.0',
deps = [':core'],
exclude = EXCLUDE,
@@ -18,8 +17,8 @@ maven_jar(
maven_jar(
name = 'core',
id = 'org.apache.mina:mina-core:2.0.7',
sha1 = 'c878e2aa82de748474a624ec3933e4604e446dec',
id = 'org.apache.mina:mina-core:2.0.8',
sha1 = 'd6ff69fa049aeaecdf0c04cafbb1ab53b7487883',
license = 'Apache2.0',
exclude = EXCLUDE,
)