old new ... ... @@ -1715,7 +1715,7 @@ public class PerforceSCM extends SCM {
1715 1715 String p4Client = this.p4Client;
1716 1716 p4Client = MacroStringHelper.substituteParameters(p4Client, build, env);
1717 1717 try {
1718 - p4Client = getEffectiveClientName(p4Client, buildNode);
1718 + p4Client = getEffectiveClientName(p4Client, buildNode, env);
1719 1719 } catch (Exception e) {
1720 1720 new StreamTaskListener(System.out).getLogger().println(
1721 1721 "Could not get effective client name: " + e.getMessage());
... ... @@ -1726,10 +1726,11 @@ public class PerforceSCM extends SCM {
1726 1726 private String getDefaultEffectiveClientName(AbstractProject project, Node buildNode, FilePath workspace)
1727 1727 throws IOException, InterruptedException {
1728 1728 String basename = MacroStringHelper.substituteParametersNoCheck(this.p4Client, getDefaultSubstitutions(project));
1729 - return getEffectiveClientName(basename, buildNode);
1729 + Map<String,String> emptyEnv = new Hashtable<String,String>();
1730 + return getEffectiveClientName(basename, buildNode, emptyEnv);
1730 1731 }
1731 1732
1732 - private String getEffectiveClientName(String basename, Node buildNode)
1733 + private String getEffectiveClientName(String basename, Node buildNode, Map<String,String> env)
1733 1734 throws IOException, InterruptedException {
1734 1735
1735 1736 String p4Client = basename;
... ... @@ -1757,6 +1758,7 @@ public class PerforceSCM extends SCM {
1757 1758 substitutions.put("hostname", host);
1758 1759 substitutions.put("hash", hash);
1759 1760 substitutions.put("basename", basename);
1761 + substitutions.putAll(env);
1760 1762
1761 1763 p4Client = MacroStringHelper.substituteParametersNoCheck(getSlaveClientNameFormat(), substitutions);
1762 1764 }